Using Amazon RDS When You Should be Using Amazon DynamoDB or Vice-Versa?

Published Date :

Using Amazon RDS When You Should be Using Amazon DynamoDB or Vice-Versa?

Understanding the difference between RDS and DynamoDB

The first step in deciphering the difference between RDS and DynamoDB is to understand the difference between Relational (SQL) vs Non-Relational (NoSQL). In a nutshell, relational databases use predefined schema, storing data in rows and columns much like a spreadsheet, non-relational databases like DynamoDB, on the other hand, use dynamic schema, are document-oriented, and scale horizontally.

About Relational (SQL)

Relational Databases use Structured Query Language (SQL)—a universally known query language familiar to most database admins—to interact. They have a predefined schema, which is confined to relational and tabular data governed by rules to ensure consistency and integrity. SQL databases abstract data as a set of tuples—a single row of a record—organized into relations. This approach enables abstraction over the physical representation of data and access paths.

By scaling vertically, SQL databases can increase processing hardware power. For instance enhancing a single server workload by increasing RAM, CPU, SSD, etc.


Advantages of Relational (SQL)
⦿ Faster query processing
⦿ The use of a standardized language—SQL
⦿ No specific coding language is needed and syntax rules are not complex, making it a simple language to learn and use
⦿ Flexible queries


Disadvantages of Relational (SQL)
⦿ Complex interface: requires a certain style of design to assure adequate performance
⦿ Expensive: some versions are not cheap, limiting access to some programmers
⦿ Downtime: can result from changes to the schema
⦿ Limited horizontal scalability[Text Wrapping Break] ‍


Non-Relational (NoSQL)

Unlike SQL databases, NoSQL Database Management Systems are non-relational. They do not use SQL, instead, they have dynamic schemas for unstructured data. They can have different schema types according to their data models, i.e.

⦿ Document
⦿ Key-Value
⦿ Wide-Column
⦿ Graph

For working with large amounts of data or data sets that change frequently, NoSQL is the ideal database option.

Compared to SQL databases, which can be scaled vertically, NoSQL scales horizontally (i.e. by increasing the number of servers or nodes.)


Advantages of Non-Relational (NoSQL)
⦿ Highly scalable, thanks to lack of structure in the data, and can be tailored to meet your business’s particular scaling needs
⦿ High availability
⦿ Flexibility on data types, since there is no predefined schema, your application can adapt quickly to new information without major adjustments to table structure, indexes, etc.
⦿ Ideal for big data applications: their ability to handle large datasets makes them ideal for big data applications like IoT
⦿ Less code: requires only a few lines of code to get started.


Disadvantages of Non-Relational (NoSQL)
⦿ Less flexibility in queries compared to SQL
⦿ Less mature: finding solutions to specific problems may be more difficult as there is significantly less online support, documentation, etc. as compared to SQL
⦿ Cannot scale automatically: needs additional infra, like load balancers, making it more expensive
⦿ Lack of standardization


RDS (SQL) & DynamoDB (NoSQL): Similarities and Differences

The biggest advantage that both RDS and DynamoDB share is that they are fully managed by AWS. That means the underlying operating system (OS) and core components are managed by AWS. Routine tasks, e.g. provisioning, patching, backup, recovery, failure detection, and repair, are automatically carried out by AWS.
In contrast, if you’re running a database on-premises or on an EC2 instance, the responsibility of taking care of the operating system, patching, backups, and availability is on you. Thus using RDS or DynamoDB, reduces administrative costs; all you need to do is take care of the data.


High availability: This is another feature common to both RDS and DynamoDB. Amazon replicates the databases so they are running two at the same time in different zones. This way, even in the event of a failure in zone availability, there will be no gap in service.


RDS Specifics

Amazon’s RDS service lets you set up, operate, and scale relational (SQL) databases on AWS. There are six SQL-based database engine options that a user can opt for on AWS. They are:

⦿ Amazon Aurora
⦿ MariaDB
⦿ PostgreSQL
⦿ Oracle
⦿ Microsoft SQL Server

A good AWS consultant can help you choose any from the engines above, as well as version and configurations like instance type, storage size, and network specs, to spin up a new fully-managed relational database on AWS.


RDS: Features
⦿ Multiple AZ: RDS runs two replicated databases in different zones to ensure high availability. In the event of a failure, it automatically switches over from the primary to the replicated database.
⦿ Automatic Backups: Automated snapshots let you restore to any point of time within your backup retention period.
⦿ Patching: You don’t need to do anything, AWS takes the responsibility for patching. All you need to do is select a maintenance window and AWS will handle it without any downtime.
⦿ Monitoring: Using AWS CloudWatch, you can monitor various metrics such as CPU, memory, and disk usage/throughput.
⦿ Storage: RDS offers users three different types of storage:[Text Wrapping Break] – General-purpose SSD[Text Wrapping Break] – Provisioned IOPS SSD[Text Wrapping Break] – MagnetiC
‍⦿ Encryption: In addition to using SSL to secure data during transit, all snapshots, backups, replicas, etc are encrypted, and you can opt to manage encryption keys using AWS Key Management Service (KMS).



For non-relational (NoSQL) databases, AWS offers DynamoDB, which supports Document and Key Value type data structures.
Like RDS, DynamoDB is a fully managed NoSQL database service. AWS provides DynamoDB as a serverless solution; in other words, there are no servers to provision, patch, or manage, and no software to install, maintain or operate.

Tables—a collection of items and items—a collection of attributes in DynamoDB are core components. Each item is identified, using primary keys, in a table and secondary indexes for more flexibility in queries.

As in relational databases, a partition key is used along with a sort key to creating a second attribute. This enables a bigger and faster return of the data.
Provisioning and charging are done using Capacity Units (C U), which are informed when the table is created. Capacity Units can be Read Capacity Units or Write Capacity Units

⦿ Read Capacity Unit (RCU): represents one consistent or two eventually consistent reads per second, for a 4KB item.
⦿ Write Capacity Unit (WCU): one write per second, for a 1KB item.


Features of DynamoDB
⦿ High Availability: automatic replication of your data across multiple availability zones provides high availability and durability
⦿ Scalability: DynamoDB monitors the performance usage of a user’s application and scales throughput and storage based on the user’s previously set capacity.
⦿ Global Tables: Selecting this option, results in your data being automatically replicated across your choice of AWS regions
⦿ Backups: You can create full backups on-demand of your DynamoDB table data for archiving. In addition, you can also protect tables from accidental deletion through point-in-time recovery.
⦿ Encryption: By default, all data at rest is encrypted using encryption keys stored in AWS Key Management Service (KMS)
⦿ Monitoring: AWS CloudWatch can be used to monitor metrics



Both AWS RDS and DynamoDB offer fully managed cloud service options. Routine tasks—e.g. provisioning, patching, backup, recovery, and repair are all handled through AWS or using an AWS-managed services company such as Teleglobal.

RDS solutions are popular within ERP, CRM, financial data, and transactional applications. RDS permits you to set up, operate, and scale relational (SQL) databases on AWS, with several instance types.

AWS DynamoDB meanwhile is a serverless solution that scales tables to adjust for capacity automatically with no administration required by you. Common applications include real-time bidding, shopping carts, and mobile applications.
As an AWS Advancer Partner, Teleglobal works with customers to determine which database (RDS or DynamoDB) is best suited for your business needs.
Reach out to us today to fortify your cloud and database solution.



Share Blog :