AWS Multi-Region Resiliency Aurora MySQL Global DB With Headless Clusters

A headless cluster in Amazon Aurora global database refers to a cluster that has no database instance attached to it. In other words, the cluster only includes the database storage and is used as a backup in case of a failure of the primary cluster. The primary cluster is the one that has a database instance attached to it and is serving the application's read and write requests. The headless secondary cluster is used for disaster recovery and to provide high availability for the database. The data in the primary cluster is automatically replicated to the headless secondary cluster, so in case of a failure, the secondary cluster can take over as the primary cluster and provide a seamless transition with minimal disruption.  

In this article, we will see how to perform a failover with a headless Aurora Global Database and its outcomes. 

Prometheus AWS Exporter and Grafana

The main purpose of this article and use case is to scrape AWS CloudWatch metrics into the Prometheus time series and to visualize the metrics data in Grafana. Prometheus and Grafana are the most powerful, robust open-source tools for monitoring, collecting, visualizing, and performance metrics of the deployed applications in production. These tools give greater visibility other than collecting the metrics also, where we can set up critical alerts, live views, and custom dashboards. CloudWatch Exporter is an open-source tool to capture metrics as defined in yml configuration file. 

Architecture

AWS architectureThe CloudWatch Exporter will collect the metrics from AWS Cloud watch every 15 seconds (default), and it will expose them as key/value pairs in /the metrics API response. Using that configuration, the exporter will collect those metrics from CloudWatch every 15 seconds (default) and expose them as key-value pairs in the '/metrics' API response. The CloudWatchExporter's /metrics endpoint should then be added to the Prometheus configuration as a scrape job. Prometheus allows us to define the scraping frequency, so we can adjust the frequency of calls to CloudWatch to eventually tune the cost.