Using Amazon Aurora Global Database for Low Latency without Application Changes
AWS Architecture BlogUsing Amazon Aurora Global Database for Low Latency without Application Changesby Roneel Kumar and Antony Prasad Thevaraj | on11 JAN 2022| inAmazon Aurora,Amazon CloudWatch,Amazon EC2,Amazon ElastiCache,Amazon RDS,Analytics,Architecture,Containers,Developer Tools,DevOps,Serverless|Permalink|ShareDeploying global applications has many challenges, especially when accessing a database to build custom pages for end users. One example is an application usingAWS Lambda@Edge. Two main challenges include performance and availability.This blog explains how you can optimally deploy a global application with fast response times and without application changes.TheAmazon Aurora Global Databaseenables a single database cluster to span multiple AWS Regions by asynchronously replicating your data within subsecond timing. This provides fast, low-latency local reads in each Region. It also enables disaster recovery from Region-wide outages using multi-Region writer failover. These capabilities minimize the recovery time objective (RTO) of cluster failure, thus reducing data loss during failure. You will then be able to achieve your recovery point objective (RPO).However, there are some implementation challenges. Most applications are designed to connect to a single hostname with atomic, consistent, isolated, and durable (ACID) consistency. But Global Aurora clusters provide reader hostname endpoints in each Region. In the primary Region, there are two endpoints, one for writes, and one for reads. To achieve strong  data consistency, a global application requires the ability to:Choose the optimal reader endpointsChange writer endpoints on a database failoverIntelligently select the reader with the most up-to-date, freshest dataThese capabilities typically require additional development.TheHeimdall Proxycoupled withAmazon Route 53allows edge-based applications to access the Aurora Global Database seamlessly, without  application changes. Features include automatedRead/Write split with ACID complianceandedge results caching.Figure 1. Heimdall Proxy architectureThe architecture in Figure 1 shows Aurora Global Databases primary Region in AP-SOUTHEAST-2, and secondary Regions in AP-SOUTH-1 and US-WEST-2. The Heimdall Proxy uses latency-based routing to determine the closest Reader Instance for read traffic, and redirects all write traffic to the Writer Instance. The Heimdall Configuration stores the Amazon Resource Name (ARN) of the global cluster. It automatically detects failover and cross-Region on the cluster, and directs traffic accordingly.With an Aurora Global Database, there are two approaches to failover:Managed planned failover.To relocate your primary database cluster to one of the secondary Regions in your Aurora global database, seeManaged planned failovers with Amazon Aurora Global Database. With this feature, RPO is 0 (no data loss) and it synchronizes secondary DB clusters with the primary before making any other changes. RTO for this automated process is typically less than that of the manual failover.Manual unplanned failover.To recover from an unplanned outage, you can manually perform a cross-Region failover to one of the secondaries in your Aurora Global Database. The RTO for this manual process depends on how quickly you canmanually recover an Aurora global database from an unplanned outage. The RPO is typically measured in seconds, but this is dependent on the Aurora storage replication lag across the network at the time of the failure.The Heimdall Proxy automatically detectsAmazon Relational Database Service (RDS)/Amazon Auroraconfiguration changes based on the ARN of the Aurora Global cluster. Therefore, both managed planned and manual unplanned failovers are supported.Solution benefits for global applicationsImplementing the Heimdall Proxy has many benefits for global applications:It allows for a larger number of endpoints to be globally deployed. Combined with Amazon Route 53 latency-based routing, new connections have a shorter establishment time. They can use connection pooling to connect to the database, which reduces overall connection latency.SQL results are cached to the application for faster response times.The proxy intelligently routes non-cached queries. When safe to do so, the closest (lowest latency) reader will be used. When not safe to access the reader, the query will be routed to the global writer. Proxy nodes globally synchronize their state to ensure that volatile tables are locked to provide ACID compliance.For more information on configuring the Heimdall Proxy and Amazon Route 53 for a global database, read theHeimdall Proxy for Aurora Global Database Solution Guide.Download a free trial from theAWS Marketplace.Resources:AWS Blog:How to Split Reads and Writes for Amazon RDSAWS Blog:Automated Query CachingAWS Blog:Advanced Connection PoolingContact:info@heimdalldata.comHeimdall Data, based in the San Francisco Bay Area, is an AWS Advanced ISV partner. They have AWS Service Ready designations for Amazon RDS andAmazon Redshift. Heimdall Data offers a database proxy that offloads SQL improving database scale. Deployment does not require code changes.TAGS:caching,PgBouncer,ProxyRoneel KumarRoneel Kumar is a Sr. Database Specialist Solutions Architect at AWS who specializes in Relational Database Engines. He provides technical assistance, operational, and database best practices to customers in the Asia Pacific region.Antony Prasad ThevarajAntony Prasad Thevaraj is a Sr. Partner Solutions Architect in Data and Analytics at AWS. He has over 10 years of experience as a Big Data Engineer, and has worked on building complex ETL and ELT pipelines for various business units. He helps partners build joint solutions using AWS services.
Deploying global applications has many challenges, especially when accessing a database to build custom pages for end users. One example is an application using AWS Lambda@Edge. Two main challenges include performance and availability. This blog explains how you can optimally deploy a global application with fast response times and without application changes. The Amazon Aurora […]
Roneel Kumar
Amazon Aurora Amazon CloudWatch Amazon EC2 Amazon ElastiCache Amazon RDS Analytics Architecture Containers Developer Tools DevOps Serverless