Wednesday, May 28, 2025

Amazon Aurora: The Concept, Benefits, Limitations, Use Cases.

Here is twtech clear breakdown of Amazon Aurora, covering its concept, benefits, limitations, & use cases:

 Amazon Aurora: Concept

Amazon Aurora is a fully managed, high-performance relational database built for the cloud by AWS. It is compatible with MySQL and PostgreSQL, offering the ease of databases combined with the performance and availability of high-end commercial databases like Oracle or SQL Server.

Aurora separates storage and compute:

·        Storage layer is distributed, fault-tolerant, and auto-scaling.

·        Compute layer handles SQL processing and connects to the storage layer.

Aurora is part of the Amazon RDS family but offers a different architecture optimized for cloud-native applications.

Benefits of Amazon Aurora

1.     High Performance

o   Up to 5x faster than MySQL and 3x faster than PostgreSQL.

o   Uses a custom storage engine built for low-latency and high throughput.

2.     High Availability & Durability

o   6-way replication across 3 Availability Zones.

o   Automatic failover (Aurora Multi-AZ).

o   Continuous backups to S3, point-in-time recovery.

3.     Serverless Option

o   Aurora Serverless v2 allows you to auto-scale compute based on workload.

o   Pay-per-use model, ideal for variable or unpredictable traffic.

4.     Scalability

o   Up to 128 TB per database instance.

o   Read scaling with up to 15 Aurora Replicas for horizontal scaling.

5.     Compatibility

o   Drop-in compatible with MySQL and PostgreSQL.

o   Makes migration and development easier.

6.     Security & Compliance

o   Encryption at rest and in transit.

o   VPC integration, IAM, KMS, audit logging, and compliance support (HIPAA, PCI-DSS, etc.).

7.     Fast Cloning & Snapshots

o   Fast and space-efficient cloning of databases for dev/test/staging.

 Limitations of Amazon Aurora

1.     Engine Lock-in

o   Only supports MySQL- and PostgreSQL-compatible engines.

o   Not suitable if you need Oracle or SQL Server features.

2.     Cost

o   More expensive than standard RDS MySQL/PostgreSQL.

o   Aurora Serverless can be unpredictable in pricing at scale.

3.     Limited Extensions Support

o   PostgreSQL Aurora may not support all PostgreSQL extensions.

o   May restrict highly customized or legacy PostgreSQL applications.

4.     Vendor Lock-In

o   Proprietary AWS technology—difficult to migrate back to on-prem or other clouds.

5.     Complexity in Some Features

o   Aurora Serverless v1 lacks features like cross-region replication.

o   Manual scaling in provisioned mode unless using Serverless v2.

 Use Cases

Use Case

Why Aurora is Suitable

Cloud-Native Applications

Designed for elastic, distributed, and scalable environments.

SaaS Applications

Multi-tenant apps benefit from Aurora's performance and availability.

Microservices Architecture

Aurora Serverless fits unpredictable workloads and bursty traffic.

Data Analytics & BI

High read throughput and fast clones help support reporting workloads.

Disaster Recovery & Backup

Built-in multi-AZ, point-in-time recovery, and continuous backups.

Read-Heavy Workloads

Aurora Replicas allow you to horizontally scale read capacity.

Dev/Test Environments

Fast cloning allows efficient test DB creation with minimal overhead.

 Summary Comparison

Feature

Aurora

RDS MySQL/PostgreSQL

Self-Managed DB

Fully Managed

Performance

🚀 High

Moderate

Varies

Serverless Option

(v2 recommended)

Scaling

Auto (Serverless), Read Replicas

Limited

Manual

Cost

💰 Higher

Lower

Depends

OS Access

Custom Extensions

Limited

Moderate

Full


 

RDS Custom : The Concept, Benefits, Limitations , Use Cases

 

Amazon RDS Custom is a managed database service by AWS that provides greater control over the database and operating system than standard Amazon RDS. It is designed for applications that require custom configurations or access to the underlying OS and DB environment, which isn't possible with traditional RDS.

 Concept

Amazon RDS Custom is essentially a hybrid between Amazon RDS and a self-managed database on EC2:

  • twtech gets Amazon RDS-like automation (backups, patching, monitoring).
  • But also twtech has root OS and full DB instance access to customize settings or install additional software.

RDS Custom currently supports:

  • RDS Custom for Oracle
  • RDS Custom for SQL Server

