0% found this document useful (0 votes)
6 views

Unit 5 Lecture 4

Uploaded by

Mansi Varshney
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Unit 5 Lecture 4

Uploaded by

Mansi Varshney
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Subject Name :-Cloud Computing

Subject Code :- KCS 713


Unit No. :- 5
Lecture No. :- 4
Topic Name :- Dynamo DB in Cloud Computing
Contents
1. Data Store
2. Types of Database
3. Data Dynamo Table
4. Dynamo Db
• Read request units/ Read Capacity Units
• Write request units/ Write Capacity Units
5. Dynamo DB Pricing
6. Dynamo Architecture
7. Benefits of Dynamo DB
8. Important Questions
9. References
Datastore
• Google and Amazon offer simple transactional <Key, Value> pair database stores
– Google App Engine’s Datastore
– Amazon’ SimpleDB
• All entities (objects) in Datastore reside in one BigTable table
– Does not exploit column-oriented storage
• Entities table: store data as one column family
Datastore
• Multiple index tables are used to support efficient queries
• BigTable:
– Horizontally partitioned (also called sharded) across disks
– Sorted lexicographically by the key values
• Beside lexicographic sorting Datastore enables:
– Efficient execution of prefix and range queries on key values
• Entities are ‘grouped’ for transaction purpose
– Keys are lexicographic by group ancestry
• Entities in the same group: stored close together on disk
• Index tables: support a variety of queries
– Uses values of entity attributes as keys
Datastore
• Automatically created indexes:
– Single-Property indexes
• Supports efficient lookup of the records with WHERE clause
– ‘Kind’ indexes
• Supports efficient lookup of queries of form SELECT ALL
• Configurable indexes
– Composite index:
• Retrieves more complex queries
• Query execution
– Indexes with highest selectivity is chosen
Types of Database

1. Unstructured Database:

• It is an information that either does not have a predefined data model or which is not organized in a pre-defined
manner.
• Unstructured information is typically text-heavy, but mat contain data such as dates, numbers and facts as well
examples include e-mail message, word processing, documents, vedios, photos, audio files, presentation web pages.

2. Semi- Structured Database-

Semi-structured data is the data which does not conforms to a data model but has some structure. It lacks a fixed
or rigid schema. It is the data that does not reside in a rational database but that have some organizational
properties that make it easier to analyse. With some process, we can store them in the relational database
3. Structured Database:
A data structure is a kind of repository that organizes information for that purpose. In a database, for example, each field
is discrete and its information can be retrieved either separately or along with data from other fields, in a variety of
combinations. The power of the database is its ability to make data comprehensive, so that it yields useful information. A
database query language, such as SQL (standard query language), allows a database administrator to interact with the
database.
Structured data contrasts with unstructured and semi-structured data. The three can be considered to exist on a
continuum, with unstructured data being the least formatted and structured data being the most formatted. Data is
increasingly amenable to processing as it is increasingly structured.
Dynamo Table

In DynamoDB, tables, items, and attributes are the core components that you work with. A table is a collection
of items, and each item is a collection of attributes. DynamoDB uses primary keys to uniquely identify each item in
a table and secondary indexes to provide more querying flexibility. You can use DynamoDB Streams to capture
data modification events in DynamoDB tables.

The following are the basic DynamoDB components:


1. Tables – Similar to other database systems, DynamoDB stores data in tables. A table is a collection of data. For
example, see the example table called People that you could use to store personal contact information about
friends, family, or anyone else of interest. You could also have a Cars table to store information about vehicles
that people drive.
2. Items – Each table contains zero or more items. An item is a group of attributes that is uniquely
identifiable among all of the other items. In a People table, each item represents a person. For
a Cars table, each item represents one vehicle. Items in DynamoDB are similar in many ways to rows,
records, or tuples in other database systems. In DynamoDB, there is no limit to the number of items you
can store in a table.

3. Attributes – Each item is composed of one or more attributes. An attribute is a fundamental data
element, something that does not need to be broken down any further. For example, an item in
a People table contains attributes called PersonID, LastName, FirstName, and so on. For
a Department table, an item might have attributes such as DepartmentID, Name, Manager, and so on.
Attributes in DynamoDB are similar in many ways to fields or columns in other database systems.
• The following diagram shows a table named People with some example items and attributes.
Read Request Units and Write Request Units

For on-demand mode tables, you don't need to specify how much read and write throughput you expect your
application to perform. DynamoDB charges you for the reads and writes that your application performs on your tables
in terms of read request units and write request units.

