By Siddaraju Devaiah on Dec 2, 2016 4:45:27 AM
Amazon DynamoDB is a fully managed NoSQL database service that provides quick and predictable performance with scalability and is offered as part of Amazon Web Services' (AWS), cloud service platform.
DynamoDB takes off the administrative burdens of operating and scaling a distributed database, so that users need not have to worry about hardware provisioning and software patch update.
DynamoDB uses NoSQL database data model and derives the name from Dynamo, but DynamoDB has a different core level implementation.
DynamoDB Web service allows developers to purchase a service based on throughput rather than on storage.
In DynamoDB, tables, items, and attributes are the core components. A table is a set of items, and each item is a set of attributes. DynamoDB uses primary keys to uniquely identify each item in a table.
Following table lists the difference between DynamoDB and regular SQL Database:
|NoSQL Database||SQL Database|
|Non-relational database||Relational Databases (RDBMS)|
|Document-based, key-value pairs, graph databases||Table-based databases|
|Schema is dynamic||Schema is predefined|
|Queries are focused on collection of documents and referred as UnQL (Unstructured Query Language)||SQL ( structured query language ) for defining and altering the data|
|No foreign key concept||Foreign key concept to refer secondary table|
|DynamoDB MongoDB, BigTable are NoSQL databases||MS-SQL, Oracle, MySQL are SQL databases|
Sample Table - Person in DynamoDB:
When should one go for AWS DynamoDB?
Today’s web-based applications generate and consume huge amounts of data. For example, an online game/blog might start out with only a few hundreds of end users and a light database workload consisting of 10 writes per second and 50 reads per second. However, if the game/blog becomes successful in the market, it may instantly grow and used by millions of end users and expect tens or even hundreds of thousands of writes and reads per second. The application may also expect to create terabytes (TB) of data write per day based on popularity quotient. Developing or implementing such applications using Amazon DynamoDB enables developer to start small capacity for a table as the requirements to continue to function well when expands its end user base in size/volume without incurring application downtime. Above all, the applications should be in AWS.
Advantages of DynamoDB:
- Scalable - User can store unlimited amount of data.
- Distributed - DynamoDB scales horizontally by expanding a single table over multiple server
- Cost Effective - One year free tier allows more than 40 million database operations/month and pricing is based on throughput (read/write per second) rather than storage
- Automatic data replication - All data items are stored on Solid State Disks (SSDs) and automatically replicated across multiple availability zones in a region
- Secure - DynamoDB uses proven secured methods to authenticate users and prevent unauthorized data access
Disadvantages of DynamoDB:
- Deployable only on AWS and cannot be installed on individual desktops/servers
- Queries - Querying data is extremely limited
- Table Joins - Joins are impossible
- No Triggers
- No foreign keys concept to refer to other table items
- No server side scripts