It allows:

  • Custom OS-level configurations
  • Installation of additional software
  • Access to database log and trace files
  • Integration with legacy or third-party applications

Benefits

  1. Root OS Access: SSH into the host and customize OS or database settings.
  2. Customizations: Modify database parameters, install agents, use custom scripts, or patch manually.
  3. Managed Automation: Get automated backups, monitoring, snapshots, and recovery.
  4. Lift-and-Shift Compatibility: Ideal for migrating legacy databases with custom configurations.
  5. License Flexibility: Bring-Your-Own-License (BYOL) support.

 Limitations

  1. Fewer Engine Options: Only supports Oracle and SQL Server (as of now, May.28-2025).
  2. Not Fully Managed: Since twtech has OS-level access, it is responsible for security, patching, and compliance for customizations.
  3. Complexity: Adds operational overhead compared to standard RDS.
  4. Limited High Availability: No Multi-AZ deployments (currently). twtech must manage HA and failover manually.
  5. Cost: Higher than standard RDS because it uses dedicated EC2 instances (bare metal or Nitro-based).
  6. Break Glass Responsibility: If twtech changes something that breaks automation, AWS will shift support responsibility back to twtech.

 Use Cases

Use Case

Why RDS Custom is Suitable

Legacy Database Migration

Migrate apps that require specific DB versions, patches, or configurations.

Custom Monitoring/Backup Tools

Install agents or tools not supported in standard RDS.

Third-Party Integrations

Required OS-level software or custom drivers.

Regulatory Compliance

Need access to trace files, audit logs, or custom hardening.

Custom Patch Management

twtech needs control over when and how patches are applied.

Oracle or SQL Server Advanced Features

Use features not supported in standard RDS editions.

 
twtech insights: When NOT to Use RDS Custom
  • twtech doesn’t need OS-level access.
  • twtech prefers fully managed, hands-off database solutions.
  • twtech needs automated HA and failover out of the box.
  • twtech application supports Aurora or open-source DBs ( then twtech would use Aurora/RDS instead).

 Summary

Feature

RDS

RDS Custom

EC2 Self-Managed

Fully Managed

⚠️ Partial

OS Access

Custom Configs

Automation

✅ (with caveats)

Responsibility

Low

Medium-High

High

RDS vs. RDS Custom

RDS: The entire database & the OS is managed by AWS.

RDS Custom: with full admin access, user can manage the OS & the database.

Sunday, May 25, 2025

Amazon RDS, Amazon Aurora, and Amazon ElastiCache.

Here’s a comprehensive comparison and overview of Amazon RDS, Amazon Aurora, and Amazon ElastiCache, covering their concepts, key features, benefits, limitations, and use cases:

 1. Amazon RDS (Relational Database Service)

 Concept

Amazon RDS is a managed service that makes it easy to set up, operate, and scale relational databases in the cloud. It supports multiple database engines (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and Aurora).

 Key Features

·        Managed backups, patching, and maintenance

·        Multi-AZ deployments for high availability

·        Read replicas (for supported engines)

·        Automatic failover

·        Monitoring and metrics (CloudWatch)

·        Encryption at rest and in transit

·        IAM integration and VPC isolation

Benefits

·        Simplifies database administration

·        High availability and fault tolerance (Multi-AZ)

·        Auto-scaling storage

·        Enhanced security with IAM, KMS, and VPC

·        Cost-effective with pay-as-you-go pricing

Limitations

·        Limited customization (no OS-level access)

·        Slower failover compared to Aurora

·        Instance-based (no serverless mode except with Aurora Serverless)

·        Higher licensing costs for Oracle/SQL Server

 Use Cases

·        General-purpose web & mobile applications

·        Commercial and legacy enterprise applications

·        SaaS and CMS platforms (WordPress, Joomla)

·        Applications needing multi-DB engine support

 2. Amazon Aurora

 Concept

Amazon Aurora is a cloud-native relational database built by AWS, compatible with MySQL and PostgreSQL, offering up to 5x performance of MySQL and 3x of PostgreSQL with enterprise-grade availability.

 Key Features

·        Serverless option (Aurora Serverless v2)

·        Multi-AZ with auto-failover (sub-second)

·        Auto-scaling storage (up to 128 TB)

·        Replication: up to 15 read replicas

·        Global databases (cross-region)

·        Machine learning integration (via SQL)

·        Backtrack (rewind DB without restoring from backup)

 Benefits