•One read request unit represents one strongly consistent read request, or two eventually consistent read requests, for
an item up to 4 KB in size. Two read request units represent one transactional read for items up to 4 KB. If you need
to read an item that is larger than 4 KB, DynamoDB needs additional read request units. The total number of read
request units required depends on the item size, and whether you want an eventually consistent or strongly consistent
read. For example, if your item size is 8 KB, you require 2 read request units to sustain one strongly consistent read, 1
read request unit if you choose eventually consistent reads, or 4 read request units for a transactional read request.
•One write request unit represents one write for an item up to 1 KB in size. If you need to write an item
that is larger than 1 KB, DynamoDB needs to consume additional write request units. Transactional write
requests require 2 write request units to perform one write for items up to 1 KB. The total number of write
request units required depends on the item size. For example, if your item size is 2 KB, you require 2 write
request units to sustain one write request or 4 write request units for a transactional write request.
DynamoDB pricing

1. Pricing for on-demand capacity mode


With on-demand capacity mode, DynamoDB charges you for the data reads and writes your
application performs on your tables. You do not need to specify how much read and write throughput you expect
your application to perform because DynamoDB instantly accommodates your workloads as they ramp up or
down.

On-demand capacity mode might be best if you:


• Create new tables with unknown workloads.
• Have unpredictable application traffic.
• Prefer the ease of paying for only what you use.
2. Pricing for provisioned capacity mode
With provisioned capacity mode, you specify the number of reads and writes per second that
you expect your application to require. You can use auto scaling to automatically adjust your table’s
capacity based on the specified utilization rate to ensure application performance while reducing costs.

Provisioned capacity mode might be best if you:


• Have predictable application traffic.
• Run applications whose traffic is consistent or ramps gradually.
• Can forecast capacity requirements to control costs.
Dynamo
• Developed by Amazon
• Supports large volume of concurrent updates, each of which could be small in size
– Different from BigTable: supports bulk reads and writes
• Data model for Dynamo:
– Simple <key, value> pair
– Well-suited for Web-based e-commerce applications
– Not dependent on any underlying distributed file system (for e.g. GFS/HDFS) for:
• Failure handling
– Data replication
– Forwarding write requests to other replicas if the intended one is down
• Conflict resolution
Dynamo Architecture
• Load balancing for:
– Transient failures
– Network
partition
• Write request on an
object:
– Executed at one
of its virtual
nodes
– Forwards the
request to all
nodes which
have the replicas
Dynamo Architecture
• Distributed object versioning
– Write creates a new version of an object with its local timestamp incremented
– Timestamp:
• Captures history of updates
• Versions that are superseded by later versions (having larger vector
timestamp) are discarded
• If multiple write operations on same object occurs at the same time, all
versions will be
maintained and returned to read requests
• If conflict occurs:
– Resolution done by application-independent logic
Benefits of Amazon DynamoDB

1. Managed service − Amazon DynamoDB is a managed service. There is no need to hire experts to manage
NoSQL installation. Developers need not worry about setting up, configuring a distributed database cluster,
managing ongoing cluster operations, etc. It handles all the complexities of scaling, partitions and re-partitions
data over more machine resources to meet I/O performance requirements.
2. Scalable − Amazon DynamoDB is designed to scale. There is no need to worry about predefined limits to the
amount of data each table can store. Any amount of data can be stored and retrieved. DynamoDB will spread
automatically with the amount of data stored as the table grows.
3. Fast − Amazon DynamoDB provides high throughput at very low latency. As datasets grow, latencies remain
stable due to the distributed nature of DynamoDB's data placement and request routing algorithms.
Benefits of Amazon DynamoDB

4. Durable and highly available − Amazon DynamoDB replicates data over at least 3 different data centers’
results. The system operates and serves data even under various failure conditions.
5. Flexible: Amazon DynamoDB allows creation of dynamic tables, i.e. the table can have any number of
attributes, including multi-valued attributes.
6. Cost-effective: Payment is for what we use without any minimum charges. Its pricing structure is simple
and easy to calculate.
Important Questions

1. Explain what is DynamoDB?


2. List some benefits of using Amazon DynamoDB?
3. What are the non-relational Databases?
4. Is Dynamo free for use?
5. Explain what is DynamoDB Mapper Class?
6. List the Data Types supported by DynamoDB?
7. Does DynamoDB support in-place atomic updates?
References
 Dan C Marinescu: “ Cloud Computing Theory and Practice.” Elsevier(MK) 2013.
 RajkumarBuyya, James Broberg, Andrzej Goscinski: “Cloud Computing Principles
and Paradigms”, Willey 2014.
 https://www.ques10.com/p/13989/explain-architecture-of-google-file-system-1/
 https://www.sciencedirect.com/topics/computer-science/google-file-system
 https://www.researchgate.net/publication/220910111_The_Google_File_System
 Enterprise Cloud Computing - Technology, Architecture, Applications, Gautam Shroff, Cambridge
University Press, 2010

You might also like