Want to know more about the differences between SQL and NoSQL databases? Read part one here.
Amazon Web Services offers a number of database options for users looking to move or create their database in the cloud. Amazon RDS and DynamoDB are two such offerings, one working as a more traditional relational database, the other a NoSQL option.
Amazon RDS provides users with access to their preferred relational database engines while relieving some of the “administrative burden” from the shoulders of the maintainers. Amazon RDS supports:
- Amazon Aurora
- MS SQL Server
AWS takes responsibility for patching the database software, and each database instance comes pre-configured based on the engine and class selected. It also pairs with CloudWatch and other AWS services to make monitoring and viewing your database metrics easy.
However, what of scalability? In the earlier post, SQL or No?: Relational and Non-Relational Databases, we address that while relational databases can scale, they are limited, primarily, to vertical scaling. AWS allows for this: At the highest tier, you can scale your database to have up to 32 CPU cores and 244 GiB of memory at the push of a button. However, if vertical scaling is not in your price range, those using Aurora, MySQL or PostgreSQL can scale out using read replicas. Read replicas copy the database via snapshot so multiple copies of the data can be used to mitigate high-volume read traffic. Any read replica can be promoted to the primary database, as needed.
AWS also provides security features to RDS users: All levels of the database — from tables to backups — are encrypted, and data-in-transit is secured via SSL. As with most relational databases, you can also fine-grain security on a table-by-table or row-by-row level.
But what if you need a more incrementally scalable and flexible database? This is where AWS’s NoSQL option, DynamoDB, shines.
Created as Amazon’s in-house solution for incrementally scalable, highly available key-value storage, DynamoDB aims to have a “very high reliability” for an always-up app, website, or solution.
DynamoDB features the same lower administrative burden of RDS, but with a schema-less key-value structure where the only required attribute is a primary key; you can also query with non-primary keys. The target size of the datum stored with DynamoDB is less than 1 MB. DynamoDB allows for object versioning.
Regarding scale, DynamoDB, like most NoSQL options, is horizontally scalable, featuring a decentralized system of “nodes” (or instances) that share the stress of the traffic. The work each node takes on will be proportionate to the capabilities of each server.
The data itself is replicated to these servers using consistent hashing and “eventually” consistent data storage, meaning that all updates will reach all replicas, but not instantly. This assists in recovery from permanent failures, as well, since divergent replicas can be synced in the background even if one server fails.
Both Amazon RDS and DynamoDB are excellent options for those looking for either a relational or non-relational database that scales with ease and requires less administrative work on the building and maintaining side of database management. In the battle of database types, knowledge is important: Know what you need out of a database, know what each option offers, and the choice between SQL and NoSQL should become clear.