·        High performance & low latency

·        Built-in fault tolerance and self-healing storage

·        Automated, near-instant failovers

·        Fully managed and scalable

·        Lower cost than commercial engines

 Limitations

·        Only supports MySQL and PostgreSQL compatibility

·        More expensive than RDS for small workloads

·        Some MySQL/PostgreSQL features/extensions may not be supported

 Use Cases

·        Mission-critical enterprise applications

·        E-commerce and financial platforms

·        Multi-tenant SaaS applications

·        Real-time analytics with transactional data

 3. Amazon ElastiCache

 Concept

Amazon ElastiCache is a fully managed in-memory data store and cache service supporting Redis and Memcached. It's designed for ultra-fast data access with sub-millisecond latency.

 Key Features

·        Supports Redis and Memcached engines

·        Sub-millisecond latency and high throughput

·        Clustering and sharding (Redis)

·        Backup and restore (Redis)

·        Multi-AZ with automatic failover (Redis)

·        TLS encryption and authentication

·        Auto-discovery (Memcached)

Benefits

·        Boosts application performance significantly

·        Reduces load on RDS/Aurora by caching frequent queries

·        Scalable and highly available

·        Seamless integration with AWS apps

 Limitations

·        Volatile memory (data loss possible unless Redis with backup)

·        Not suited for long-term persistent storage

·        Requires careful memory management and eviction policies

 Use Cases

·        Caching (e.g., session data, DB query results)

·        Leaderboards, counters, pub/sub systems

·        Real-time analytics and recommendation engines

·        Gaming, financial apps, and social media platforms

 twtech Quick Comparison Table:

Feature

Amazon RDS

Amazon Aurora

Amazon ElastiCache

Type

Relational DB

Relational (cloud-native)

In-memory cache/store

Performance

Good

High (3–5x RDS)

Ultra-fast (sub-ms)

High Availability

Multi-AZ

Multi-AZ + self-healing

Multi-AZ (Redis)

Scaling

Vertical & read replicas

Auto-scaling storage & compute

Horizontal (shards)

Use Cases

Traditional apps

High-performance apps

Caching, real-time data

Cost Efficiency

Moderate

Efficient at scale

Cost-effective cache

Serverless Option

No

Yes (Aurora Serverless v2)

No

Benefits  of using RDS versus deploying DB on EC2.

Using Amazon RDS (Relational Database Service) instead of deploying a database on an EC2 instance provides several key advantages, especially in terms of management, scalability, reliability, and cost-efficiency. Here's a breakdown of the advantages:

Advantages of Amazon RDS over Database on EC2

1. Fully Managed Service

  • RDS handles provisioning, patching, backup, and maintenance automatically.
  • EC2 requires you to install, configure, monitor, patch, and maintain the database manually.

2. Automated Backups and Snapshots

  • RDS provides automated backups, snapshots, and point-in-time recovery.
  • On EC2, you'd have to script and manage backup processes yourself.

3. High Availability and Failover

  • RDS supports Multi-AZ deployments for automatic failover and high availability.
  • On EC2, you'd need to architect and implement HA yourself using replication, failover scripts, etc.

4. Automatic Patching

  • RDS automatically applies security patches and minor version upgrades.
  • On EC2, you need to track and manually apply patches.

5. Scalability

  • RDS makes vertical scaling easy with a few clicks or API calls.
  • Read Replicas are available to horizontally scale reads.
  • On EC2, scaling requires manual changes and can involve downtime.

6. Monitoring and Metrics

  • RDS integrates with CloudWatch to provide DB metrics out of the box.
  • On EC2, you'd need to install and configure monitoring tools like CloudWatch Agent, Prometheus, etc.

7. Security and Compliance

  • RDS supports encryption at rest and in transit, IAM authentication, and VPC integration.
  • It’s easier to achieve compliance standards like HIPAA, PCI-DSS, etc.
  • On EC2, you must configure and maintain encryption, security groups, and access control yourself.

8. Time and Cost Efficiency

  • Less operational overhead leads to lower TCO (Total Cost of Ownership).
  • On EC2, the operational burden may require more effort, increasing engineering time and costs.

9. Maintenance Windows

  • RDS allows you to define maintenance windows for controlled updates.
  • On EC2, all updates are manual and could require downtime.

