I want to write service in php where -
1) DynamoDB will have table t with two columns key and val
2) I will check if some key exists in table t or not.
3) If exist read data .. if don't exist insert new key-value in table t
I was checking some links http://docs.aws.amazon.com/AWSSDKforPHP/latest/index.html#m=AmazonDynamoDB/put_item http://docs.aws.amazon.com/aws-sdk-php/guide/latest/quick-start.html
Which one to follow ?
Also can someone give me quick example and exact syntax.
Thanks in advance.
You can Follow Example : http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSILowLevelPHP.Example.html
or you can also follow the guidelines :
http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.DynamoDb.DynamoDbClient.html
It hepled me alot
The full walkthrough is located HERE. It gives you a step by step outline of the setup process for credentials and comes with a easy to use add on to the PHP SDK for AWS
AWS Setup - AWS doesn't lay out the Credentials setup for you set by step, so I will.1. Go to AWS and get your PUBLIC_KEY and PRIVATE_KEY
2. Open Terminal
3. If you haven't created your credentials yet, in Terminal's fresh page, type in:
nano
function page will open up. You will seeGNU nano 2.0.6...
at the top.4. Inside the
nano
page, type in:5. Once you've typed it out, hit CONTROL + X (Yes...Control, not Command).
2. At the top of the file using the SDK (
index.php
or whatever), put in:The Basic Methods
Describe Table
Put Item
Get Item
Delete Item
Query Item
Hope this helps.
I found this basic walkthrough quite useful:
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleData.html