In AWS we have wide range of database services to fit our application requirements. These database services are fully managed and can be launched in minutes with just a few clicks.
AWS database services include:
Amazon Relational Database Service(Amazon RDS)support for six commonly used database engines.
— Amazon Aurora,
Amazon Dynamo DB,a fast and flexible No SQL database service,
Amazon Red shift, a petabyte-scale data warehouse service,and
Amazon Elastic ache,an in-memory cache service with support for Mem cached and Redis.
AWS also provides the AWS Database Migration Service,a service which makes it easy and in expensive to migrate your databases to AWS cloud.
Amazon Relational Database Service (Amazon RDS)
The most common type of database in use today is the relational data base.The relational database has roots going back to the1970s when Edgar F. Codd,working for IBM,developed the concepts of the relational model.Today,relational databases power all types of applications from social media apps,e-commerce websites,and blogs to complex enterprise applications.
Amazon Relational Database Service(Amazon RDS)makes it easy to setup,Operate,and scale a relational database in the cloud.It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks such as hardware provisioning, database setup, patching and backups
A relational database consists of one or more tables,and a table consists of columns and rows similar to a spread sheet.
A database column contains a specific attribute of the record,such as a person’s name, address, and telephone number.
Each attribute is assigned a datatype such as text,number,or date,and the database engine will reject in valid inputs.
|Student ID||First Name||Last Name||Gender||Age|
Here is an example of a basic table that would sit in a relational database.There are five fields with different data types:
Student ID=Number or integer First Name =String
Last Name =String
Gender=String(Character Length=1) Age =Integer
This sample table has four records, with each record representing an individual student. Each student has a Student ID field,which is usually a unique number per student.A unique number that identifies each student can be called a primary key.
A relational database can be categorized as either an Online Transaction Processing (OLTP) or Online Analytical Processing(OLAP) database system,depending on how the tables are organized and how the application uses the relational database.
OLTP refers to transaction oriented applications that are frequently writing and changing data(for example, data entry and e-commerce).
OLAP is typically the domain of data warehouses and refers to reporting or analyzing large data sets
A data warehouse is a central repository for data that can come from one or more sources.This data repository is often a specialized type of relational database that can be used for reporting and analysis via OLAP. Organizations typically use data warehouses to compile reports and search the database using highly complex queries
No SQL Databases
No SQL databases have gained significant popularity in recent years because they are often simpler to use, more flexible, and can achieve performance levels that are difficult or impossible with traditional relational databases.
Traditional relational databases are difficult to scale beyond a single server without significant engineering and cost,but a No SQL architecture allows for horizontal scalability on commodity hardware.
No SQL databases are non-relational and do not have the same table and column semantics of a relational database.
No SQL databases are instead often key/value stores or document stores with flexible schemas
Amazon RDS supports six database engines:MySQL,PostgreSQL,Maria DB,Oracle,SQL Server,and Amazon Aurora
MySQL is one of the most popular open source databases in the world,and it is used to power a wide range of applications,from small personal blogs to some of the largest websites in the world.Amazon RDS MySQL allows you to connect using standard MySQL tools such as MySQL Workbench or SQL Workbench/J
PostgreSQL is a widely used opensource database engine with a very rich set of features and advanced functionality.Amazon RDS PostgreSQL can be managed using standard tools like pg Admin and supports standard JDBC/ODBC drivers.
Maria DB is a popular opensource database engine built by the creators of MySQL and enhanced with enterprise tools and functionality.
Oracle is one of the most popular relational databases used in the enterprise and is fully supported by Amazon RDS. Amazon RDS supports access to schemas on a DB Instance using any standard SQL client application,such as Oracle SQL Plus
Microsoft SQL Server
Microsoft SQL Server is another very popular relational database used in the enterprise.Amazon RDS allows Database Administrators(DBAs) to connect to their SQL Server DB Instance in the cloud using native tools like SQL Server Management Studio.
Amazon RDS SQL Server also supports four different editions of SQL Server:Express Edition,Web Edition,Standard Edition,and Enterprise Edition.
Licensing: AWS offers two licensing models:License Included and Bring Your Own License (BYOL)for Amazon RDS Oracle and Microsoft SQL Server as they are commercial software products.
Amazon Aurora is a fully managed service,is MySQL compatible,and provides for increased reliability and performance over standard MySQL deployments. Amazon Aurora can deliver up to five times better performance compared to MySQL.We can use the same code,tools, and applications that we use with existing MySQL databases with Amazon Aurora.
2 copies of your data is contained in each availability zone,with minimum of 3 availability zones.6 copies of your data.
Aurora is designed to transparently handle the loss of up to two copies of data without affecting database write availability and up to three copies without affecting read availability.
Aurora storage is also self-healing.Data blocks and disks are continuously scanned for errors and repaired automatically.
We can create two types of replications for Aurora
- Aurora Replicas (currently 15)
- MySQL Read Replicas(currently 5)
Amazon RDS issues Amazon Elastic Block Store(Amazon EBS).Based on your performance and cost requirements we can select Magnetic,General Purpose(Solid State Drive[SSD]),or Provisioned IOPS(SSD).Depending on the database engine and workload,you can scale up to 4 to 6 TB in provisioned storage and up to 30,000 IOPS.
Backup and Recovery
Amazon RDS provides two mechanisms for backing up the database:
- Automated backups and
- Manual snapshots
An automated backup is an Amazon RDS feature that continuously tracks changes and backs up your database.
Default of 7 days, but you can modify the retention period up to a maximum of 35 days.
When you delete a DB Instance,all automated backup snapshots are deleted and can not be recovered.
Automated backups will occur daily during a configurable 30-minute maintenance window called the backup window.
Automated backups are kept for a configurable number of days,called the backup retention period.
You can restore your DB Instance to any specific time during this retention period,creating a new DB Instance.
Manual DB Snapshots
This is a manually initiated task. We have to perform this backup manually.
A DB manual snapshot is initiated by us and can be created as frequently as we want.
We can then restore the DB Instance to the specific state in the DB snapshot at anytime
Manual DB snapshots are kept until you explicitly delete them with the Amazon RDS console.
We can use automated backup or manual snapshot to recovery the database.
Amazon RDS allows you to recovery our database using automated backups or manual DB snapshots.
You can not restore from a DB snapshot to an existing DB Instance;a new DB Instance is created when you restore.
When using automated backups,Amazon RDS combines the daily backups performed during your predefined maintenance window in conjunction with transaction logs to enable you to restore your DB Instance to any point during your retention period,typically up to the last five minutes.
By using Multi-AZ we can increase the availability of the database using replication.We will get a same copy of production database in an other availability zone for DR purpose(Disaster Recovery).
Multi-AZ allows you to place a secondary copy of your database in another Availability Zone for disaster recovery purposes.
Multi-AZ deployments are available for all types of Amazon RDS database engines.
When you create a Multi-AZ DB Instance,a primary instance is created in one Availability Zone and a secondary instance is created in another Availability Zone.
Amazon will takes care about the replication between primary Database and Secondary database.
Amazon RDS detects and automatically recovers from most common failures for Multi-AZ deployments so that we will not get any down times and recovers without administrative intervention.
Multi-AZ deployments are for disaster recovery only; they are not meant to enhance database performance.
To improve database performance/Scaling we have to use read replicas or Elastic Cache
Read replica’s allow you to have a read only copy of your production database.This is achieved by using Asynchronous replication from the primary RDS instance to the read replica.You use read replica’s primarily for very read-heavy database workloads
Read replicas are currently supported for:
- Maria DB,and
- Amazon Aurora.
Updates made to the source DB Instance are a synchronously copied to the read replica.
You can create one or more replicas of a database with in a single AWS Region or across multiple AWS Regions.
We can use Read replicas for Scaling !!!Not for DR!
Must have automatic backups turned on in order to deploy a read replica.
You can have up to 5 read replicas copies of any databases
You can have read replicas of read replicas and each read replica will have its own DN Send
You can not have Read Replicas that have Multi-AZ
You can create Read Replica’s of Multi-AZ source databases however.
Read Replicas can be promoted to be their own databases.This breaks the replication.
More Information :https://www.fgrade.com/amazon-web-services/