10. Built-in Resilience and Backup Retention

  • RDS offers automated snapshot retention, automatic recovery, and backup management.
  • On EC2, backups need to be scripted and managed (e.g., using EBS snapshots).

 When EC2 Might Be Preferred

There are scenarios where deploying a database on EC2 makes sense:

  • You need OS-level access or custom configurations not supported by RDS.
  • You want to run non-relational or unsupported databases.
  • You require legacy software or configurations not compatible with RDS.
  • You want full control over replication, storage, and tuning.

 Summary

Feature

Amazon RDS

Database on EC2

Management

Fully managed

Self-managed

Backups

Automatic

Manual setup

High Availability

Built-in (Multi-AZ)

Manual setup

Patching

Automatic

Manual

Scaling

Easy (vertical + read replica)

Manual and often disruptive

Monitoring

Integrated with CloudWatch

Manual setup

Security

Built-in IAM/KMS/VPC

Custom setup

Customization

Limited

Full control

 RDS Multi AZ for Disaster Recovery


Amazon RDS Multi-AZ (Multi-Availability Zone) is a high availability (HA) and disaster recovery (DR) feature that helps protect your relational database instances from infrastructure failure. Here’s a breakdown of how RDS Multi-AZ works and how it's used for disaster recovery:

 The concept of RDS Multi-AZ:

In Multi-AZ deployments, Amazon RDS automatically provisions and maintains a synchronous standby replica of your database in a different Availability Zone (AZ) within the same AWS Region.

·        The primary instance handles all reads and writes.

·        The standby replica is kept in sync via synchronous replication.

·        It is not directly accessible for read/write operations.

 Disaster Recovery Benefits

1.     Automatic Failover:

o   If the primary DB instance fails (e.g., hardware issues, network failure, AZ outage), RDS automatically fails over to the standby without manual intervention.

o   This results in minimal downtime and does not require application-side changes (same endpoint/DNS).

2.     Data Durability:

o   Since the standby is continuously updated via synchronous replication, data loss risk is minimized during failovers.

3.     No Data Rebuild Required:

o   Unlike backups, Multi-AZ does not require restoring data during a failover—your app continues with the standby replica.

4.     Maintenance and Patching:

o   During planned maintenance, RDS switches to the standby before updating the primary, reducing downtime.

 How It Works

#   plaintext
          +----------------------+

         |   Primary Instance   |
         |   (AZ-a)            |
         +----------+----------+
                    |
          Synchronous Replication
                    |
         +----------v----------+
         |   Standby Instance  |
         |   (AZ-b)            |
         +----------------------+
 
Application connects to: 
     → DB Endpoint (unchanged on failover)

Best Practices

·        Use Multi-AZ for Production Workloads: Critical for apps requiring high availability and quick recovery.

·        Combine with Backups: Multi-AZ is not a substitute for regular backups or cross-region replication.

·        Monitor with CloudWatch: Keep an eye on failover events and performance metrics.

·        Test Failovers: Use the Reboot with failover option to simulate and test disaster recovery scenarios.

 Multi-AZ vs Read Replicas

Feature

Multi-AZ

Read Replica

Purpose

High availability & DR

Read scaling

Sync or Async

Synchronous

Asynchronous

Can be read from?

❌ (no direct access)

✅ (used for scaling reads)

Auto failover

❌ (manual promotion required)

Same endpoint?

 twtech  Disaster Recovery plan:

If twtech wants protection from regional outages,  it considers the following options:

·        Cross-Region Read Replicas: For DR across regions (manually promote in disaster).

·        AWS Backup / Snapshots + Cross-Region Copy: Long-term DR.

·        Aurora Global Databases: For near real-time cross-region failover (Aurora-specific).

Project: Hands-on

How twtech creates and use the RDS in aws.

Go to aws console and Search the service: RDS

Create a database: twtech-rds-database


Select the database:  method and engine

twtech for the sake of this project is using:  standard creation method and MySQL engine.

Select the version of MYySQL: MySQL 8.0.41

Select the template type that meets the environment use cases: Production (twtech-engine has full control over the available options)

Select Availability and durability: single–AZ BD is okay for free tier instance

Deployment options

Choose the deployment option that provides the availability and durability needed for your use case. AWS is committed to a certain level of uptime depending on the deployment option you choose. Learn more in the Amazon RDS service level agreement (SLA) 

Settings

Select the DB instance identifier: database-1

Type a name for your DB instance. The name must be unique across all DB instances owned by your AWS account in the current AWS Region.

