AMAZON AWS
By,
Ranjith and Divakar
Amazon AWS features
-
Compute & Networking
-
Deployment & Management
-
Storage & Content Delivery
-
Database
-
App Services
AWS Products
Green ticks are used in Cloudbio
Amazon dynamo db
Getting Your Access Key ID and Secret Access Key
Go to the IAM console.
From the navigation menu, click Users.
Select your IAM user name.
Click User Actions, and then click Manage Access Keys.
-
Click Create Access Key.
Your keys will look something like this:
Access key ID example: AKIAIOSFODNN7EXAMPLE
Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
What is IAM console?
- AWS Identity and Access Management is a web service that enables Amazon Web Services (AWS) customers to manage users and user permissions in AWS.
- The service is targeted at organizations with multiple users or systems that use AWS products such as Amazon EC2, Amazon RDS, and the AWS Management Console. With IAM, you can centrally manage users, security credentials such as access keys, and permissions that control which AWS resources users can access.
Getting Your Access Key ID and Secret Access Key
Go to the IAM console.
From the navigation menu, click Users.
Select your IAM user name.
Click User Actions, and then click Manage Access Keys.
-
Click Create Access Key.
Your keys will look something like this:
Access key ID example: AKIAIOSFODNN7EXAMPLE
Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Click Download Credentials, and store the keys in a secure location.
Title
Dynamo DB
is a managed NOSQL Database service
- Store and retrieve any amount of data.
- Serve any level of request traffic.
- Without any operational burden
Design
Consideration
- Sacrifice strong consistency for availability
- Conflict resolution is executed during read instead of write,
i.e. “always writeable”.
- Incremental scalability.
Advantages
- Consistent, predictable performance
- Single digit millisecond latencies
- Backed on solid-state drives
- Application can deliver its functionality in abounded time: Every dependency in the platform needs to deliver its functionality with even tighter bounds.
Getting Your Access Key ID
and
Secret Access Key
Go to the IAM console.
From the navigation menu, click Users.
Select your IAM user name.
Click User Actions, and then click Manage Access Keys.
-
Click Create Access Key.
AWS KEY and secret Key ?
-
Your keys will look something like this:
Access key ID example: AKIAIOSFODNN7EXAMPLE
Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Click Download Credentials, and store the keys in a secure location.
What is IAM console?
- AWS Identity and Access Management is a web service that enables Amazon Web Services (AWS) customers to manage users and user permissions in AWS.
- The service is targeted at organizations with multiple users or systems that use AWS products such as Amazon EC2, Amazon RDS, and the AWS Management Console. With IAM, you can centrally manage users, security credentials such as access keys, and permissions that control which AWS resources users can access.
Keys in DynamoDB
-
Items are indexed by
primary key
-
Single hash keys and range keys
- Many local secondary indexes
Provisioned throughput
-
Reserve IOPS for reads and writes
-
Scale up (or down) at any
time.
-
Priced per hour of provisioned throughput
-
Write throughput units = item size * writes/sec
-
$0.01 per hour for 10 write units
-
Read throughput units = item size * ½ * reads/sec
-
$0.01 per hour for 100 read units
Transactions
-
Item level transactions
only
-
Puts, updates and deletes
-
Tables don't require a
formal schema
-
Items are an arbitrary
sized hash
-
Just need to specify the
primary key
Creating Connection to database
static AmazonDynamoDBClient client; AWSCredentials credentials = new PropertiesCredentials( Some.class.getResourceAsStream("AwsCredentials.properties") ); client = new AmazonDynamoDBClient(credentials);
accessKey = AKIAIWLBWNSATT3HUZGQ secretKey = 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
Saving an item in table
Map<String, AttributeValue> item1 = new HashMap<String, AttributeValue>();
item1.put("Id", new AttributeValue().withN("120"));
item1.put("Title", new AttributeValue().withS("Book 120 Title"));
item1.put("ISBN", new AttributeValue().withS("120-1111111111"));
item1.put("Authors", new AttributeValue()
.withSS(Arrays.asList("Author12", "Author22")));
item1.put("Price", new AttributeValue().withN("20.00"));
item1.put("Category", new AttributeValue().withS("Book"));
item1.put("Dimensions", new AttributeValue().withS("8.5x11.0x.75"));
item1.put("InPublication", new AttributeValue().withN("0")); // false
PutItemRequest putItemRequest1 = new PutItemRequest()
.withTableName(tableName)
.withItem(item1);
PutItemResult result1 = client.putItem(putItemRequest1);
Retrieving Data Scan
HashMap<String, AttributeValue> key = new HashMap<String, AttributeValue>();
key.put("Id", new AttributeValue().withN("120"));
GetItemRequest getItemRequest = new GetItemRequest()
.withTableName(tableName)
.withKey(key)
.withAttributesToGet(Arrays.asList("Id", "ISBN", "Title", "Authors"));
GetItemResult result = client.getItem(getItemRequest);
// Check the response.
System.out.println("Printing item after retrieving it....");
printItem(result.getItem());
Delete Data
HashMap<String, AttributeValue> key = new HashMap<String, AttributeValue> (); key.put("Id", new AttributeValue().withN("101")); DeleteItemRequest deleteItemRequest = new DeleteItemRequest() .withTableName(tableName) .withKey(key); DeleteItemResult deleteItemResult = client.deleteItem(deleteItemRequest);
HIGH LEVEL API
Operations Performed to get data from table
-
SCAN
- QUERY
SCAN
&
QUERY
-
A SCAN operation always scans the entire table, then filters out values to provide the desired result, essentially adding the extra step of removing data from the result set.
-
A QUERY operation only searches for a specific range of keys that satisfy a given set of key conditions and does not have the added step of filtering out results.
Query patterns
&
Operators Supported
-
Retrieve all items by
hash key
- ==(EQ), <, >, >=, <=, begins with, between.
Queries.?
Thank you
Amazon AWS
By divakar137
Amazon AWS
- 1,198