AWS Databases

RDS

RDS is a managed Relational Database Service where we take database engines, and we put a management layer around them to provide automation for many common tasks that developers to which would be otherwise manual. PDS provide Ease of administration. You don’t have to worry about patching, provisioning database, maintaining them over time. And can further scale those databases as your applications are growing.

Overview

Without Amazon RDS

With Amazon RDS

Getting started with amazon RDS,

MySQL is the world’s most popular open-source relational database and Amazon RDS makes it easy to set up, operate, and scale MySQL deployments in the cloud. So, let’s take a look on how to use MySQL on RDS.

Amazon RDS is the relational database service offered by AWS using which it is very easy to start any RDBMS without worrying much about the infrastructure. In this article, we have seen how to configure the RDS MySQL Environment in AWS.

From the RDS dashboard click on Create Database

Choose the creation option. Let us go ahead and apply the settings as defined in the figure below.

First, pick an engine according to your workload or needs

Second, which version of database. AWS offers all the major version of databases that are available in the market today.

We are going to select Standard Create as the database creation method. This will allow us to configure all the necessary settings on our own. Next, select the Engine Type as MySQL and the latest version.

Since we are going to create the database in the free tier, select the Free Tier from the template and proceed.

Provide a suitable name for the database instance. Similarly, provide a suitable master username and password for the same. This is the username and the password, that you will be using later to connect to this MySQL instance

Next, what type of instance you want to use.

· T family

· M family

· R family

Select the Database Instance Size as “db.t2.micro” and Storage Type as General Purpose SSD. By default, the memory size is allocated to 20GB which is fine for the moment.

Once you establish the database engine that you need and the compute capacities that you want for your databases, next stop is What type of storage you want. RDS offers two type of storage:

· General purpose SSD

· Provisioned IPOS SSD

In the next step, we should define the Connectivity settings for the RDS Database instance.

click on Create database. it might take a while for AWS to create the RDS instance and make it available for use. After a few moments, you will receive a notification that says the database has been created successfully.

DynamoDB

Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale. It is a fully managed database and supports both document and key-value data models. This enables it to scale as needed without requiring a customer’s capital investment in hardware. Its flexible data model and reliable performance make it a great fit for mobile, web, gaming, ad-tech, IoT, and many other applications. This requires no intervention from the user.

In this demo, you will create a table in Amazon DynamoDB to store information about a music library. You will then edit the music library.

From the management console, search for DynamoDB. Once you are landed on the DynamoDB Dashboard, click create table.

Enter the name of the table along with the keys. And then click on Create.

As you can see on the dashboard, your table is now created.

To create an item, click on create item and start adding data to your table.

In order to edit the data on the table, select the item and click Actions and from the dropdown select Edit.

Make the changes to want and then click Save.

You can use the query section to search/filter data.

This is how your final table looks like,

In order tot delete the table, look for Delete Table option on your dashboard.

You have created your first DynamoDB table, added items to your table, and then queried the table to find the items you wanted.

SQL vs NoSQL

With regards to picking a database the greatest choices are picking a relational (SQL) or non- relational (NoSQL) data structure. While both the database are practical choices still there are some important contrasts between the two that a user should remember when settling on a choice.

What is SQL?

Structured Query Language or SQL databases are primarily called as RDBMS or relational database and as the name suggests it is used where data is structured i.e., stored in tables with fixed rows and columns.

SQL can be effectively used to insert, search, update, delete database records. It can do a lot of things including, but not limited to, optimizing and maintenance of databases.

Relational databases like MySQL Database, Oracle, Ms SQL Server, Sybase, etc. use SQL.

Some of the major organizations that make use of SQL include:

  • Microsoft
  • Cognizant
  • Dell
  • Accenture
  • Stack Overflow

What is NoSQL?

NoSQL is a non-relational DMS, that focus on scaling, fast queries, allowing for frequent application changes, and making programming simpler for developers. Some say the term “NoSQL” stands for non SQL while others say it stands for not only SQL. Either way, most agree that NoSQL databases are databases that store data in a format other than relational tables.

NoSQL database is used for distributed data stores with humongous data storage needs for companies like Twitter, Facebook, Google that collect terabytes of user data every single day.

A NoSQL database has dynamic schema for unstructured data. Data is stored in many ways which means it can be,

1. Document database, store data in documents similar to JSON object where each document contains pairs of fields and values.

2. Wide-column database, stores data in with rows and dynamic columns. These are commonly used for storing Internet of Things data and user profile data.

3. graph database, store data in nodes and edges. Nodes typically store information about people, places, and things while edges store information about the relationships between the nodes.

4. Key-Value database, are a simpler type of database where each item contains keys and values. Common use cases include storing user preferences or caching.

This flexibility means that documents can be created without having defined structure first.

NoSQL database examples include Redis, RavenDB Cassandra, MongoDB, BigTable, HBase, Neo4j and CouchDB.

Key differences include:

· SQL databases use Tables with fixed rows and columns; whereas NoSQL database data can be stored in many ways like Document: JSON documents, Key-value: key-value pairs, Wide-column: tables with rows and dynamic columns, Graph: nodes and edges.

· In almost all situations SQL databases are vertically scalable. This means that you can increase the load on a single server by increasing things like RAM, CPU or SSD. But on the other hand, NoSQL databases are horizontally scalable. This means that you handle more traffic by sharing, or adding more servers in your NoSQL database.

· SQL database is the right option for solving ACID problems and NoSQL is a best used for solving data availability problems.

· Queries in NoSQL databases can be faster than SQL databases as they do not require joins.