Enter credentials and self managed password:

Username: twtechpat

Enter a strong Password: twtech@xxx123xxx

Confirm the strong password: twtech@xxx123xxx

Instance configuration: to remain within the free tier option, twtech uses the Burstable classes

The DB instance configuration options below are limited to those supported by the engine that you selected above.

Select the: db.t3.micro

Select the type of volume (allocated storage):  General Purpose SSD(gp2)

Set volume capacity in GB: 15

twtech may choose to enable storage autoscaling (veritical scaling )for up to 1000GB

Select the Connectivity option: Don’t connect to an EC2 compute resource

Compute resource

Choose whether to set up a connection to a compute resource for this database. Setting up a connection will automatically change connectivity settings so that the compute resource can connect to this database.

And network type: IPV4.

Select the vpc and DB subnet group:

Select whether user created (twtechpat) should have access to the Database (DB) from twtech environment: twtech-MySQL-db


Choose VPC security group (firewall) or create one:  twtech-MySQL-db-SG

twtech may set a particular az or have no preference:


For additional configuration, set the port number for database to connect: 3306

Database port

TCP/IP port that the database will use for application connections.

Select the database authentication option (mechanism):  Password authentication

twtech may decide to enable monitoring or not: for the sake of this project, monitoring is disabled

from:

To:

 twtech may choose to export logs from rds to cloudwatch for:  monitoring and observability.

Additional configuration:  twtechmysqldb


Enable or disable backups: twtech chooses to retain backup of its database for: 30 day

twtech may also choose a particular time for backups: every 12:00 pm

Or twech may choose not to have any preference for backups: 

twtech may also enable replication (back of same db) to another aws region:

Encryption: for security and compliance, database must be encrypted

For maintainance: twtech chooses to enable auto minor version upgrade and  enable deletion protection (from accidental deletion of database)

Estimated monthly costs: rds is not free.

From: creating 

To: successfully created

Details:

Security group has inboud rule set on: 3306 from the IP address

Make sure on the security group,  port 3306 is accessed from anywhere-IPV4: edit inbound rules

From:

To:

twtech needs to download from google:  sql electron to access the database

Link:

https://sqlectron.github.io/

twtech use sql electron to connect to the database: twtech-mysql-db

Click on:  Download GUI


For windows computer select to download the: .exe version



Run the installation of: sqlectron-Setup

Installation Completed: user (twtechpat) can now add database

How twtech eventually uses the endpoint of database to connect from the:  sqlectron:

End-point: database-1.cbgskg8wxxxx.us-east-2.rds.amazonaws.com

Configure and test connection with sqlectron

Successful: 

Having tested and it all worked well:  Save the setting:

Connect to the database:


How twtech creates tables in the database: twtechtable

CREATE TABLE twtechtable (name VARCHAR(20),  first_name VARCHAR(20));

How twtech inserts data to the table:




Verify twtech database stored in table format:

How twtech creates a read replica of database in another region: from us-east-2(Ohio) to us-east-1 (N.Virginia)


Create read replica

You are creating a replica DB instance from a source DB instance. This new DB instance will have the source DB instance's DB security groups and DB parameter groups.

Instance configuration

The DB instance configuration options below are limited to those supported by the engine that you selected above.

AWS Region

Destination Region

The Region where the replica will be launched


Storage

Storage type

Provisioned IOPS SSD (io2) storage volumes are now available


Connectivity

Network type

To use dual-stack mode, make sure that you associate an IPv6 CIDR block with a subnet in the VPC you specify.

Database authentication



How twtech monitors the database (enabled during creation): to monitor the metric of the database. This gives  twtech, an insight of CPU utilization and how many clients are connected to the database at a particular time.


How twtech takes(creates)snapshots from the database:


Take snapshots: twtech-rds-snapshots

How twtech migrates database: to other AZs






How to remove termination protection and eventually delete unwanted databases:

Modify settings for the database on: Maintenance

From:

To: un-enable deletion protection

Confirm to: Modify DB instance: database-1


twtech user (twtechpat) can now delete that unwanted database: because it is no longer protected from deletion.

Confirm and delete;

Un-check (untenable): Create final snapshot

Un-check (untenable): Retain automated backups


Kubernetes Clusters | Upstream Vs Downstream.

  The terms "upstream" and "downstream" in the context of Kubernetes clusters often refer to the direction of code fl...