<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged high-availability</title>
<link>https://coderlegion.com/tag/high-availability</link>
<description>Powered by Question2Answer</description>
<item>
<title>Building database synchronization the boring way</title>
<link>https://coderlegion.com/26522/building-database-synchronization-the-boring-way</link>
<description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;https://iamroot.tech/&quot;&gt;iamroot.tech&lt;/a&gt; uses a custom-built, asynchronous MySQL database synchronization system handling ~10 million daily changes across several distributed nodes without consensus algorithms or distributed coordinators.&lt;br&gt;
Key Architecture &amp;amp; Trade-offs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Primary Keys: UUIDs to allow conflict-free row generation on any node. &lt;/li&gt;
&lt;li&gt;Change Tracking: Database triggers log INSERT, UPDATE, and DELETE operations into a simplified change log. &lt;/li&gt;
&lt;li&gt;Replication Mechanism: Asynchronous background workers process log entries.&lt;/li&gt;
&lt;li&gt;Conflict Avoidance: Application-level single-writer authority per dataset &lt;/li&gt;
&lt;li&gt;Fault Tolerance: Nodes catch up automatically after offline periods by replaying the simple change log backlog.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-setup---servers-will-disappear&quot;&gt;The setup - servers will disappear&lt;/h3&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://iamroot.tech/&quot;&gt;iamroot.tech&lt;/a&gt; runs across numerous servers in different geographical locations. They are deliberately inexpensive machines, and an important assumption behind the entire architecture is that individual servers will - at some point in time - disappear, underperform or otherwise misbehave.&lt;/p&gt;
&lt;p&gt;The goal has never been to make every server perfectly reliable. The goal is to make each server failure completely uninteresting.&lt;/p&gt;
&lt;p&gt;That creates an interesting problem for the databases. A server needs access to shared data, but I don't want a write on server A to depend on server B being available. In fact, I don't really want server A to care about server B at all while serving a request.&lt;/p&gt;
&lt;p&gt;So I ended up building my own synchronization system. It currently keeps roughly 50–60 tables synchronized across numerous servers and handles around 10 million changes on a normal day.&lt;/p&gt;
&lt;p&gt;It isn't particularly clever. In fact, it's about as simple as it gets.&lt;/p&gt;
&lt;p&gt;And that is rather the point.&lt;/p&gt;
&lt;h3 id=&quot;a-failing-server-should-create-a-backlog-not-an-outage&quot;&gt;A failing server should create a backlog, not an outage&lt;/h3&gt;
&lt;p&gt;The most important principle is that database writes are local operations. If the application running on server A needs to update something, it writes to the local MySQL database and continues.&lt;/p&gt;
&lt;p&gt;Synchronization happens afterwards.&lt;/p&gt;
&lt;p&gt;If server B happens to be slow, offline or has been gone for three days, that doesn't change what happens on A. It simply means B has more catching up to do when it eventually returns.&lt;/p&gt;
&lt;p&gt;In practice, this gives iamroot.tech a distributed data architecture without trying to turn MySQL itself into a distributed database. Each server owns its local database and can operate independently, while relevant data is eventually synchronized between them.&lt;/p&gt;
&lt;p&gt;Temporary differences between nodes are therefore expected. Eventual consistency isn't something the architecture reluctantly tolerates; it is part of the design.&lt;/p&gt;
&lt;p&gt;That trade-off works because the application itself understands how the data is used.&lt;/p&gt;
&lt;h3 id=&quot;the-implementation-is-almost-embarrassingly-simple&quot;&gt;The implementation is almost embarrassingly simple&lt;/h3&gt;
&lt;p&gt;Tables that need to be shared use UUIDs as their primary keys. That allows records to be created independently on different servers without coordinating ID ranges or worrying about primary key collisions later.&lt;/p&gt;
&lt;p&gt;Each server then maintains its own local change log. Synchronized tables have triggers for INSERT, UPDATE and DELETE, and whenever something changes, a small entry containing the table, record ID, operation and timestamp is written to the log.&lt;/p&gt;
&lt;p&gt;A background service processes those entries and sends the changes to whichever nodes should receive them. There is no central replication queue and no synchronization master.&lt;/p&gt;
&lt;p&gt; For inserts and updates, I use MySQL's INSERT ... ON DUPLICATE KEY UPDATE. If a server somehow missed the original INSERT but later receives an UPDATE, the record simply gets created anyway.&lt;/p&gt;
&lt;p&gt;Replicated writes bypass the change-log triggers for that database connection, while normal application writes still trigger them. Otherwise A would update B, B would send the same change back to A, and my wonderfully simple synchronization system would become a wonderfully effective infinite loop.&lt;/p&gt;
&lt;p&gt;DELETEs work through the same mechanism. The DELETE entry stays in the change log until the relevant nodes have processed it, effectively making it a temporary replication tombstone. A server can therefore disappear for days and still learn which records were deleted while it was gone.&lt;/p&gt;
&lt;p&gt;That's basically it.&lt;/p&gt;
&lt;h3 id=&quot;avoiding-problems-instead-of-solving-them&quot;&gt;Avoiding problems instead of solving them&lt;/h3&gt;
&lt;p&gt;This is not conflict-safe multi-master replication.&lt;/p&gt;
&lt;p&gt;If two servers independently modify the same record at exactly the wrong moment, there is no clever distributed algorithm deciding which version represents universal truth.&lt;/p&gt;
&lt;p&gt;Instead, I largely avoid the problem at the application level.&lt;/p&gt;
&lt;p&gt;Individual records normally have one logical writer - one server or subsystem that is effectively king for that data. The code working with those records knows about that architecture.&lt;/p&gt;
&lt;p&gt;That is an important distinction. I could add version vectors, distributed locking, automatic conflict resolution and considerably more machinery. Those are perfectly valid solutions to problems other systems have.&lt;/p&gt;
&lt;p&gt;But if I can structure the application so the problem doesn't normally exist, I would rather do that.&lt;/p&gt;
&lt;p&gt;The same philosophy applies elsewhere. Synchronization is at-least-once rather than exactly-once. Duplicate work happens, but the operations are idempotent, so that is mostly harmless. The change log isn't an event store either. If a record changes ten times, I don't need to reconstruct all ten historical versions. I care about getting the current state where it needs to go.&lt;/p&gt;
&lt;h3 id=&quot;recovery-is-deliberately-boring&quot;&gt;Recovery is deliberately boring&lt;/h3&gt;
&lt;p&gt;For every table and destination node, the synchronizer remembers how far through the local change log that node has progressed.&lt;/p&gt;
&lt;p&gt;Important data is typically synchronized every 10 – 20 seconds, while less important tables may only be processed every ten minutes. If a destination disappears, its position simply stops advancing while everybody else continues.&lt;/p&gt;
&lt;p&gt;When it returns, there is normally nothing for me to do. The synchronizer knows where it stopped and continues from there. Once all relevant nodes have moved beyond old change-log entries, those entries can be removed.&lt;/p&gt;
&lt;p&gt;This isn't just how I hope it works. Servers have disappeared and returned plenty of times in production.&lt;/p&gt;
&lt;p&gt;The recovery procedure is dead simple: sit back and wait.&lt;/p&gt;
&lt;p&gt;I like recovery procedures like that.&lt;/p&gt;
&lt;h3 id=&quot;why-not-just-use-mysql-replication-&quot;&gt;Why not just use MySQL replication?&lt;/h3&gt;
&lt;p&gt;MySQL already provides very capable replication, and this isn't an attempt to build a better replacement.&lt;/p&gt;
&lt;p&gt;I wanted slightly different properties.&lt;/p&gt;
&lt;p&gt;Not every table needs to exist everywhere. Different data can have different synchronization intervals and destinations. More importantly, replication isn't part of the availability model for an individual application server. A slow destination creates work for the synchronizer, not latency for the application serving a user.&lt;/p&gt;
&lt;p&gt;There are obvious trade-offs. The synchronizer doesn't automatically understand referential integrity between tables, although I can control their processing order. It doesn't negotiate schemas either; keeping compatible schemas across the relevant servers is my responsibility.&lt;/p&gt;
&lt;p&gt;Those are not necessarily features waiting to be implemented. They are boundaries I know about and can design around.&lt;/p&gt;
&lt;h3 id=&quot;boring-as-a-feature&quot;&gt;Boring as a feature&lt;/h3&gt;
&lt;p&gt;Around 10 million changes pass through this setup every day, with the ASN database alone sometimes generating several million updates during a processing run.&lt;/p&gt;
&lt;p&gt;Could I make the synchronization system considerably smarter? Absolutely.&lt;/p&gt;
&lt;p&gt;But I didn't set out to build a distributed database. I wanted a multitude of servers that could operate independently, share the data they needed, tolerate each other disappearing, and recover without me getting involved.&lt;/p&gt;
&lt;p&gt;The synchronization system is simply what fell out of those requirements.&lt;/p&gt;
&lt;p&gt;There are plenty of situations where this design would be completely inappropriate. There are also plenty where sophisticated distributed database technology solves very real problems.&lt;/p&gt;
&lt;p&gt;But complexity has a real cost.&lt;/p&gt;
&lt;p&gt;For iamroot.tech, I'd rather have infrastructure I can explain on a single piece of paper, predict when something breaks, and largely leave alone when a server disappears.&lt;/p&gt;
&lt;p&gt;Extremely simple, asynchronous and a tad inefficient in the actual operations, yes - but very efficient at solving the problem, very predictable in the way it works, and - most importantly - it does not require any human intervention at any point.&lt;/p&gt;
&lt;p&gt;That is all I need.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/26522/building-database-synchronization-the-boring-way</guid>
<pubDate>Tue, 08 Sep 2026 21:13:56 +0000</pubDate>
</item>
<item>
<title>Zero Downtime: Designing an Azure Multi-Region Architecture</title>
<link>https://coderlegion.com/8008/zero-downtime-designing-an-azure-multi-region-architecture</link>
<description>&lt;h2 id=&quot;zero-downtime-designing-an-azure-multi-region-architecture&quot;&gt;Zero Downtime: Designing an Azure Multi-Region Architecture&lt;/h2&gt;
&lt;hr&gt;
&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;High availability isn’t just a buzzword to throw into a system design interview; it’s the difference between a minor hiccup and a career-defining disaster. We often build for the &quot;happy path,&quot; assuming Azure regions are invincible fortresses. But cables get cut, weather happens, and yes, sometimes entire regions go dark.&lt;/p&gt;
&lt;p&gt;If your application lives in a single region, your uptime is at the mercy of that specific geography. Today, we’re going to walk through moving from a fragile, single-region setup to a robust Active-Active Multi-Region Architecture that can survive a total regional outage without your users ever noticing.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-story-the-3-am-wake-up-call&quot;&gt;The Story: The 3 AM Wake-Up Call&lt;/h3&gt;
&lt;p&gt;It was 3:14 AM on a Tuesday—it’s always a Tuesday. My phone buzzed off the nightstand, vibrating with the distinctive, heart-stopping pattern of PagerDuty.&lt;/p&gt;
&lt;p&gt;&quot;East US is down,&quot; the message read.&lt;/p&gt;
&lt;p&gt;I groggily opened my laptop, hoping it was just a blip. It wasn't. An underlying storage outage in the primary region had cascaded, taking our entire e-commerce platform offline. We had a &quot;Disaster Recovery&quot; plan, but it was a cold backup in West Europe. Restoring it meant updating DNS records manually, warming up cold caches, and praying the database backups were consistent.&lt;/p&gt;
&lt;p&gt;It took us four hours to get back online. In internet time, that’s an eternity. We lost revenue, but worse, we lost trust.&lt;/p&gt;
&lt;p&gt;That morning, fueled by too much coffee and regret, we made a pact: &lt;strong&gt;Never again.&lt;/strong&gt; We were going to build a system that could lose an entire region and keep humming along. Here is exactly how we did it.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;core-concepts-active-passive-vs-active-active&quot;&gt;Core Concepts: Active-Passive vs. Active-Active&lt;/h3&gt;
&lt;p&gt;Before we write a single line of code, we need to agree on the strategy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Active-Passive:&lt;/strong&gt; You have a primary region handling traffic and a secondary region sitting idle (or receiving replication data). Failover usually requires manual intervention or a delay.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Active-Active:&lt;/strong&gt; Both regions are live. They both handle traffic simultaneously. If one dies, the global load balancer simply stops sending users there. This is the holy grail for zero downtime.&lt;/p&gt;
&lt;p&gt;To achieve this, we need three layers of abstraction:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Brain&lt;/strong&gt; (Traffic Routing): Something global to direct users.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Muscle&lt;/strong&gt; (Compute): Stateless application servers.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Heart&lt;/strong&gt; (Data): A database that accepts writes in multiple places.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-by-step-guide&quot;&gt;Step-by-Step Guide&lt;/h3&gt;
&lt;p&gt;We are going to build this using Azure Front Door, Azure App Service, and Cosmos DB.&lt;/p&gt;
&lt;h4 id=&quot;1-the-entry-point-azure-front-door&quot;&gt;1. The Entry Point: Azure Front Door&lt;/h4&gt;
&lt;p&gt;Old school setups used Azure Traffic Manager (DNS-based). Modern web apps should use Azure Front Door. It operates at Layer 7 (HTTP/S), uses the Microsoft global edge network to speed up content, and fails over almost instantly because it uses active health probes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why Front Door?&lt;/strong&gt; It terminates SSL at the edge and routes traffic to the closest available backend.&lt;br&gt;
&lt;strong&gt;The trick:&lt;/strong&gt; We set up an &quot;Origin Group&quot; containing our East US and West Europe endpoints.&lt;/p&gt;
&lt;h4 id=&quot;2-the-compute-layer-go-stateless&quot;&gt;2. The Compute Layer: Go Stateless&lt;/h4&gt;
&lt;p&gt;This is where most developers get stuck. You cannot store session state (like a shopping cart or user login) in the memory of your web server. If a user hits East US for Request A and West Europe for Request B, the session will be lost.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Externalize state. Use Azure Redis Cache (Enterprise tier allows active-geo replication) or just keep state in the database.&lt;br&gt;
&lt;strong&gt;The Code:&lt;/strong&gt; Ensure your application connects to the &lt;em&gt;local&lt;/em&gt; region's database endpoint to minimize latency.&lt;/p&gt;
&lt;h4 id=&quot;3-the-data-layer-multi-region-writes&quot;&gt;3. The Data Layer: Multi-Region Writes&lt;/h4&gt;
&lt;p&gt;This is the hardest part. In a traditional SQL setup, you usually have one Writer and multiple Readers. If the Writer region goes down, you have to promote a Reader, which takes time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter Azure Cosmos DB.&lt;/strong&gt; It supports Multi-Region Writes. You can write to East US and West Europe simultaneously, and Cosmos DB handles the replication magic in the background.&lt;br&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; For zero downtime, we usually accept &quot;Session&quot; consistency. It guarantees that a user sees their own writes immediately, which is enough for 99% of apps.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;infrastructure-as-code-terraform-&quot;&gt;Infrastructure as Code (Terraform)&lt;/h3&gt;
&lt;p&gt;Let's look at how to define the critical Front Door configuration in Terraform. This snippet creates a backend pool that checks both regions.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```terraform
resource &quot;azurerm_cdn_frontdoor_profile&quot; &quot;main&quot; {
  name                = &quot;example-frontdoor&quot;
  resource_group_name = azurerm_resource_group.main.name
  sku_name            = &quot;Premium_AzureFrontDoor&quot; # Required for some advanced features
}

resource &quot;azurerm_cdn_frontdoor_origin_group&quot; &quot;main&quot; {
  name                       = &quot;example-origin-group&quot;
  cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile.main.id

  load_balancing {
    sample_size                     = 4
    successful_samples_required     = 3
    additional_latency_in_milliseconds = 50
  }

  health_probe {
    path                = &quot;/health&quot;
    protocol            = &quot;Https&quot;
    interval_in_seconds = 100 # Aggressive probing for faster failover
    request_type        = &quot;HEAD&quot;
  }
}

# Add East US Origin
resource &quot;azurerm_cdn_frontdoor_origin&quot; &quot;east_us&quot; {
  name                          = &quot;app-eastus&quot;
  cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group.main.id
  enabled                       = true
  host_name                     = azurerm_linux_web_app.east_app.default_hostname
  http_port                     = 80
  https_port                    = 443
  priority                      = 1
  weight                        = 1000
}

# Add West Europe Origin
resource &quot;azurerm_cdn_frontdoor_origin&quot; &quot;west_eu&quot; {
  name                          = &quot;app-westeu&quot;
  cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group.main.id
  enabled                       = true
  host_name                     = azurerm_linux_web_app.west_app.default_hostname
  http_port                     = 80
  https_port                    = 443
  priority                      = 1
  weight                        = 1000
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;best-practices-amp-gotchas-&quot;&gt;Best Practices &amp;amp; &quot;Gotchas&quot;&lt;/h3&gt;
&lt;h4 id=&quot;1-the-cost-factor&quot;&gt;1. The Cost Factor&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Multi-region is expensive. You are effectively doubling your compute and paying for cross-region data transfer.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Use auto-scaling rules. In &quot;peace time,&quot; run your secondary region with minimal instances (maybe 2). Configure scale-out rules to handle the load only if the primary region fails or traffic spikes.&lt;/p&gt;
&lt;h4 id=&quot;2-conflict-resolution&quot;&gt;2. Conflict Resolution&lt;/h4&gt;
&lt;p&gt;If User A updates a record in the US, and User B updates the same record in Europe at the exact same millisecond, who wins?&lt;br&gt;
&lt;strong&gt;Last Write Wins (LWW):&lt;/strong&gt; The default in Cosmos DB. It uses the system clock. For most apps, this is fine.&lt;br&gt;
&lt;strong&gt;Custom Merge:&lt;/strong&gt; If you need complex logic, you'll need to write a stored procedure to merge the data.&lt;/p&gt;
&lt;h4 id=&quot;3-chaos-engineering&quot;&gt;3. Chaos Engineering&lt;/h4&gt;
&lt;p&gt;You cannot trust this architecture until you break it.&lt;br&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Schedule a &quot;Game Day.&quot; Manually turn off the Web App in the primary region during a low-traffic window. Watch your Front Door metrics. Does traffic shift automatically? Did anyone notice?&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;community-corner&quot;&gt;Community Corner&lt;/h3&gt;
&lt;p&gt;I’d love to hear how you handle data consistency in distributed systems!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Do you use SQL Failover Groups instead of Cosmos?&lt;/li&gt;
&lt;li&gt;Have you ever had a failover that didn't work? What happened?&lt;/li&gt;
&lt;li&gt;Drop a comment below. The best war story gets a shoutout in next week's newsletter!&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;faq&quot;&gt;FAQ&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Q: Can I use Azure SQL Database for active-active?&lt;/strong&gt;&lt;br&gt;
A: Generally, no. Azure SQL is typically Active-Passive (one writer). You can use &quot;Failover Groups&quot; to automate the failover, but there is usually a short period (seconds to minutes) of write unavailability.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: What is the difference between Availability Zones and Regions?&lt;/strong&gt;&lt;br&gt;
A: Zones are separate datacenters within the &lt;em&gt;same&lt;/em&gt; region (e.g., separate buildings in East US). They protect against fire/power failure in one building. Regions are hundreds of miles apart. They protect against natural disasters affecting a whole city.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: How do I handle scheduled deployments?&lt;/strong&gt;&lt;br&gt;
A: Deploy to one region at a time. Deploy to the &quot;passive&quot; or secondary region first, run smoke tests, and then deploy to the primary. This ensures you don't break the whole world simultaneously.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: Does Front Door add latency?&lt;/strong&gt;&lt;br&gt;
A: Actually, it often &lt;em&gt;reduces&lt;/em&gt; it. Front Door uses &quot;Anycast&quot; to onboard user traffic at the nearest Microsoft Edge node (PoP) and rides the dedicated Microsoft backbone network to your app, avoiding the slower public internet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: What is RTO and RPO?&lt;/strong&gt;&lt;br&gt;
A: &lt;strong&gt;RTO (Recovery Time Objective):&lt;/strong&gt; How long you are down (Goal: Near zero). &lt;strong&gt;RPO (Recovery Point Objective):&lt;/strong&gt; How much data you lose (Goal: Zero).&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Building a Zero-Downtime Multi-Region architecture is an investment. It requires more complexity in your deployment pipelines and data handling. But the first time you sleep through a major regional outage because Front Door quietly shifted traffic to Europe, you’ll know it was worth every penny.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next Step:&lt;/strong&gt; Go to your Azure Portal right now and check your current application. Is it in a single region? If yes, map out what components (SQL, Storage, Compute) would need to change to support a second region. Start small—maybe just replicate your storage first!&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/8008/zero-downtime-designing-an-azure-multi-region-architecture</guid>
<pubDate>Mon, 01 Dec 2025 05:00:00 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave: Read Replicas for Scaling Read-Heavy Workloads</title>
<link>https://coderlegion.com/7889/mysql-heatwave-read-replicas-for-scaling-read-heavy-workloads</link>
<description>&lt;p&gt;Read replicas are a powerful feature of MySQL HeatWave that enable you to scale read-heavy workloads by distributing queries across multiple database instances. As read-only copies of your source DB system, read replicas handle SELECT queries, analytics, and reporting workloads while the primary instance handles write operations. This architecture improves application performance, enhances availability, and supports disaster recovery strategies.&lt;/p&gt;
&lt;p&gt;This guide covers read replica concepts, creation, connectivity, use cases, maintenance, and limitations.&lt;/p&gt;
&lt;h3 id=&quot;what-are-read-replicas-&quot;&gt;What Are Read Replicas?&lt;/h3&gt;
&lt;p&gt;Read replicas are read-only copies of a MySQL HeatWave DB system that are automatically updated using asynchronous replication from the source DB system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key Characteristics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Read-only&lt;/strong&gt;: Cannot execute write operations (INSERT, UPDATE, DELETE)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous replication&lt;/strong&gt;: Data replicated from source with minimal lag&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Full data copy&lt;/strong&gt;: Contains complete copy of source DB system data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Independent endpoints&lt;/strong&gt;: Each read replica has its own connection endpoint&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic lifecycle&lt;/strong&gt;: Started, stopped, and deleted with source DB system&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;benefits-of-read-replicas&quot;&gt;Benefits of Read Replicas&lt;/h3&gt;
&lt;h4 id=&quot;1-redirecting-excess-traffic&quot;&gt;1. Redirecting Excess Traffic&lt;/h4&gt;
&lt;p&gt;Distribute read traffic across multiple instances to prevent primary instance overload.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: E-commerce application during peak shopping season&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Primary handles transactions (orders, payments)&lt;/li&gt;
&lt;li&gt;Read replicas serve product catalogs, inventory checks, search queries&lt;/li&gt;
&lt;li&gt;Reduces primary instance load by 60-80%&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-business-reporting-and-analytics&quot;&gt;2. Business Reporting and Analytics&lt;/h4&gt;
&lt;p&gt;Offload resource-intensive reporting queries to read replicas.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: Daily business intelligence reports&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Complex JOIN queries with aggregations&lt;/li&gt;
&lt;li&gt;Historical data analysis&lt;/li&gt;
&lt;li&gt;Real-time dashboards&lt;/li&gt;
&lt;li&gt;No impact on transactional performance&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-geographic-distribution&quot;&gt;3. Geographic Distribution&lt;/h4&gt;
&lt;p&gt;Place read replicas closer to users in different regions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: Global application&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Primary in US-East&lt;/li&gt;
&lt;li&gt;Read replica in EU-West for European users&lt;/li&gt;
&lt;li&gt;Read replica in AP-South for Asian users&lt;/li&gt;
&lt;li&gt;Reduced latency for read operations&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-disaster-recovery&quot;&gt;4. Disaster Recovery&lt;/h4&gt;
&lt;p&gt;Read replicas serve as standby databases for failover scenarios.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: Primary DB system failure&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Promote read replica to standalone DB system&lt;/li&gt;
&lt;li&gt;Minimal data loss (replication lag only)&lt;/li&gt;
&lt;li&gt;Faster recovery than backup restoration&lt;/li&gt;
&lt;li&gt;Business continuity maintained&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-development-and-testing&quot;&gt;5. Development and Testing&lt;/h4&gt;
&lt;p&gt;Create isolated environments without impacting production.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: Testing new features&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read replica mirrors production data&lt;/li&gt;
&lt;li&gt;Safe environment for experiments&lt;/li&gt;
&lt;li&gt;No risk to production workload&lt;/li&gt;
&lt;li&gt;Fresh data for realistic testing&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;creating-read-replicas&quot;&gt;Creating Read Replicas&lt;/h3&gt;
&lt;h4 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h4&gt;
&lt;p&gt;Before creating read replicas, ensure the following requirements are met:&lt;/p&gt;
&lt;h5 id=&quot;1-oci-user-accounts-with-required-privileges&quot;&gt;1. OCI User Accounts with Required Privileges&lt;/h5&gt;
&lt;p&gt;Your OCI user must have permissions to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create and manage read replicas&lt;/li&gt;
&lt;li&gt;Access the source DB system&lt;/li&gt;
&lt;li&gt;Manage network resources&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Required IAM Policy&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Allow group DatabaseAdmins to manage mysql-family in compartment ProductionDatabases
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;2-operational-db-system&quot;&gt;2. Operational DB System&lt;/h5&gt;
&lt;p&gt;An active MySQL HeatWave DB system must exist and be in ACTIVE state. You can create read replicas on standalone or high availability DB systems.&lt;/p&gt;
&lt;h5 id=&quot;3-compatible-shape&quot;&gt;3. Compatible Shape&lt;/h5&gt;
&lt;p&gt;Read replicas are not supported on shapes that have less than 8 ECPUs or less than 4 OCPUs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Supported Shapes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ECPU&lt;/strong&gt;: MySQL.8 (8 ECPUs), MySQL.16, MySQL.32, MySQL.64, MySQL.128, MySQL.256&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OCPU&lt;/strong&gt; (deprecated): MySQL.VM.Standard.E3.1.8GB (4 OCPUs) and higher&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: OCPU shapes are deprecated for new users after September 5, 2024, and will be unavailable after March 13, 2026.&lt;/p&gt;
&lt;h5 id=&quot;4-network-configuration&quot;&gt;4. Network Configuration&lt;/h5&gt;
&lt;p&gt;Read replicas inherit the VCN and subnet from the source DB system by default, but you can specify a different subnet in the same VCN or different VCN.&lt;/p&gt;
&lt;h4 id=&quot;maximum-read-replicas&quot;&gt;Maximum Read Replicas&lt;/h4&gt;
&lt;p&gt;You can create a maximum of 18 read replicas per DB system. Each read replica has its own endpoint for connections.&lt;/p&gt;
&lt;h4 id=&quot;creating-read-replicas-via-oci-console&quot;&gt;Creating Read Replicas via OCI Console&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Navigate to DB System&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open OCI Console&lt;/li&gt;
&lt;li&gt;Go to Databases → HeatWave MySQL → DB Systems&lt;/li&gt;
&lt;li&gt;Select your source DB system&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Access Read Replicas Section&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Under Resources, click &lt;strong&gt;Read replicas&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create read replica&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configure Read Replica&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Display name&lt;/strong&gt;: Descriptive name (e.g., &quot;prod-analytics-replica&quot;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Description&lt;/strong&gt;: Purpose description&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shape&lt;/strong&gt;: Inherit from source or override with different shape&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration&lt;/strong&gt;: Inherit from source or select custom configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL version&lt;/strong&gt;: Inherit or override (must be same or higher)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Networking&lt;/strong&gt;: Select VCN and subnet (can differ from source)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Delete protection&lt;/strong&gt;: Enable to prevent accidental deletion&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Review and Create&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Create read replica&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Read replica enters CREATING state&lt;/li&gt;
&lt;li&gt;Typically available in 15-30 minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;creating-read-replicas-via-oci-cli&quot;&gt;Creating Read Replicas via OCI CLI&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Generate configuration template&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql replica create --generate-full-command-json-input &amp;gt; replica-config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Edit configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;dbSystemId&quot;: &quot;ocid1.mysqldbsystem.oc1...&quot;,
  &quot;displayName&quot;: &quot;analytics-read-replica&quot;,
  &quot;description&quot;: &quot;Read replica for BI workloads&quot;,
  &quot;shapeName&quot;: &quot;MySQL.16&quot;,
  &quot;isDeleteProtected&quot;: true,
  &quot;waitForState&quot;: [&quot;SUCCEEDED&quot;]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Create replica&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql replica create --from-json file://replica-config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;read-replica-properties&quot;&gt;Read Replica Properties&lt;/h3&gt;
&lt;h4 id=&quot;inherited-vs-overridden-properties&quot;&gt;Inherited vs. Overridden Properties&lt;/h4&gt;
&lt;p&gt;By default, a read replica inherits shape, configuration, and version from the DB system. You can override these properties.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When Inherited&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Changing property on DB system also changes it on read replica&lt;/li&gt;
&lt;li&gt;Replica follows source configuration automatically&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;When Overridden&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Changing property on DB system does NOT affect read replica&lt;/li&gt;
&lt;li&gt;Replica maintains independent configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Overridable Properties&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shape (e.g., use larger shape for heavy analytics)&lt;/li&gt;
&lt;li&gt;Configuration (e.g., tune for read-heavy workload)&lt;/li&gt;
&lt;li&gt;MySQL version (must be same or higher than source)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;automatic-read-replica-load-balancer&quot;&gt;Automatic Read Replica Load Balancer&lt;/h4&gt;
&lt;p&gt;When you create the first read replica of a DB system, a read replica load balancer is created automatically, which distributes read traffic among the read replicas.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Load Balancer Features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Distributes queries across all read replicas&lt;/li&gt;
&lt;li&gt;Health checks ensure traffic goes to ACTIVE replicas&lt;/li&gt;
&lt;li&gt;Automatic failover if replica becomes unavailable&lt;/li&gt;
&lt;li&gt;No manual configuration required&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;connecting-to-read-replicas&quot;&gt;Connecting to Read Replicas&lt;/h3&gt;
&lt;p&gt;Client applications cannot directly access read replicas from the internet. Connection methods mirror those for DB systems.&lt;/p&gt;
&lt;h4 id=&quot;connection-methods&quot;&gt;Connection Methods&lt;/h4&gt;
&lt;h5 id=&quot;1-load-balancer-recommended-&quot;&gt;1. Load Balancer (Recommended)&lt;/h5&gt;
&lt;p&gt;Use the automatically created read replica load balancer for balanced traffic distribution.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Load Balancer Endpoint&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;replica-load-balancer-ip&amp;gt;:3306
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automatic distribution across replicas&lt;/li&gt;
&lt;li&gt;Health checks&lt;/li&gt;
&lt;li&gt;Simplified application configuration&lt;/li&gt;
&lt;li&gt;High availability&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: When connecting via load balancer, user accounts require username only (no hostname restriction like 'user'@'%').&lt;/p&gt;
&lt;h5 id=&quot;2-bastion-session&quot;&gt;2. Bastion Session&lt;/h5&gt;
&lt;p&gt;Provides restricted and time-limited secure access.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use Case&lt;/strong&gt;: Temporary administrative access, troubleshooting&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create bastion session in OCI Console&lt;/li&gt;
&lt;li&gt;Session provides temporary SSH access&lt;/li&gt;
&lt;li&gt;Connect to read replica from bastion&lt;/li&gt;
&lt;li&gt;Session expires after defined period (30 minutes to 3 hours)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create bastion session
oci bastion session create-managed-ssh ...

# Connect through bastion
ssh -i &amp;lt;private_key&amp;gt; -o ProxyCommand=&quot;ssh -W %h:%p ...&quot; replica_ip
mysql -h &amp;lt;REPLICA_IP&amp;gt; -u admin -p
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;3-compute-instance&quot;&gt;3. Compute Instance&lt;/h5&gt;
&lt;p&gt;For long-term, secure access.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create compute instance in same VCN&lt;/li&gt;
&lt;li&gt;Configure security lists to allow MySQL ports&lt;/li&gt;
&lt;li&gt;Install MySQL client on compute instance&lt;/li&gt;
&lt;li&gt;Connect to read replica endpoint&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysql -h &amp;lt;REPLICA_IP&amp;gt; -P 3306 -u admin -p
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;4-vpn-connection&quot;&gt;4. VPN Connection&lt;/h5&gt;
&lt;p&gt;For site-to-site connectivity from on-premises.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Options&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Site-to-Site VPN&lt;/strong&gt;: IPSec VPN over internet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FastConnect&lt;/strong&gt;: Dedicated private connection&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenVPN&lt;/strong&gt;: Client VPN access&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;5-direct-application-connection&quot;&gt;5. Direct Application Connection&lt;/h5&gt;
&lt;p&gt;Configure application to use read replica endpoints.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Application Configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;# Primary for writes
primary_connection = mysql.connector.connect(
    host='primary_db_ip',
    user='app_user',
    password='password',
    database='production'
)

# Read replica for reads
replica_connection = mysql.connector.connect(
    host='replica_ip',
    user='app_user',
    password='password',
    database='production'
)

# Write operation
primary_connection.cursor().execute(&quot;INSERT INTO orders ...&quot;)

# Read operation
replica_connection.cursor().execute(&quot;SELECT * FROM products&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;monitoring-read-replicas&quot;&gt;Monitoring Read Replicas&lt;/h3&gt;
&lt;h4 id=&quot;read-replica-lag&quot;&gt;Read Replica Lag&lt;/h4&gt;
&lt;p&gt;Read replica lag measures how far behind the replica is from the source, measured by the read replica lag metric.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Factors Affecting Lag&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Workload on each read replica&lt;/li&gt;
&lt;li&gt;CPU and memory resources&lt;/li&gt;
&lt;li&gt;Network latency&lt;/li&gt;
&lt;li&gt;Volume of writes on primary&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Monitoring Lag&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On read replica
SHOW REPLICA STATUS\G
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check &lt;code&gt;Seconds_Behind_Source&lt;/code&gt; value.&lt;/p&gt;
&lt;h4 id=&quot;creating-alarms&quot;&gt;Creating Alarms&lt;/h4&gt;
&lt;p&gt;Set up OCI alarms to monitor read replica health:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to Monitoring service&lt;/li&gt;
&lt;li&gt;Create alarm for &lt;code&gt;ReplicaLag&lt;/code&gt; metric&lt;/li&gt;
&lt;li&gt;Set threshold (e.g., &amp;gt; 60 seconds)&lt;/li&gt;
&lt;li&gt;Configure notification topic&lt;/li&gt;
&lt;li&gt;Add email or webhook destination&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Alarm Query&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ReplicaLag[1m]{resourceDisplayName = &quot;analytics-replica&quot;}.mean() &amp;gt; 60
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;automatic-recovery&quot;&gt;Automatic Recovery&lt;/h4&gt;
&lt;p&gt;MySQL HeatWave Service performs automatic recovery on any read replica that has failed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Recovery Process&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Failure detected&lt;/li&gt;
&lt;li&gt;Read replica set to UPDATING state&lt;/li&gt;
&lt;li&gt;Cannot accept client connections during recovery&lt;/li&gt;
&lt;li&gt;After success, set to ACTIVE state&lt;/li&gt;
&lt;li&gt;Becomes operational again&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Failed Beyond Recovery&lt;/strong&gt;:&lt;br&gt;
If replica cannot replicate from DB system anymore, it's set to NEEDS_ATTENTION state. Manual intervention required.&lt;/p&gt;
&lt;h3 id=&quot;read-replica-maintenance-and-upgrades&quot;&gt;Read Replica Maintenance and Upgrades&lt;/h3&gt;
&lt;h4 id=&quot;standalone-db-system-upgrades&quot;&gt;Standalone DB System Upgrades&lt;/h4&gt;
&lt;p&gt;Read replicas are upgraded in parallel with source DB system. Both the source and all read replicas go offline for an update and upgrade at the same time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Process&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Maintenance window starts&lt;/li&gt;
&lt;li&gt;Source and all replicas enter UPDATING state&lt;/li&gt;
&lt;li&gt;Upgrades applied simultaneously&lt;/li&gt;
&lt;li&gt;All return to ACTIVE state together&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Downtime&lt;/strong&gt;: Brief period (typically 5-15 minutes depending on upgrade type)&lt;/p&gt;
&lt;h4 id=&quot;high-availability-db-system-upgrades&quot;&gt;High Availability DB System Upgrades&lt;/h4&gt;
&lt;p&gt;For HA DB systems, read replicas are upgraded one by one using rolling maintenance process. Only one read replica goes offline at a time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rolling Upgrade Process&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Replica 1 enters UPDATING state&lt;/li&gt;
&lt;li&gt;Replica 1 upgraded, returns to ACTIVE&lt;/li&gt;
&lt;li&gt;Replica 2 enters UPDATING state&lt;/li&gt;
&lt;li&gt;Replica 2 upgraded, returns to ACTIVE&lt;/li&gt;
&lt;li&gt;Continue for all replicas&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimal impact on read capacity&lt;/li&gt;
&lt;li&gt;At least N-1 replicas always available&lt;/li&gt;
&lt;li&gt;Reduced performance impact&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: Longer total time but better availability&lt;/p&gt;
&lt;h3 id=&quot;read-replica-limitations&quot;&gt;Read Replica Limitations&lt;/h3&gt;
&lt;h4 id=&quot;1-shape-requirements&quot;&gt;1. Shape Requirements&lt;/h4&gt;
&lt;p&gt;Read replicas are not supported on shapes that have less than 8 ECPUs or less than 4 OCPUs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unsupported&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MySQL.2 (2 ECPUs)&lt;/li&gt;
&lt;li&gt;MySQL.4 (4 ECPUs)&lt;/li&gt;
&lt;li&gt;MySQL.VM.Standard.E3.1.8GB (1 OCPU)&lt;/li&gt;
&lt;li&gt;MySQL.VM.Standard.E3.1.16GB (2 OCPUs)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-load-balancer-account-name-restrictions&quot;&gt;2. Load Balancer Account Name Restrictions&lt;/h4&gt;
&lt;p&gt;When connecting via load balancer, user accounts require username only ('user'@'%'), not hostname-specific restrictions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Won't Work&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CREATE USER 'app_user'@'10.0.1.%' ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Must Use&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CREATE USER 'app_user'@'%' ...
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-outbound-replication-source&quot;&gt;3. Outbound Replication Source&lt;/h4&gt;
&lt;p&gt;Read replicas cannot be configured as a source for outbound replication. Only the primary DB system can be a replication source.&lt;/p&gt;
&lt;h4 id=&quot;4-ipv4-subnet-support-only&quot;&gt;4. IPv4 Subnet Support Only&lt;/h4&gt;
&lt;p&gt;Read replicas are only supported with IPv4 subnets. IPv6 subnets are not supported.&lt;/p&gt;
&lt;h4 id=&quot;5-bandwidth-limits&quot;&gt;5. Bandwidth Limits&lt;/h4&gt;
&lt;p&gt;Read replicas support up to 8 Gbps bandwidth for client connections.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implications&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;High-throughput workloads may hit bandwidth limits&lt;/li&gt;
&lt;li&gt;Monitor network metrics&lt;/li&gt;
&lt;li&gt;Consider multiple replicas for very high throughput needs&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;6-lifecycle-dependency&quot;&gt;6. Lifecycle Dependency&lt;/h4&gt;
&lt;p&gt;Read replicas are started when DB system is started, stopped when DB system is stopped, and deleted when DB system is deleted.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cannot&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start replica independently if source is stopped&lt;/li&gt;
&lt;li&gt;Keep replica running when source is stopped&lt;/li&gt;
&lt;li&gt;Preserve replica after deleting source&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;7-heatwave-cluster-not-supported&quot;&gt;7. HeatWave Cluster Not Supported&lt;/h4&gt;
&lt;p&gt;Read replicas cannot have HeatWave clusters attached. If the source DB system has a HeatWave cluster, read replicas will not replicate HeatWave-specific data.&lt;/p&gt;
&lt;h4 id=&quot;8-configuration-changes&quot;&gt;8. Configuration Changes&lt;/h4&gt;
&lt;p&gt;Prior to March 2024, configuration changes required deleting and recreating read replicas. As of March 26, 2024, you can now change shape and configuration of DB systems with read replicas without deleting replicas.&lt;/p&gt;
&lt;h3 id=&quot;best-practices&quot;&gt;Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;1-use-multiple-read-replicas&quot;&gt;1. Use Multiple Read Replicas&lt;/h4&gt;
&lt;p&gt;For high availability and load distribution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimum 2 replicas for redundancy&lt;/li&gt;
&lt;li&gt;More replicas for higher read throughput&lt;/li&gt;
&lt;li&gt;Maximum 18 replicas per DB system&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-monitor-replication-lag&quot;&gt;2. Monitor Replication Lag&lt;/h4&gt;
&lt;p&gt;Set up alerts and regularly check:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SHOW REPLICA STATUS\G
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If lag exceeds 60 seconds consistently:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increase replica shape&lt;/li&gt;
&lt;li&gt;Reduce read load&lt;/li&gt;
&lt;li&gt;Optimize slow queries&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-size-replicas-appropriately&quot;&gt;3. Size Replicas Appropriately&lt;/h4&gt;
&lt;p&gt;Match replica shape to workload:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Light analytics: Same shape as source&lt;/li&gt;
&lt;li&gt;Heavy reporting: Larger shape than source&lt;/li&gt;
&lt;li&gt;Mixed workload: Multiple replicas with different shapes&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-implement-read-write-splitting-in-applications&quot;&gt;4. Implement Read/Write Splitting in Applications&lt;/h4&gt;
&lt;p&gt;Direct writes to primary, reads to replicas:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def ex# Conclusionecute_query(query):
    if query.startswith('SELECT'):
        return replica_connection.execute(query)
    else:
        return primary_connection.execute(query)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;5-use-load-balancer-for-simplicity&quot;&gt;5. Use Load Balancer for Simplicity&lt;/h4&gt;
&lt;p&gt;Automatic distribution and failover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Configure application with load balancer endpoint only&lt;/li&gt;
&lt;li&gt;No application changes when adding/removing replicas&lt;/li&gt;
&lt;li&gt;Built-in health checks&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;6-plan-for-replication-lag&quot;&gt;6. Plan for Replication Lag&lt;/h4&gt;
&lt;p&gt;Design applications to tolerate eventual consistency:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don't read immediately after write from replica&lt;/li&gt;
&lt;li&gt;Use primary for read-after-write scenarios&lt;/li&gt;
&lt;li&gt;Communicate lag tolerance to users&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;7-test-failover-scenarios&quot;&gt;7. Test Failover Scenarios&lt;/h4&gt;
&lt;p&gt;Regularly test promoting replica to standalone:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify promotion procedure&lt;/li&gt;
&lt;li&gt;Measure recovery time&lt;/li&gt;
&lt;li&gt;Update application connection strings&lt;/li&gt;
&lt;li&gt;Practice makes perfect for real disasters&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;8-enable-delete-protection&quot;&gt;8. Enable Delete Protection&lt;/h4&gt;
&lt;p&gt;For production replicas:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;--is-delete-protected true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Prevents accidental deletion.&lt;/p&gt;
&lt;p&gt;Read replicas are essential for scaling MySQL HeatWave beyond single-instance limitations. By distributing read traffic across multiple instances, you improve application performance, support business analytics, enable geographic distribution, and enhance disaster recovery capabilities.&lt;/p&gt;
&lt;p&gt;Key takeaways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous replication&lt;/strong&gt;: Data replicated with minimal lag&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;18 replicas maximum&lt;/strong&gt;: Scale read capacity significantly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shape requirement&lt;/strong&gt;: Minimum 8 ECPUs or 4 OCPUs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic load balancer&lt;/strong&gt;: Simplifies traffic distribution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple connection methods&lt;/strong&gt;: Bastion, compute, VPN, load balancer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rolling upgrades for HA&lt;/strong&gt;: Minimal downtime during maintenance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor lag&lt;/strong&gt;: Critical for maintaining data freshness&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disaster recovery&lt;/strong&gt;: Promote replica to standalone if needed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether supporting global applications, offloading analytics, or implementing disaster recovery, MySQL HeatWave read replicas provide the scalability and flexibility needed for modern database architectures.&lt;/p&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/7889/mysql-heatwave-read-replicas-for-scaling-read-heavy-workloads</guid>
<pubDate>Fri, 28 Nov 2025 08:11:25 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave: Identifying and Testing Failover in High Availability DB Systems</title>
<link>https://coderlegion.com/7118/mysql-heatwave-identifying-and-testing-failover-in-high-availability-db-systems</link>
<description>&lt;p&gt;In a high availability MySQL HeatWave DB system, automatic failover is a critical mechanism that ensures business continuity when the primary instance becomes unavailable. Understanding how to identify when a failover has occurred and how to properly test failover scenarios is essential for database administrators managing mission-critical applications.&lt;/p&gt;
&lt;p&gt;This guide walks you through recognizing failover events through error messages, understanding the failover process, and implementing best practices for testing failover scenarios without disrupting production systems.&lt;/p&gt;
&lt;h3 id=&quot;understanding-failover-in-high-availability&quot;&gt;Understanding Failover in High Availability&lt;/h3&gt;
&lt;h4 id=&quot;what-is-failover-&quot;&gt;What is Failover?&lt;/h4&gt;
&lt;p&gt;Failover is the automatic process where one of the secondary MySQL instances is promoted to become the new primary instance when the current primary fails or becomes unavailable. The promotion happens automatically without manual intervention, minimizing downtime and ensuring continuous availability.&lt;/p&gt;
&lt;h4 id=&quot;common-causes-of-failover&quot;&gt;Common Causes of Failover&lt;/h4&gt;
&lt;p&gt;Failover can be triggered by several scenarios:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Availability Domain Failure&lt;/strong&gt;: Complete outage of the data center hosting the primary instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Primary Database Instance Failure&lt;/strong&gt;: Hardware failure, software crash, or critical system error on the primary instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network Connectivity Issues&lt;/strong&gt;: Loss of network connectivity between the primary instance and the MySQL HeatWave Service management layer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Block Storage Issues&lt;/strong&gt;: Persistent storage failures affecting the primary instance's ability to read or write data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maintenance Activities&lt;/strong&gt;: Certain planned maintenance operations that affect the primary instance&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;the-failover-process&quot;&gt;The Failover Process&lt;/h4&gt;
&lt;p&gt;When failover occurs:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;MySQL HeatWave Service detects the primary instance failure&lt;/li&gt;
&lt;li&gt;One of the secondary instances is automatically selected for promotion&lt;/li&gt;
&lt;li&gt;The selected secondary is promoted to primary status&lt;/li&gt;
&lt;li&gt;The DB system endpoint is reassigned to the newly promoted primary instance&lt;/li&gt;
&lt;li&gt;The IP address remains the same, but all existing connections are closed&lt;/li&gt;
&lt;li&gt;Client applications must reconnect to resume operations&lt;/li&gt;
&lt;li&gt;If a HeatWave cluster was attached, it's automatically recreated and data is reloaded&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;identifying-a-failover-error-messages-and-indicators&quot;&gt;Identifying a Failover: Error Messages and Indicators&lt;/h3&gt;
&lt;h4 id=&quot;primary-indicators-of-failover&quot;&gt;Primary Indicators of Failover&lt;/h4&gt;
&lt;h5 id=&quot;1-console-notification&quot;&gt;1. Console Notification&lt;/h5&gt;
&lt;p&gt;The most straightforward way to verify if a failover has occurred is through the OCI Console:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps to Check&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the navigation menu&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Databases&lt;/strong&gt; → &lt;strong&gt;HeatWave MySQL&lt;/strong&gt; → &lt;strong&gt;DB Systems&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Choose your compartment from the List Scope&lt;/li&gt;
&lt;li&gt;Click the name of your DB system to open the DB System Details page&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If a failover has occurred, a message is displayed stating: &quot;Current placement () differs from preferred placement, due to failover or maintenance activity&quot;&lt;/p&gt;
&lt;p&gt;This message indicates that the current primary instance is not in your originally preferred location due to automatic failover.&lt;/p&gt;
&lt;h5 id=&quot;2-mysql-event-notifications&quot;&gt;2. MySQL Event Notifications&lt;/h5&gt;
&lt;p&gt;When a failover happens, a MySQL - Automatic Recovery event is emitted on the DB system with the additionalDetails.isFailover property set to true&lt;/p&gt;
&lt;p&gt;Configure event rules to receive notifications when these events occur.&lt;/p&gt;
&lt;h4 id=&quot;error-messages-during-failover&quot;&gt;Error Messages During Failover&lt;/h4&gt;
&lt;p&gt;When a failover is in progress or has just occurred, applications may encounter various error messages. Understanding these errors helps you identify failover events and implement appropriate retry logic.&lt;/p&gt;
&lt;h5 id=&quot;error-1290-hy000-read-only-mode-error&quot;&gt;Error 1290 (HY000): Read-Only Mode Error&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option 
so it cannot execute this statement
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;What It Means&lt;/strong&gt;:&lt;br&gt;
This error occurs when attempting to execute write operations (INSERT, UPDATE, DELETE, DDL statements) on an instance that is in super-read-only mode&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When You'll See It&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;During the brief window when a primary is being demoted to secondary&lt;/li&gt;
&lt;li&gt;If your application still has connections to the old primary after failover&lt;/li&gt;
&lt;li&gt;When attempting writes to a secondary instance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What to Do&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement connection retry logic in your application&lt;/li&gt;
&lt;li&gt;Close existing connections and reconnect to get routed to the new primary&lt;/li&gt;
&lt;li&gt;Ensure your application uses the DB system endpoint, not instance-specific IPs&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;error-3100-hy000-replication-hook-error&quot;&gt;Error 3100 (HY000): Replication Hook Error&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR 3100 (HY000): Error on observer while running replication hook 'before_commit'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;What It Means&lt;/strong&gt;:&lt;br&gt;
This error indicates the system is starting the failover process, and transaction commits are being blocked or rolled back.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt;:&lt;br&gt;
This error can also indicate transaction size errors when the message includes &quot;Transaction of size X exceeds specified limit&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When You'll See It&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At the beginning of a failover event&lt;/li&gt;
&lt;li&gt;When large transactions exceed the group replication transaction size limit&lt;/li&gt;
&lt;li&gt;During the brief period when the primary instance is being transitioned&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What to Do&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Transactions in progress will be rolled back automatically&lt;/li&gt;
&lt;li&gt;Implement exponential backoff retry logic&lt;/li&gt;
&lt;li&gt;Reconnect and retry the transaction&lt;/li&gt;
&lt;li&gt;For transaction size errors, break large transactions into smaller batches&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;error-2013-hy000-connection-lost-during-query&quot;&gt;Error 2013 (HY000): Connection Lost During Query&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR 2013 (HY000): Lost connection to MySQL server during query
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;What It Means&lt;/strong&gt;:&lt;br&gt;
The connection to the MySQL server was lost while executing a query, typically because the primary instance became unavailable during failover.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When You'll See It&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;During active failover when the primary instance goes offline&lt;/li&gt;
&lt;li&gt;When long-running queries are interrupted by failover&lt;/li&gt;
&lt;li&gt;During network disruptions affecting the primary&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What to Do&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Close the broken connection&lt;/li&gt;
&lt;li&gt;Establish a new connection to the DB system endpoint&lt;/li&gt;
&lt;li&gt;Retry the query on the new primary&lt;/li&gt;
&lt;li&gt;Implement idempotent query patterns where possible&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;error-log-indicators&quot;&gt;Error Log Indicators&lt;/h4&gt;
&lt;p&gt;MySQL error logs provide detailed information about failover events. You can query the Performance Schema to view these logs.&lt;/p&gt;
&lt;h5 id=&quot;viewing-error-logs&quot;&gt;Viewing Error Logs&lt;/h5&gt;
&lt;p&gt;Connect to your DB system using MySQL Shell or MySQL Client and run:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT * FROM performance_schema.error_log 
WHERE SUBSYSTEM = 'Repl' 
ORDER BY LOGGED DESC 
LIMIT 50;
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;key-error-codes-indicating-failover&quot;&gt;Key Error Codes Indicating Failover&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;MY-013213 and MY-011507: Primary Election Change&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These errors indicate that a failover has occurred and a secondary instance has been promoted to primary through a Group Replication primary election change&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MY-011608: Transaction Size Error&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This error indicates a transaction size error where the transaction exceeds the group_replication_transaction_size_limit&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MY-011566: Super Read-Only Mode Change&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This error indicates that super_read_only has been switched off when an instance is promoted from secondary to primary, or switched on when demoted from primary to secondary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Indicates&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An instance role change has occurred&lt;/li&gt;
&lt;li&gt;The instance is transitioning between primary and secondary status&lt;/li&gt;
&lt;li&gt;Part of the normal failover process&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;additional-failover-indicators&quot;&gt;Additional Failover Indicators&lt;/h4&gt;
&lt;h5 id=&quot;binary-log-position-differences&quot;&gt;Binary Log Position Differences&lt;/h5&gt;
&lt;p&gt;After a failover, the current binary log file name and position of the new primary may be different from the old primary&lt;/p&gt;
&lt;p&gt;This is because binary logs of each instance are managed independently. Each transaction may be written to different binary log files and positions across instances.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To Check Binary Log Position&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SHOW MASTER STATUS;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Compare before and after failover to identify changes.&lt;/p&gt;
&lt;h5 id=&quot;connection-string-behavior&quot;&gt;Connection String Behavior&lt;/h5&gt;
&lt;p&gt;While the DB system endpoint IP address remains constant during failover, all existing connections are terminated and must be re-established. Monitor your application's connection pool for sudden spikes in connection closures and new connection attempts.&lt;/p&gt;
&lt;h3 id=&quot;testing-failover-process-and-best-practices&quot;&gt;Testing Failover: Process and Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;why-test-failover-&quot;&gt;Why Test Failover?&lt;/h4&gt;
&lt;p&gt;Regular failover testing is essential for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Validating your disaster recovery procedures&lt;/li&gt;
&lt;li&gt;Ensuring applications handle failovers gracefully&lt;/li&gt;
&lt;li&gt;Training operations teams on recovery processes&lt;/li&gt;
&lt;li&gt;Identifying configuration issues before real failures occur&lt;/li&gt;
&lt;li&gt;Meeting compliance and audit requirements&lt;/li&gt;
&lt;li&gt;Building confidence in your high availability architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;switchover-vs-failover&quot;&gt;Switchover vs. Failover&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Failover&lt;/strong&gt;: Automatic, unplanned promotion of a secondary to primary due to primary instance failure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Switchover&lt;/strong&gt;: Manual, planned promotion of a secondary to primary for testing, maintenance, or optimization purposes.&lt;/p&gt;
&lt;p&gt;When you perform a switchover, the preferred placement and current placement change to the newly selected placement of the primary instance, and the DB system endpoint IP address does not change&lt;/p&gt;
&lt;p&gt;Use &lt;strong&gt;switchover&lt;/strong&gt; to safely test failover scenarios without actually causing a failure.&lt;/p&gt;
&lt;h4 id=&quot;step-by-step-failover-testing-process&quot;&gt;Step-by-Step Failover Testing Process&lt;/h4&gt;
&lt;h5 id=&quot;phase-1-set-up-a-test-db-system&quot;&gt;Phase 1: Set Up a Test DB System&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Never test failover on production systems during business hours.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a Non-Production HA DB System&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use a development or staging environment&lt;/li&gt;
&lt;li&gt;Configure it identically to production (same shape, configuration, HA settings)&lt;/li&gt;
&lt;li&gt;Ensure the system has high availability enabled&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Import Representative Data&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Load a production-like dataset&lt;/li&gt;
&lt;li&gt;Include tables with primary keys (HA requirement)&lt;/li&gt;
&lt;li&gt;Consider data sensitivity and masking requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deploy a Sample Application&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use a test application that mimics production workload&lt;/li&gt;
&lt;li&gt;Implement connection pooling and retry logic&lt;/li&gt;
&lt;li&gt;Add monitoring and logging capabilities&lt;/li&gt;
&lt;li&gt;Configure the application to use the DB system endpoint&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5 id=&quot;phase-2-establish-baseline-monitoring&quot;&gt;Phase 2: Establish Baseline Monitoring&lt;/h5&gt;
&lt;p&gt;Before triggering switchover, establish baseline metrics:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application Performance Metrics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query response times&lt;/li&gt;
&lt;li&gt;Transaction throughput&lt;/li&gt;
&lt;li&gt;Connection pool statistics&lt;/li&gt;
&lt;li&gt;Error rates&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database Metrics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Active connections&lt;/li&gt;
&lt;li&gt;Current binary log position&lt;/li&gt;
&lt;li&gt;Replication lag (should be minimal in HA systems)&lt;/li&gt;
&lt;li&gt;Current primary instance location&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System Health Indicators&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CPU and memory utilization&lt;/li&gt;
&lt;li&gt;Storage I/O metrics&lt;/li&gt;
&lt;li&gt;Network latency between availability domains&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5 id=&quot;phase-3-execute-switchover&quot;&gt;Phase 3: Execute Switchover&lt;/h5&gt;
&lt;p&gt;Switchover causes a short period of downtime while the primary instance is redirected to the newly promoted instance, requiring all database connections to be reopened&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using the Console&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to your DB System details page&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Actions&lt;/strong&gt; menu&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Switchover&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Choose the target availability domain or fault domain (different from current)&lt;/li&gt;
&lt;li&gt;Confirm the switchover operation&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Using OCI CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system update \
  --db-system-id &amp;lt;YOUR_DB_SYSTEM_OCID&amp;gt; \
  --availability-domain &amp;lt;TARGET_AD&amp;gt; \
  --force
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Modern Switchover Behavior&lt;/strong&gt; (for systems created/upgraded after February 25, 2025):&lt;/p&gt;
&lt;p&gt;New transactions are blocked when switchover is initiated, running transactions are allowed to complete, and uncommitted transactions are rolled back when the connection to the previous primary is broken&lt;/p&gt;
&lt;h5 id=&quot;phase-4-monitor-the-switchover&quot;&gt;Phase 4: Monitor the Switchover&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;During Switchover&lt;/strong&gt; (typically 30-60 seconds):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Watch Application Behavior&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Monitor for connection errors (Error 1290, 2013, 3100)&lt;/li&gt;
&lt;li&gt;Observe connection pool drain and refill&lt;/li&gt;
&lt;li&gt;Track any failed transactions&lt;/li&gt;
&lt;li&gt;Verify automatic retry mechanisms&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Error Logs&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT * FROM performance_schema.error_log 
WHERE LOGGED &amp;gt; DATE_SUB(NOW(), INTERVAL 5 MINUTE)
ORDER BY LOGGED DESC;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify HeatWave Cluster Status&lt;/strong&gt; (if applicable)&lt;br&gt;
When current placement changes in a switchover, HeatWave cluster is detached from the previous primary instance and either reused (same AD) or deleted and recreated (different AD)&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SHOW GLOBAL STATUS LIKE 'rapid_plugin_bootstrapped';
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;After Switchover&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify New Primary Location&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check OCI Console for current placement&lt;/li&gt;
&lt;li&gt;Confirm switchover to target AD/FD succeeded&lt;/li&gt;
&lt;li&gt;Verify &quot;Current placement&quot; matches target&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validate Application Recovery&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All connections successfully re-established&lt;/li&gt;
&lt;li&gt;Transaction throughput returns to baseline&lt;/li&gt;
&lt;li&gt;Query performance is consistent&lt;/li&gt;
&lt;li&gt;No persistent error conditions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Data Consistency&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify recent transactions completed successfully&lt;/li&gt;
&lt;li&gt;Confirm no data loss occurred&lt;/li&gt;
&lt;li&gt;Test read and write operations&lt;/li&gt;
&lt;li&gt;Validate application state consistency&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5 id=&quot;phase-5-document-and-analyze&quot;&gt;Phase 5: Document and Analyze&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Key Metrics to Record&lt;/strong&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Metric &lt;/th&gt;&lt;th&gt;Before &lt;/th&gt;&lt;th&gt;During &lt;/th&gt;&lt;th&gt;After&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Total Downtime &lt;/td&gt;&lt;td&gt;N/A &lt;/td&gt;&lt;td&gt;___ sec &lt;/td&gt;&lt;td&gt;N/A&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Connections Dropped &lt;/td&gt;&lt;td&gt;0 &lt;/td&gt;&lt;td&gt;___ &lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Failed Transactions &lt;/td&gt;&lt;td&gt;0 &lt;/td&gt;&lt;td&gt;___ &lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Recovery Time &lt;/td&gt;&lt;td&gt;N/A &lt;/td&gt;&lt;td&gt;___ sec &lt;/td&gt;&lt;td&gt;N/A&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Analysis Questions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Did the application handle failover gracefully?&lt;/li&gt;
&lt;li&gt;Were retry mechanisms effective?&lt;/li&gt;
&lt;li&gt;Did any transactions fail permanently?&lt;/li&gt;
&lt;li&gt;How quickly did the system return to normal operation?&lt;/li&gt;
&lt;li&gt;Were there any unexpected issues?&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;switchover-to-return-to-preferred-placement&quot;&gt;Switchover to Return to Preferred Placement&lt;/h4&gt;
&lt;p&gt;After testing, you can switch back to the original preferred placement:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option 1: Switchover Back&lt;/strong&gt;&lt;br&gt;
Perform another switchover to return the primary to the original AD/FD.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option 2: Update Preferred Placement&lt;/strong&gt;&lt;br&gt;
You can switchover to the existing primary instance to change the preferred placement to the current placement with no downtime&lt;/p&gt;
&lt;h3 id=&quot;best-practices-for-handling-failover&quot;&gt;Best Practices for Handling Failover&lt;/h3&gt;
&lt;h4 id=&quot;1-test-on-non-production-systems-first&quot;&gt;1. Test on Non-Production Systems First&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Critical Rule&lt;/strong&gt;: Never test failover on production systems during business hours or peak traffic periods.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Switchover causes brief downtime (30-60 seconds)&lt;/li&gt;
&lt;li&gt;Connections are forcibly closed&lt;/li&gt;
&lt;li&gt;Uncommitted transactions are rolled back&lt;/li&gt;
&lt;li&gt;Long-running queries may be aborted&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Maintain a dedicated test environment that mirrors production&lt;/li&gt;
&lt;li&gt;Perform regular failover drills quarterly or bi-annually&lt;/li&gt;
&lt;li&gt;Test during maintenance windows for production validation&lt;/li&gt;
&lt;li&gt;Document all test results and improvements made&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-use-switchover-to-simulate-failover&quot;&gt;2. Use Switchover to Simulate Failover&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Recommendation&lt;/strong&gt;: Use manual switchover operations to test disaster recovery procedures rather than artificially creating failures.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Controlled, predictable process&lt;/li&gt;
&lt;li&gt;Ability to schedule during low-traffic periods&lt;/li&gt;
&lt;li&gt;Minimizes risk of actual data loss&lt;/li&gt;
&lt;li&gt;Provides clean before/after states for analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Testing Scenarios&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Same AD, Different Fault Domain&lt;/strong&gt;: Minimal impact, tests intra-datacenter failover&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Different AD&lt;/strong&gt;: Simulates datacenter failure, tests cross-AD latency and behavior&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With Active HeatWave Cluster&lt;/strong&gt;: Tests analytics workload recovery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Under Load&lt;/strong&gt;: Tests failover during peak transaction volume&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;3-implement-robust-application-level-retry-logic&quot;&gt;3. Implement Robust Application-Level Retry Logic&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Connection Retry Pattern&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import time
import mysql.connector
from mysql.connector import Error

def connect_with_retry(max_retries=5, base_delay=1):
    for attempt in range(max_retries):
        try:
            connection = mysql.connector.connect(
                host='&amp;lt;DB_SYSTEM_ENDPOINT&amp;gt;',
                database='your_database',
                user='admin',
                password='your_password',
                connect_timeout=10
            )
            return connection
        except Error as e:
            if attempt == max_retries - 1:
                raise
            delay = base_delay * (2 ** attempt)
            print(f&quot;Connection failed: {e}. Retrying in {delay}s...&quot;)
            time.sleep(delay)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Key Principles&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Always use the DB system endpoint, never instance-specific IPs&lt;/li&gt;
&lt;li&gt;Implement exponential backoff (1s, 2s, 4s, 8s, 16s)&lt;/li&gt;
&lt;li&gt;Limit retry attempts to avoid infinite loops&lt;/li&gt;
&lt;li&gt;Make transactions idempotent when possible&lt;/li&gt;
&lt;li&gt;Log all retry attempts for monitoring&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-move-primary-back-after-unplanned-failover&quot;&gt;4. Move Primary Back After Unplanned Failover&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;After an automatic failover occurs in production&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;The current placement differs from the preferred placement, and a message is displayed indicating &quot;Current placement differs from preferred placement, due to failover or maintenance activity&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Decision Points&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option A: Leave in New Location&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;System is stable and operational&lt;/li&gt;
&lt;li&gt;Performance is acceptable&lt;/li&gt;
&lt;li&gt;No immediate reason to change&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Option B: Switchover Back to Preferred Location&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Original location has specific advantages&lt;/li&gt;
&lt;li&gt;Schedule switchover during next maintenance window&lt;/li&gt;
&lt;li&gt;Perform during low-traffic period&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;: Don't rush to move back immediately after failover. Validate the stability of the current state first, then plan a controlled switchover during a maintenance window.&lt;/p&gt;
&lt;h4 id=&quot;5-configure-connection-timeouts-appropriately&quot;&gt;5. Configure Connection Timeouts Appropriately&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Recommended Settings&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SET GLOBAL connect_timeout = 10;
SET GLOBAL interactive_timeout = 28800;
SET GLOBAL wait_timeout = 28800;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;For Applications Using PrivateLink&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set shorter &lt;code&gt;connect_timeout&lt;/code&gt; values (5 seconds)&lt;/li&gt;
&lt;li&gt;Implement aggressive retry logic&lt;/li&gt;
&lt;li&gt;Failovers and switchovers take longer when using Query PrivateLink endpoints&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;6-test-with-heatwave-cluster&quot;&gt;6. Test with HeatWave Cluster&lt;/h4&gt;
&lt;p&gt;If your DB system has a HeatWave cluster attached:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Considerations&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cluster Behavior During Switchover&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If new primary is in the same AD as previous primary, the existing HeatWave cluster is reused and reattached&lt;/li&gt;
&lt;li&gt;If new primary is in a different AD, the existing HeatWave cluster is deleted and a new one created&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Reload&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tables are automatically reloaded from HeatWave Storage Layer&lt;/li&gt;
&lt;li&gt;Monitor reload progress: &lt;code&gt;SHOW GLOBAL STATUS LIKE 'rapid%';&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Long-Running Queries&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When current placement changes in a switchover, long-running queries offloaded to HeatWave cluster can get aborted&lt;/li&gt;
&lt;li&gt;Reconnect and rerun queries after cluster is ready&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;key-takeaways&quot;&gt;Key Takeaways&lt;/h3&gt;
&lt;p&gt;Identifying and testing failover in MySQL HeatWave high availability DB systems is a critical skill for database administrators and DevOps teams. By understanding the error messages that indicate failover, implementing proper monitoring, and regularly testing switchover scenarios in non-production environments, you can ensure your applications handle failover gracefully with minimal disruption.&lt;/p&gt;
&lt;p&gt;Key takeaways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Recognize failover indicators&lt;/strong&gt;: Watch for specific error codes (1290, 3100, 2013) and console messages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use switchover for testing&lt;/strong&gt;: Never test on production; use manual switchover to simulate failover safely&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor thoroughly&lt;/strong&gt;: Track error logs, transaction status, and application behavior&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implement retry logic&lt;/strong&gt;: Applications must handle connection failures and transaction rollbacks gracefully&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plan recovery&lt;/strong&gt;: After automatic failover, assess whether to switch back during a maintenance window&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>mysql</category>
<guid isPermaLink="true">https://coderlegion.com/7118/mysql-heatwave-identifying-and-testing-failover-in-high-availability-db-systems</guid>
<pubDate>Mon, 10 Nov 2025 10:01:57 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave: Creating High Availability DB Systems and Understanding Limitations</title>
<link>https://coderlegion.com/7074/mysql-heatwave-creating-high-availability-db-systems-and-understanding-limitations</link>
<description>&lt;h2 id=&quot;mysql-heatwave-creating-high-availability-db-systems-and-understanding-limitations&quot;&gt;MySQL HeatWave: Creating High Availability DB Systems and Understanding Limitations&lt;/h2&gt;
&lt;h3 id=&quot;introduction-1&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave offers enterprise-grade high availability features that ensure your database remains operational even during hardware failures or maintenance events. Understanding how to properly configure high availability and its associated limitations is crucial for designing resilient database architectures.&lt;/p&gt;
&lt;p&gt;This guide walks you through creating a high availability DB system and explores the important limitations you should consider when planning your deployment.&lt;/p&gt;
&lt;h3 id=&quot;creating-a-high-availability-db-system&quot;&gt;Creating a High Availability DB System&lt;/h3&gt;
&lt;h4 id=&quot;overview-of-the-creation-process&quot;&gt;Overview of the Creation Process&lt;/h4&gt;
&lt;p&gt;Creating a high availability DB system in MySQL HeatWave follows a structured workflow with three main phases:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Set Up Basic DB System Configuration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Specify Database and Infrastructure Details&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure Backup and Advanced Options&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let's explore each phase in detail.&lt;/p&gt;
&lt;h3 id=&quot;phase-1-set-up-basic-db-system-configuration&quot;&gt;Phase 1: Set Up Basic DB System Configuration&lt;/h3&gt;
&lt;h4 id=&quot;step-1-access-the-console&quot;&gt;Step 1: Access the Console&lt;/h4&gt;
&lt;p&gt;Log in to your Oracle Cloud Infrastructure (OCI) console or MySQL HeatWave on AWS console at the respective portal.&lt;/p&gt;
&lt;h4 id=&quot;step-2-navigate-to-db-systems&quot;&gt;Step 2: Navigate to DB Systems&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Open the navigation menu&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Databases&lt;/strong&gt;, select &lt;strong&gt;HeatWave MySQL&lt;/strong&gt; (OCI) or &lt;strong&gt;MySQL HeatWave&lt;/strong&gt; (AWS)&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;DB Systems&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create DB System&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-3-choose-deployment-template&quot;&gt;Step 3: Choose Deployment Template&lt;/h4&gt;
&lt;p&gt;Select the &lt;strong&gt;Production&lt;/strong&gt; template, which automatically configures your system for high availability with recommended settings for production workloads.&lt;/p&gt;
&lt;p&gt;Alternatively, you can start with &lt;strong&gt;Development or Testing&lt;/strong&gt; and manually enable high availability later.&lt;/p&gt;
&lt;h4 id=&quot;step-4-basic-configuration&quot;&gt;Step 4: Basic Configuration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Compartment&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the compartment where the DB system will reside&lt;/li&gt;
&lt;li&gt;Compartments help organize resources and control access&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Name Your DB System&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Display Name&lt;/strong&gt;: Provide a meaningful name (e.g., &quot;prod-mysql-ha-primary&quot;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Description&lt;/strong&gt;: (Optional) Add details about the system's purpose&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Database System Type&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure &quot;High Availability&quot; is selected if using the Production template&lt;/li&gt;
&lt;li&gt;For manual setup, you can enable this option here&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;phase-2-specify-database-information&quot;&gt;Phase 2: Specify Database Information&lt;/h3&gt;
&lt;h4 id=&quot;administrator-credentials&quot;&gt;Administrator Credentials&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Username Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Specify the administrator username (default is typically &quot;admin&quot;)&lt;/li&gt;
&lt;li&gt;Avoid reserved usernames like &quot;root&quot;, &quot;mysql&quot;, &quot;sys&quot;&lt;/li&gt;
&lt;li&gt;Username can be up to 32 characters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Password Requirements&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Must be 8-32 characters long&lt;/li&gt;
&lt;li&gt;Include at least one:&lt;ul&gt;
&lt;li&gt;Uppercase letter&lt;/li&gt;
&lt;li&gt;Lowercase letter  &lt;/li&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;Special character from: &lt;code&gt;,.~-+*;:_!&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Store credentials securely (consider OCI Vault or AWS Secrets Manager)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;network-configuration&quot;&gt;Network Configuration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Virtual Cloud Network (VCN)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select an existing VCN or create a new one&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subnet&lt;/strong&gt;: Choose a &lt;strong&gt;private subnet&lt;/strong&gt; for enhanced security&lt;/li&gt;
&lt;li&gt;Public subnets are not recommended for production databases&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Availability Domain Selection&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choose the &lt;strong&gt;preferred&lt;/strong&gt; availability domain for your primary instance&lt;/li&gt;
&lt;li&gt;This becomes your preferred placement&lt;/li&gt;
&lt;li&gt;The system will automatically distribute secondary instances across different ADs or fault domains&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Security Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure security lists or network security groups allow:&lt;ul&gt;
&lt;li&gt;Port &lt;strong&gt;3306&lt;/strong&gt; for MySQL connections&lt;/li&gt;
&lt;li&gt;Port &lt;strong&gt;33060&lt;/strong&gt; for MySQL X Protocol&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Restrict source CIDR blocks to known application IP ranges&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;hardware-configuration-shape-&quot;&gt;Hardware Configuration (Shape)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Select DB System Shape&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Choose a shape that meets your performance requirements:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ECPU Shapes (Recommended)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture-agnostic and future-proof&lt;/li&gt;
&lt;li&gt;Examples: MySQL.8, MySQL.16, MySQL.32, MySQL.64, MySQL.128, MySQL.256&lt;/li&gt;
&lt;li&gt;Can be changed after deployment&lt;/li&gt;
&lt;li&gt;Support high availability and HeatWave clusters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Shape Characteristics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defines CPU count, memory, and network bandwidth&lt;/li&gt;
&lt;li&gt;Higher shapes provide better performance but cost more&lt;/li&gt;
&lt;li&gt;Use Autopilot Shape Advisor for recommendations based on workload&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: All OCPU shapes are deprecated and unavailable to new users created after September 5, 2024. Existing OCPU shapes will be unavailable after March 13, 2026.&lt;/p&gt;
&lt;h4 id=&quot;storage-configuration&quot;&gt;Storage Configuration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Data Storage Size&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimum: 50 GB&lt;/li&gt;
&lt;li&gt;Maximum: 131,072 GB (128 TB)&lt;/li&gt;
&lt;li&gt;Plan for current data plus growth projections&lt;/li&gt;
&lt;li&gt;Storage can only be increased, never decreased&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Automatic Storage Expansion&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Recommended&lt;/strong&gt;: Enable this feature&lt;/li&gt;
&lt;li&gt;Automatically increases storage when usage approaches limits&lt;/li&gt;
&lt;li&gt;Prevents downtime due to storage exhaustion&lt;/li&gt;
&lt;li&gt;Based on Health Monitor read-only thresholds&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Storage Performance&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Higher storage allocations provide better IOPS&lt;/li&gt;
&lt;li&gt;Storage is backed by high-performance block storage&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;phase-3-configure-backups&quot;&gt;Phase 3: Configure Backups&lt;/h3&gt;
&lt;h4 id=&quot;enable-automatic-backups&quot;&gt;Enable Automatic Backups&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Why Backups Matter&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Protects against data loss&lt;/li&gt;
&lt;li&gt;Enables point-in-time recovery&lt;/li&gt;
&lt;li&gt;Required for disaster recovery planning&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Backup Configuration Options&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enable Automatic Backups&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Toggle: &lt;strong&gt;ON&lt;/strong&gt; (highly recommended for HA systems)&lt;/li&gt;
&lt;li&gt;Backups run automatically at scheduled times&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Backup Retention Period&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Range: 1 to 35 days&lt;/li&gt;
&lt;li&gt;Recommended: At least 7 days for production&lt;/li&gt;
&lt;li&gt;Longer retention = higher storage costs but better recovery options&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Backup Window Selection&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choose a time when database activity is lowest&lt;/li&gt;
&lt;li&gt;Typically during off-peak hours (e.g., 2:00 AM - 4:00 AM)&lt;/li&gt;
&lt;li&gt;Avoid peak transaction periods to minimize performance impact&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Point-in-Time Recovery (PITR)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enable to restore to any point within retention period&lt;/li&gt;
&lt;li&gt;Uses binary logs for granular recovery&lt;/li&gt;
&lt;li&gt;Essential for recovering from accidental data modifications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Regional Backup Copy&lt;/strong&gt; (OCI only)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Schedule automatic backup copies to another OCI region&lt;/li&gt;
&lt;li&gt;Provides geographic redundancy&lt;/li&gt;
&lt;li&gt;Protects against regional disasters&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;advanced-backup-options&quot;&gt;Advanced Backup Options&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Backup Validation&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verifies backup integrity&lt;/li&gt;
&lt;li&gt;Ensures backups are restorable&lt;/li&gt;
&lt;li&gt;Available on supported MySQL versions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Soft Delete for Backups&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enabled by default&lt;/li&gt;
&lt;li&gt;Backups remain in DELETED state before permanent deletion&lt;/li&gt;
&lt;li&gt;Provides grace period for recovery of accidentally deleted backups&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;additional-configuration-options&quot;&gt;Additional Configuration Options&lt;/h3&gt;
&lt;h4 id=&quot;heatwave-cluster-configuration-optional-&quot;&gt;HeatWave Cluster Configuration (Optional)&lt;/h4&gt;
&lt;p&gt;If you need analytics capabilities:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enable HeatWave Cluster&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checkbox: Select to add analytics processing&lt;/li&gt;
&lt;li&gt;Choose HeatWave node shape (HeatWave.512GB, HeatWave.256GB, HeatWave.128GB)&lt;/li&gt;
&lt;li&gt;Specify number of nodes (1 to 512 depending on shape and region)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Important HA Consideration&lt;/strong&gt;: On OCI, HeatWave clusters are fully supported with high availability. On AWS, HeatWave features (including Lakehouse, GenAI, and AutoML) are currently not supported on HA DB systems.&lt;/p&gt;
&lt;h4 id=&quot;mysql-configuration&quot;&gt;MySQL Configuration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Configuration Selection&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use default HA-compatible configuration (recommended)&lt;/li&gt;
&lt;li&gt;Configurations with &quot;HA&quot; suffix support high availability&lt;/li&gt;
&lt;li&gt;Custom configurations must be based on HA-compatible templates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Configuration Characteristics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defines system variables and initialization parameters&lt;/li&gt;
&lt;li&gt;Can be changed after deployment with rolling restarts&lt;/li&gt;
&lt;li&gt;Affects memory allocation, connection limits, and performance tuning&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;tagging-optional-&quot;&gt;Tagging (Optional)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Resource Tags&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add metadata for organization&lt;/li&gt;
&lt;li&gt;Enable cost tracking and allocation&lt;/li&gt;
&lt;li&gt;Support automation and bulk operations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Tag Types&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Defined Tags&lt;/strong&gt;: Created by administrators with controlled vocabularies&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free-form Tags&lt;/strong&gt;: Simple key-value pairs for flexible labeling&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;finalizing-creation&quot;&gt;Finalizing Creation&lt;/h3&gt;
&lt;h4 id=&quot;review-configuration&quot;&gt;Review Configuration&lt;/h4&gt;
&lt;p&gt;Before creating:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify all settings are correct&lt;/li&gt;
&lt;li&gt;Check estimated monthly cost&lt;/li&gt;
&lt;li&gt;Ensure network connectivity is properly configured&lt;/li&gt;
&lt;li&gt;Confirm backup settings meet compliance requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;create-db-system&quot;&gt;Create DB System&lt;/h4&gt;
&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt; to provision your high availability DB system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Provisioning Timeline&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DB system enters &lt;strong&gt;CREATING&lt;/strong&gt; state&lt;/li&gt;
&lt;li&gt;Typical creation time: 15-30 minutes for HA systems&lt;/li&gt;
&lt;li&gt;Three instances are provisioned across availability/fault domains&lt;/li&gt;
&lt;li&gt;Status changes to &lt;strong&gt;ACTIVE&lt;/strong&gt; when ready&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What Happens During Creation&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Primary instance is provisioned in preferred placement&lt;/li&gt;
&lt;li&gt;Two secondary instances created in different domains&lt;/li&gt;
&lt;li&gt;MySQL Group Replication is configured automatically&lt;/li&gt;
&lt;li&gt;Initial backup is taken (if enabled)&lt;/li&gt;
&lt;li&gt;Monitoring and health checks are activated&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;understanding-high-availability-limitations&quot;&gt;Understanding High Availability Limitations&lt;/h3&gt;
&lt;p&gt;While MySQL HeatWave high availability provides robust fault tolerance, it's important to understand its limitations to design systems appropriately.&lt;/p&gt;
&lt;h4 id=&quot;1-rolling-upgrades-and-brief-downtime&quot;&gt;1. Rolling Upgrades and Brief Downtime&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Characteristic&lt;/strong&gt;: High availability DB systems require rolling upgrades for maintenance, during which there is a brief period of downtime before the newly promoted MySQL instance resumes connections.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What This Means&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;During maintenance, instances are upgraded one at a time&lt;/li&gt;
&lt;li&gt;When the primary instance is upgraded, a failover occurs&lt;/li&gt;
&lt;li&gt;Connection strings remain the same, but applications must reconnect&lt;/li&gt;
&lt;li&gt;Downtime is typically measured in seconds, not minutes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement connection retry logic in applications&lt;/li&gt;
&lt;li&gt;Use connection pooling with automatic reconnection&lt;/li&gt;
&lt;li&gt;Schedule maintenance during low-traffic periods&lt;/li&gt;
&lt;li&gt;Test application behavior during failovers&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-mysql-version-requirements&quot;&gt;2. MySQL Version Requirements&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Limitation&lt;/strong&gt;: High availability is only supported for MySQL version 8.0.24 or higher.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implications&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Older MySQL versions cannot use HA features&lt;/li&gt;
&lt;li&gt;Must upgrade to 8.0.24+ before enabling high availability&lt;/li&gt;
&lt;li&gt;Consider upgrading to MySQL 8.4.x (LTS) or 9.x (Innovation) for latest features&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Migration Path&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Upgrade standalone DB system to 8.0.24 or higher&lt;/li&gt;
&lt;li&gt;Ensure all prerequisites are met (primary keys, etc.)&lt;/li&gt;
&lt;li&gt;Enable high availability after upgrade completes&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;3-direct-access-limitations&quot;&gt;3. Direct Access Limitations&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Limitation&lt;/strong&gt;: You can only access the primary MySQL instance directly; the two secondary instances cannot be accessed using MySQL Shell or any other client.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cannot distribute read load across secondary instances for HA systems&lt;/li&gt;
&lt;li&gt;All connections go through the primary instance&lt;/li&gt;
&lt;li&gt;Read replicas are separate feature for read scaling (not part of HA)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Alternative Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;Read Replicas&lt;/strong&gt; for read scaling (separate from HA)&lt;/li&gt;
&lt;li&gt;Read replicas can be created on HA or standalone systems&lt;/li&gt;
&lt;li&gt;Offload analytics queries to HeatWave cluster instead&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-transaction-size-limits-based-on-shape-memory&quot;&gt;4. Transaction Size Limits Based on Shape Memory&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Limitation&lt;/strong&gt;: The maximum transaction size depends on the amount of memory of the shape.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Transaction Size Limits by Shape&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Smaller shapes have lower transaction size limits&lt;/li&gt;
&lt;li&gt;Larger transactions require more memory for Group Replication&lt;/li&gt;
&lt;li&gt;Exceeding limits causes transaction failure&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example Limits&lt;/strong&gt; (approximate):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MySQL.8 (8 ECPU, 128 GB RAM): ~2 GB transaction limit&lt;/li&gt;
&lt;li&gt;MySQL.16 (16 ECPU, 256 GB RAM): ~4 GB transaction limit&lt;/li&gt;
&lt;li&gt;MySQL.32 (32 ECPU, 512 GB RAM): ~8 GB transaction limit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Workarounds&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Break large transactions into smaller batches&lt;/li&gt;
&lt;li&gt;Use bulk loading features with smaller commit sizes&lt;/li&gt;
&lt;li&gt;Select appropriate shape for your transaction patterns&lt;/li&gt;
&lt;li&gt;Consider upgrading shape if hitting limits regularly&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-heatwave-cluster-operations-and-ha-changes&quot;&gt;5. HeatWave Cluster Operations and HA Changes&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Limitation&lt;/strong&gt;: If a HeatWave cluster load or reload operation is ongoing, enabling or disabling high availability can fail.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why This Happens&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HeatWave cluster operations lock resources during data loading&lt;/li&gt;
&lt;li&gt;HA changes require cluster reconfiguration&lt;/li&gt;
&lt;li&gt;Concurrent operations can cause conflicts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wait for HeatWave operations to complete before HA changes&lt;/li&gt;
&lt;li&gt;Monitor HeatWave operation status&lt;/li&gt;
&lt;li&gt;Schedule HA changes during maintenance windows&lt;/li&gt;
&lt;li&gt;Avoid simultaneous infrastructure and data operations&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;6-heatwave-lakehouse-compatibility&quot;&gt;6. HeatWave Lakehouse Compatibility&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Previous Limitation&lt;/strong&gt;: Prior to MySQL 8.3.0-u2, you could not enable high availability on a DB system with HeatWave Lakehouse enabled.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Current Status&lt;/strong&gt;: This limitation has been lifted in MySQL 8.3.0-u2 and later versions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upgrade Path&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Systems on older versions must upgrade to use HA with Lakehouse&lt;/li&gt;
&lt;li&gt;After upgrade, both features can coexist&lt;/li&gt;
&lt;li&gt;On OCI, full support is available&lt;/li&gt;
&lt;li&gt;On AWS, HeatWave features remain unsupported on HA systems&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;7-platform-specific-limitations&quot;&gt;7. Platform-Specific Limitations&lt;/h4&gt;
&lt;h5 id=&quot;mysql-heatwave-on-aws&quot;&gt;MySQL HeatWave on AWS&lt;/h5&gt;
&lt;p&gt;On AWS, MySQL HeatWave Clusters and features requiring a cluster (MySQL HeatWave Lakehouse, GenAI, AutoML) are not currently supported on high availability DB systems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HA systems on AWS are limited to OLTP workloads&lt;/li&gt;
&lt;li&gt;Analytics features require standalone systems&lt;/li&gt;
&lt;li&gt;Must choose between HA and advanced analytics on AWS&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;query-privatelink-considerations&quot;&gt;Query PrivateLink Considerations&lt;/h5&gt;
&lt;p&gt;When using Query PrivateLink endpoints, failovers and switchovers take longer than on public endpoints.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mitigation&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;connect_timeout&lt;/code&gt; to small value (e.g., 5 seconds)&lt;/li&gt;
&lt;li&gt;Implement aggressive connection retry logic&lt;/li&gt;
&lt;li&gt;Monitor failover times&lt;/li&gt;
&lt;li&gt;Consider public endpoints for latency-sensitive applications&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;8-configuration-and-infrastructure-limitations&quot;&gt;8. Configuration and Infrastructure Limitations&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Bulk Ingest&lt;/strong&gt;: The Bulk Ingest feature is not supported on high availability DB systems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Alternative&lt;/strong&gt;: Use standard data loading methods like &lt;code&gt;LOAD DATA INFILE&lt;/code&gt; or MySQL Shell utilities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PrivateLink Management&lt;/strong&gt;: High availability cannot be enabled or disabled on a DB system with PrivateLink(s) configured.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;: Delete PrivateLinks, make HA changes, then recreate PrivateLinks.&lt;/p&gt;
&lt;h4 id=&quot;9-rolling-restart-for-configuration-changes&quot;&gt;9. Rolling Restart for Configuration Changes&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Behavior&lt;/strong&gt;: When updating configuration of a high availability DB system that changes only dynamic variables, a rolling restart is performed, which shortens downtime and causes a change in current primary placement.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What Happens&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Configuration updated on primary instance&lt;/li&gt;
&lt;li&gt;Controlled failover to secondary instance&lt;/li&gt;
&lt;li&gt;Original primary updated and becomes secondary&lt;/li&gt;
&lt;li&gt;System automatically rebalances if needed&lt;/li&gt;
&lt;li&gt;HeatWave data reloaded automatically if cluster attached&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Implications&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Brief connection interruption during rolling restart&lt;/li&gt;
&lt;li&gt;Current placement may differ from preferred placement&lt;/li&gt;
&lt;li&gt;Applications must handle reconnections&lt;/li&gt;
&lt;li&gt;HeatWave queries may be briefly unavailable during reload&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;best-practices-for-ha-db-systems&quot;&gt;Best Practices for HA DB Systems&lt;/h3&gt;
&lt;h4 id=&quot;1-application-design&quot;&gt;1. Application Design&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Connection Management&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement exponential backoff for reconnection attempts&lt;/li&gt;
&lt;li&gt;Use connection pooling with health checks&lt;/li&gt;
&lt;li&gt;Set appropriate timeout values&lt;/li&gt;
&lt;li&gt;Handle transient errors gracefully&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Transaction Design&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Keep transactions small and fast&lt;/li&gt;
&lt;li&gt;Avoid long-running transactions that span minutes&lt;/li&gt;
&lt;li&gt;Break large data modifications into batches&lt;/li&gt;
&lt;li&gt;Monitor transaction sizes against shape limits&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-monitoring-and-alerting&quot;&gt;2. Monitoring and Alerting&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Key Metrics to Monitor&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replication lag between primary and secondary instances&lt;/li&gt;
&lt;li&gt;Storage utilization and growth trends&lt;/li&gt;
&lt;li&gt;Transaction throughput and latency&lt;/li&gt;
&lt;li&gt;Failover events and frequency&lt;/li&gt;
&lt;li&gt;Backup success rates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Set Up Alerts For&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Failover events&lt;/li&gt;
&lt;li&gt;High replication lag&lt;/li&gt;
&lt;li&gt;Storage approaching limits&lt;/li&gt;
&lt;li&gt;Backup failures&lt;/li&gt;
&lt;li&gt;Configuration change events&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-testing-and-validation&quot;&gt;3. Testing and Validation&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Regular Testing&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Perform manual switchovers during maintenance windows&lt;/li&gt;
&lt;li&gt;Test application behavior during failovers&lt;/li&gt;
&lt;li&gt;Validate backup and restore procedures&lt;/li&gt;
&lt;li&gt;Verify monitoring and alerting systems&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Chaos Engineering&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Simulate instance failures&lt;/li&gt;
&lt;li&gt;Test network partition scenarios&lt;/li&gt;
&lt;li&gt;Validate automatic recovery mechanisms&lt;/li&gt;
&lt;li&gt;Document recovery procedures&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-maintenance-planning&quot;&gt;4. Maintenance Planning&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Scheduling&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Plan configuration changes during low-traffic periods&lt;/li&gt;
&lt;li&gt;Coordinate with application teams for maintenance windows&lt;/li&gt;
&lt;li&gt;Avoid changes during critical business periods&lt;/li&gt;
&lt;li&gt;Document rollback procedures&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Pre-Change Validation&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Test configuration changes in non-production first&lt;/li&gt;
&lt;li&gt;Verify compatibility with HA requirements&lt;/li&gt;
&lt;li&gt;Ensure backups are current&lt;/li&gt;
&lt;li&gt;Have rollback plan ready&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-cost-optimization&quot;&gt;5. Cost Optimization&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Resource Planning&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start with appropriate shape size&lt;/li&gt;
&lt;li&gt;Monitor utilization with Autopilot Shape Advisor&lt;/li&gt;
&lt;li&gt;Adjust shapes based on actual workload patterns&lt;/li&gt;
&lt;li&gt;Balance performance needs with cost constraints&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Backup Management&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set retention periods based on compliance requirements&lt;/li&gt;
&lt;li&gt;Use regional backup copies only when needed&lt;/li&gt;
&lt;li&gt;Enable backup validation selectively&lt;/li&gt;
&lt;li&gt;Clean up old backups per policy&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;when-not-to-use-high-availability&quot;&gt;When NOT to Use High Availability&lt;/h3&gt;
&lt;p&gt;While high availability is excellent for many use cases, it may not be appropriate when:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Development/Testing&lt;/strong&gt;: Standalone systems are more cost-effective&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Analytics-Heavy on AWS&lt;/strong&gt;: HA doesn't support HeatWave features on AWS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Very Large Transactions&lt;/strong&gt;: Shape memory limits may be restrictive&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Budget Constraints&lt;/strong&gt;: HA requires 3x compute resources vs standalone&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read-Heavy Workloads&lt;/strong&gt;: Read replicas might be more appropriate than HA&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;alternative-high-availability-strategies&quot;&gt;Alternative High Availability Strategies&lt;/h3&gt;
&lt;p&gt;If MySQL HeatWave HA limitations are too restrictive:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Read Replicas for Read Scaling&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Distribute read traffic across multiple instances&lt;/li&gt;
&lt;li&gt;Works with both standalone and HA systems&lt;/li&gt;
&lt;li&gt;Up to 10 read replicas per DB system&lt;/li&gt;
&lt;li&gt;Better for read-heavy workloads&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Multi-Region Deployment&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deploy separate DB systems in different regions&lt;/li&gt;
&lt;li&gt;Use application-level failover logic&lt;/li&gt;
&lt;li&gt;Replicate data using MySQL replication channels&lt;/li&gt;
&lt;li&gt;Provides geographic redundancy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Hybrid Architectures&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use HA for OLTP workloads&lt;/li&gt;
&lt;li&gt;Separate standalone system with HeatWave for analytics (AWS)&lt;/li&gt;
&lt;li&gt;Replicate data between systems using channels&lt;/li&gt;
&lt;li&gt;Best of both worlds but adds complexity&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;conclusion-1&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave high availability provides enterprise-grade fault tolerance with automatic failover, data protection, and minimal downtime. Understanding the limitations—particularly around rolling upgrades, transaction sizes, and platform-specific constraints—is essential for designing robust database architectures.&lt;/p&gt;
&lt;p&gt;By following best practices for application design, monitoring, and maintenance, you can build resilient systems that meet stringent uptime requirements while staying within the boundaries of high availability limitations.&lt;/p&gt;
&lt;p&gt;The key is matching your requirements to the capabilities: if you need maximum uptime for OLTP workloads with automatic failover, MySQL HeatWave HA is an excellent choice. If you need advanced analytics features on AWS or have very specific requirements, consider alternative architectures that better fit your needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/&quot;&gt;MySQL HeatWave Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/doc/ha-overview.html&quot;&gt;High Availability Architecture Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://dev.mysql.com/doc/refman/8.0/en/group-replication.html&quot;&gt;MySQL Group Replication Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>mysql</category>
<guid isPermaLink="true">https://coderlegion.com/7074/mysql-heatwave-creating-high-availability-db-systems-and-understanding-limitations</guid>
<pubDate>Fri, 07 Nov 2025 14:01:41 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave: Creating DB Systems and High Availability Setup</title>
<link>https://coderlegion.com/7029/mysql-heatwave-creating-db-systems-and-high-availability-setup</link>
<description>&lt;h2 id=&quot;mysql-heatwave-creating-db-systems-and-high-availability-setup&quot;&gt;MySQL HeatWave: Creating DB Systems and High Availability Setup&lt;/h2&gt;
&lt;h3 id=&quot;introduction-2&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave is Oracle's fully managed database service that combines transactional and analytical workloads in a single platform. This guide walks you through creating a MySQL HeatWave DB System and implementing high availability for enterprise-grade reliability.&lt;/p&gt;
&lt;h3 id=&quot;creating-a-mysql-heatwave-db-system&quot;&gt;Creating a MySQL HeatWave DB System&lt;/h3&gt;
&lt;h4 id=&quot;step-1-access-oci-console&quot;&gt;Step 1: Access OCI Console&lt;/h4&gt;
&lt;p&gt;Log in to your Oracle Cloud Infrastructure (OCI) console at cloud.oracle.com with your credentials.&lt;/p&gt;
&lt;h4 id=&quot;step-2-navigate-to-db-systems-1&quot;&gt;Step 2: Navigate to DB Systems&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Open the navigation menu (hamburger icon)&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Databases&lt;/strong&gt;, select &lt;strong&gt;HeatWave MySQL&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;DB Systems&lt;/strong&gt; from the menu&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;step-3-initiate-db-system-creation&quot;&gt;Step 3: Initiate DB System Creation&lt;/h4&gt;
&lt;p&gt;Click the &lt;strong&gt;Create DB System&lt;/strong&gt; button. This opens the Create DB System dialog with several configuration options.&lt;/p&gt;
&lt;h4 id=&quot;step-4-choose-a-template&quot;&gt;Step 4: Choose a Template&lt;/h4&gt;
&lt;p&gt;Oracle provides three templates to streamline setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Production&lt;/strong&gt;: Creates a high availability DB system with recommended settings for production environments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Development or Testing&lt;/strong&gt;: Creates a standalone DB system optimized for dev/test workloads&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always Free&lt;/strong&gt;: Creates a standalone system with limited resources (50GB storage, MySQL.Free shape) suitable for learning and small projects&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-5-configure-basic-information&quot;&gt;Step 5: Configure Basic Information&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Compartment Selection&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choose the compartment where you want to create the DB system&lt;/li&gt;
&lt;li&gt;Compartments help organize and manage access to resources&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;System Identification&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt;: Provide a display name for your DB system (doesn't need to be unique)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Description&lt;/strong&gt;: (Optional) Add details about the system's purpose&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OCID&lt;/strong&gt;: Oracle automatically generates a unique identifier&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-6-configure-database-credentials&quot;&gt;Step 6: Configure Database Credentials&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Administrator Credentials&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Username&lt;/strong&gt;: Specify the administrator username (avoid reserved usernames)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password&lt;/strong&gt;: Create a strong password that meets security requirements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Important&lt;/strong&gt;: Save these credentials securely – you'll need them to connect to the database&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-7-configure-networking&quot;&gt;Step 7: Configure Networking&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Virtual Cloud Network (VCN)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select an existing VCN or create a new one&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;private subnet&lt;/strong&gt; for the DB system (recommended for security)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Availability Domain&lt;/strong&gt;: Select the AD where the primary instance will run&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fault Domain&lt;/strong&gt;: Oracle automatically selects an appropriate fault domain&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Configure Security List&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ensure your VCN's security list allows MySQL traffic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Source CIDR&lt;/strong&gt;: 0.0.0.0/0 (or restrict to specific IP ranges)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Destination Ports&lt;/strong&gt;: 3306 (MySQL) and 33060 (MySQL X Protocol)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-8-select-shape&quot;&gt;Step 8: Select Shape&lt;/h4&gt;
&lt;p&gt;Choose a shape that defines your system's compute resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ECPU Shapes&lt;/strong&gt; (Recommended as of 2024): Architecture-agnostic shapes that can be changed after deployment&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OCPU Shapes&lt;/strong&gt;: Being deprecated for new users (sunset date: March 13, 2026)&lt;/li&gt;
&lt;li&gt;Examples: MySQL.8, MySQL.16, MySQL.32, MySQL.HeatWave.VM.Standard&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The shape determines CPU count, memory, and network bandwidth. You can scale up or down later based on workload demands.&lt;/p&gt;
&lt;h4 id=&quot;step-9-configure-storage&quot;&gt;Step 9: Configure Storage&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Initial Data Storage Size&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Specify storage in GB (minimum: 50 GB, maximum: 131,072 GB)&lt;/li&gt;
&lt;li&gt;Consider your current data size plus growth projections&lt;/li&gt;
&lt;li&gt;Storage can be increased later but not decreased&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Automatic Storage Expansion&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enable this feature to automatically grow storage when space usage approaches the Health Monitor read-only limits&lt;/li&gt;
&lt;li&gt;Helps prevent storage-related outages&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-10-configure-heatwave-cluster-optional-&quot;&gt;Step 10: Configure HeatWave Cluster (Optional)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Enable HeatWave Cluster&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select this option to add analytics capabilities&lt;/li&gt;
&lt;li&gt;Configure the number of HeatWave nodes (minimum: 1, maximum: depends on shape and region)&lt;/li&gt;
&lt;li&gt;Choose the HeatWave node shape&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;MySQL HeatWave Lakehouse&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enable to query data in Object Storage (CSV, Parquet, Aurora/Redshift backups)&lt;/li&gt;
&lt;li&gt;Note: Prior to MySQL 8.3.0-u2, enabling Lakehouse required disabling HA, point-in-time recovery, and read replicas&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-11-configure-backup-plan&quot;&gt;Step 11: Configure Backup Plan&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Backup Settings&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enable automatic backups&lt;/strong&gt;: Recommended for production&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Backup retention period&lt;/strong&gt;: Choose from 1 to 35 days&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Point-in-time recovery&lt;/strong&gt;: Enables restoration to any point within the retention window&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Backup window&lt;/strong&gt;: Select a time when database activity is lowest&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-12-advanced-options-optional-&quot;&gt;Step 12: Advanced Options (Optional)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply a custom configuration or use the default&lt;/li&gt;
&lt;li&gt;High availability requires an HA-compatible configuration (configurations with &quot;HA&quot; suffix)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Hostname Label&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Define a DNS hostname for your DB system (requires DNS hostnames enabled in VCN)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add metadata for organization and cost tracking&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-13-create-the-db-system&quot;&gt;Step 13: Create the DB System&lt;/h4&gt;
&lt;p&gt;Review all settings and click &lt;strong&gt;Create&lt;/strong&gt;. The DB system enters the &lt;strong&gt;CREATING&lt;/strong&gt; state and typically becomes available in 15-30 minutes.&lt;/p&gt;
&lt;h3 id=&quot;understanding-high-availability-in-mysql-heatwave&quot;&gt;Understanding High Availability in MySQL HeatWave&lt;/h3&gt;
&lt;p&gt;High availability is a critical feature for production workloads that require maximum uptime and fault tolerance.&lt;/p&gt;
&lt;h4 id=&quot;what-is-high-availability-&quot;&gt;What is High Availability?&lt;/h4&gt;
&lt;p&gt;A high availability DB system consists of three MySQL instances: a primary instance and two secondary instances, with the primary functioning as a read/write endpoint and secondary instances receiving asynchronous data replication from the primary.&lt;/p&gt;
&lt;h4 id=&quot;key-benefits&quot;&gt;Key Benefits&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Business Continuity&lt;/strong&gt;: Three MySQL instances distributed across different availability or fault domains&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minimal Downtime&lt;/strong&gt;: Automatic failover promotes a secondary instance to primary when the primary fails, resuming availability with no data loss&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flexible Placement&lt;/strong&gt;: Choose your preferred availability domain and fault domain for the primary instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uptime SLA&lt;/strong&gt;: Supports 99.99% availability requirements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HeatWave Compatible&lt;/strong&gt;: You can enable HeatWave cluster on high availability DB systems&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;architecture-components&quot;&gt;Architecture Components&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Primary Instance&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Handles all write operations and read queries&lt;/li&gt;
&lt;li&gt;Located in your chosen availability domain&lt;/li&gt;
&lt;li&gt;Provides the read/write endpoint with a consistent IP address&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Secondary Instances (2)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Receive replicated data from the primary asynchronously&lt;/li&gt;
&lt;li&gt;Placed in different availability or fault domains from the primary&lt;/li&gt;
&lt;li&gt;Ready to be promoted to primary during failover&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Placement Models&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are two deployment models:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Multiple Availability Domains with Regional Subnet&lt;/strong&gt;: Three instances spread across three different ADs (AD1, AD2, AD3)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single Availability Domain with Multiple Fault Domains&lt;/strong&gt;: All three instances in one AD but different fault domains&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;replication-mechanism&quot;&gt;Replication Mechanism&lt;/h4&gt;
&lt;p&gt;MySQL HeatWave uses MySQL Group Replication for high availability, with primary keys required as a prerequisite for the group replication used by high availability. Data is copied from the primary to secondary instances over a secure, managed internal network.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: The binary logs of each MySQL instance are managed independently, meaning even though instances have the same data, they can have different binary log files with different names and sizes.&lt;/p&gt;
&lt;h3 id=&quot;prerequisites-for-enabling-high-availability&quot;&gt;Prerequisites for Enabling High Availability&lt;/h3&gt;
&lt;p&gt;Before enabling high availability on a DB system, ensure the following requirements are met:&lt;/p&gt;
&lt;h4 id=&quot;1-mysql-version-requirement&quot;&gt;1. MySQL Version Requirement&lt;/h4&gt;
&lt;p&gt;MySQL version must be 8.0.24 or higher to enable high availability. If using an older version, upgrade before enabling HA.&lt;/p&gt;
&lt;h4 id=&quot;2-primary-keys-on-all-tables&quot;&gt;2. Primary Keys on All Tables&lt;/h4&gt;
&lt;p&gt;If you are migrating data to MySQL HeatWave and have not defined primary keys on your tables, you must add them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why Primary Keys Matter&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Required for MySQL Group Replication&lt;/li&gt;
&lt;li&gt;Ensure data consistency across instances&lt;/li&gt;
&lt;li&gt;Impact load performance if composite or non-INTEGER&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;How to Check and Add Primary Keys&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use MySQL Shell to identify tables without primary keys:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT DISTINCT
    table_schema,
    table_name
FROM information_schema.columns
WHERE table_schema NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys')
AND table_name NOT IN (
    SELECT table_name
    FROM information_schema.table_constraints
    WHERE constraint_type = 'PRIMARY KEY'
);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Adding Primary Keys Using Invisible Columns&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Using invisible columns to add primary keys is a low-impact way to update existing data for use with a high availability DB system:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;ALTER TABLE your_table 
ADD COLUMN id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY INVISIBLE;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-crash-recovery-enabled&quot;&gt;3. Crash Recovery Enabled&lt;/h4&gt;
&lt;p&gt;Verify crash recovery is enabled on your DB system. This is typically enabled by default but can be checked in the configuration settings.&lt;/p&gt;
&lt;h4 id=&quot;4-inbound-replication-stopped&quot;&gt;4. Inbound Replication Stopped&lt;/h4&gt;
&lt;p&gt;If you intend to configure an inbound replication channel on this DB system, you must import data before enabling high availability and configure your channel after high availability is enabled.&lt;/p&gt;
&lt;h4 id=&quot;5-compatible-configuration&quot;&gt;5. Compatible Configuration&lt;/h4&gt;
&lt;p&gt;All default configurations that are compatible with high availability have the HA suffix in the configuration name. If using a custom configuration, copy it from an existing HA-compatible configuration.&lt;/p&gt;
&lt;h4 id=&quot;6-heatwave-cluster-considerations&quot;&gt;6. HeatWave Cluster Considerations&lt;/h4&gt;
&lt;p&gt;If a HeatWave cluster load or reload operation is ongoing, enabling or disabling high availability can fail. Wait for these operations to complete before making HA changes.&lt;/p&gt;
&lt;h3 id=&quot;enabling-high-availability-on-an-existing-db-system&quot;&gt;Enabling High Availability on an Existing DB System&lt;/h3&gt;
&lt;h4 id=&quot;using-the-console&quot;&gt;Using the Console&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to your DB System details page&lt;/li&gt;
&lt;li&gt;From the &lt;strong&gt;Actions&lt;/strong&gt; menu, select &lt;strong&gt;Enable high availability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Review the prerequisites dialog&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Enable high availability&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The process creates two secondary instances by cloning from the primary instance and does not cause any downtime.&lt;/p&gt;
&lt;h4 id=&quot;using-oci-cli&quot;&gt;Using OCI CLI&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system update \
  --db-system-id &amp;lt;DB_SYSTEM_OCID&amp;gt; \
  --is-highly-available true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the configuration is not compatible with high availability, you must first change the DB system to use a high availability compatible configuration before enabling it.&lt;/p&gt;
&lt;h3 id=&quot;understanding-failover-and-switchover&quot;&gt;Understanding Failover and Switchover&lt;/h3&gt;
&lt;h4 id=&quot;automatic-failover&quot;&gt;Automatic Failover&lt;/h4&gt;
&lt;p&gt;When the primary instance becomes unavailable due to hardware failure, network issues, or other problems, MySQL HeatWave Service automatically initiates a failover.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Failover Process&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Service detects primary instance failure&lt;/li&gt;
&lt;li&gt;One secondary instance is automatically promoted to primary&lt;/li&gt;
&lt;li&gt;The IP address of the read/write endpoint does not change, regardless of the placement of the primary instance&lt;/li&gt;
&lt;li&gt;Applications must reconnect, but the endpoint remains the same&lt;/li&gt;
&lt;li&gt;No data loss occurs&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For a high availability DB system with HeatWave cluster, if the primary instance fails, HeatWave Service deletes the HeatWave cluster attached to the failed instance and adds a new one to the new primary instance, with tables automatically loaded.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Post-Failover State&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;current placement&lt;/strong&gt; changes to the new primary's location&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;preferred placement&lt;/strong&gt; (your original choice) remains unchanged&lt;/li&gt;
&lt;li&gt;A message appears: &quot;Current placement differs from preferred placement, due to failover&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;manual-switchover&quot;&gt;Manual Switchover&lt;/h4&gt;
&lt;p&gt;You can manually select one of the MySQL instances as the primary instance through switchover, which changes both the preferred placement and current placement to the newly selected placement.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When to Use Switchover&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Planned maintenance on the current primary's availability domain&lt;/li&gt;
&lt;li&gt;Testing disaster recovery procedures&lt;/li&gt;
&lt;li&gt;Rebalancing after a failover to restore preferred placement&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Switchover Process&lt;/strong&gt; (for systems created/upgraded after February 25, 2025):&lt;/p&gt;
&lt;p&gt;New transactions are blocked when switchover is initiated, running transactions are allowed to complete, and the switchover process waits until all running transactions finish and commit.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to DB System details page&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Switchover&lt;/strong&gt; from the Actions menu&lt;/li&gt;
&lt;li&gt;Select the target availability domain or fault domain&lt;/li&gt;
&lt;li&gt;Confirm the switchover&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When the current placement changes in a switchover, it results in a short period of downtime while the primary instance is redirected to the newly promoted instance, and all database connections must be reopened.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system update \
  --db-system-id &amp;lt;DB_SYSTEM_OCID&amp;gt; \
  --availability-domain &amp;lt;TARGET_AD&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Important Notes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Uncommitted transactions are rolled back when the connection to the previous primary instance is broken&lt;/li&gt;
&lt;li&gt;Long-running queries offloaded to HeatWave cluster may be aborted&lt;/li&gt;
&lt;li&gt;After a switchover, the current binary log file name and position of the new primary may be different from the old primary&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;heatwave-cluster-with-high-availability&quot;&gt;HeatWave Cluster with High Availability&lt;/h3&gt;
&lt;p&gt;You can enable HeatWave cluster on a high availability DB system for combined OLTP and analytics capabilities.&lt;/p&gt;
&lt;h4 id=&quot;heatwave-behavior-during-placement-changes&quot;&gt;HeatWave Behavior During Placement Changes&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Same Availability Domain&lt;/strong&gt;:&lt;br&gt;
If both the previous primary instance and the new primary instance are located in the same availability domain, the existing HeatWave cluster can be reused by detaching from the previous primary and reattaching to the new primary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Different Availability Domains&lt;/strong&gt;:&lt;br&gt;
If the previous primary and new primary are in different availability domains, the existing HeatWave cluster must be detached and deleted, with a new HeatWave cluster created in the same AD as the new primary instance.&lt;/p&gt;
&lt;h4 id=&quot;data-recovery&quot;&gt;Data Recovery&lt;/h4&gt;
&lt;p&gt;The data in the HeatWave cluster is automatically recovered from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The HeatWave Storage Layer (fastest option)&lt;/li&gt;
&lt;li&gt;Reloaded from the DB system&lt;/li&gt;
&lt;li&gt;Reloaded from Lakehouse Object Storage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This ensures minimal disruption to analytics workloads even during failover scenarios.&lt;/p&gt;
&lt;h3 id=&quot;disabling-high-availability&quot;&gt;Disabling High Availability&lt;/h3&gt;
&lt;p&gt;If you need to convert a high availability DB system back to standalone:&lt;/p&gt;
&lt;p&gt;Disabling high availability creates a standalone DB system from the instance running in the preferred primary placement, with no downtime if the primary is already in the preferred placement, but a controlled failover and short downtime if it is not.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console Method&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to DB System details&lt;/li&gt;
&lt;li&gt;Actions menu → &lt;strong&gt;Disable high availability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Confirm the action&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;CLI Method&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system update \
  --db-system-id &amp;lt;DB_SYSTEM_OCID&amp;gt; \
  --is-highly-available false
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: You can avoid downtime by switching the preferred primary placement to the current primary instance before disabling high availability.&lt;/p&gt;
&lt;h3 id=&quot;monitoring-and-observability&quot;&gt;Monitoring and Observability&lt;/h3&gt;
&lt;h4 id=&quot;health-monitoring&quot;&gt;Health Monitoring&lt;/h4&gt;
&lt;p&gt;MySQL HeatWave provides built-in monitoring:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Instance health status&lt;/li&gt;
&lt;li&gt;Storage utilization&lt;/li&gt;
&lt;li&gt;Connection metrics&lt;/li&gt;
&lt;li&gt;Replication lag (for HA systems)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;event-notifications&quot;&gt;Event Notifications&lt;/h4&gt;
&lt;p&gt;When a failover happens, a MySQL - Automatic Recovery event is emitted on the DB system with the additionalDetails.isFailover property set to true.&lt;/p&gt;
&lt;p&gt;Configure operational notifications to receive alerts for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Failover events&lt;/li&gt;
&lt;li&gt;Storage threshold warnings&lt;/li&gt;
&lt;li&gt;Backup completion/failure&lt;/li&gt;
&lt;li&gt;Maintenance notifications&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;integration-with-monitoring-services&quot;&gt;Integration with Monitoring Services&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OCI Monitoring&lt;/strong&gt;: Native integration with OCI Monitoring service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS CloudWatch&lt;/strong&gt;: Available for MySQL HeatWave on AWS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom Metrics&lt;/strong&gt;: Export metrics to third-party monitoring tools&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;best-practices-1&quot;&gt;Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;planning-for-high-availability&quot;&gt;Planning for High Availability&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Always Use HA for Production&lt;/strong&gt;: Any workload requiring uptime guarantees should use high availability&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test Failover Procedures&lt;/strong&gt;: Regularly perform switchovers to verify your disaster recovery processes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Replication Lag&lt;/strong&gt;: Though minimal, monitor lag between primary and secondary instances&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure Application Retry Logic&lt;/strong&gt;: Ensure applications can reconnect automatically after failover&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;storage-planning&quot;&gt;Storage Planning&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Oversize Storage Initially&lt;/strong&gt;: Leave room for growth to avoid frequent expansions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enable Automatic Expansion&lt;/strong&gt;: Prevents storage-related outages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Storage Trends&lt;/strong&gt;: Track usage patterns to predict future needs&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use Private Subnets&lt;/strong&gt;: Keep DB systems in private subnets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restrict Security Lists&lt;/strong&gt;: Limit access to known IP ranges&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secure Credentials&lt;/strong&gt;: Use OCI Vault for secrets management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regular Patches&lt;/strong&gt;: Enable automatic security updates&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;cost-optimization&quot;&gt;Cost Optimization&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Right-Size Shapes&lt;/strong&gt;: Start with appropriate shapes and adjust based on metrics&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optimize Backup Retention&lt;/strong&gt;: Balance compliance needs with storage costs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Development Templates&lt;/strong&gt;: For non-production workloads, use lower-cost configurations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Resource Utilization&lt;/strong&gt;: Use Autopilot Shape Advisor for recommendations&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;conclusion-2&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave provides a comprehensive, fully managed database service with enterprise-grade high availability features. By following this guide, you can create robust DB systems that meet demanding uptime requirements while benefiting from automatic failover, integrated analytics, and seamless scalability.&lt;/p&gt;
&lt;p&gt;The combination of automated management, built-in high availability, and HeatWave analytics capabilities makes MySQL HeatWave an excellent choice for modern applications requiring both transactional processing and real-time analytics without the complexity of managing multiple database systems.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For the latest information, consult the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/&quot;&gt;official MySQL HeatWave documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
<category>mysql</category>
<guid isPermaLink="true">https://coderlegion.com/7029/mysql-heatwave-creating-db-systems-and-high-availability-setup</guid>
<pubDate>Tue, 04 Nov 2025 11:52:49 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave Architecture: A Complete Guide</title>
<link>https://coderlegion.com/6993/mysql-heatwave-architecture-a-complete-guide</link>
<description>&lt;h3 id=&quot;introduction-3&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave is Oracle's fully managed database service that uniquely combines Online Transaction Processing (OLTP) and Online Analytical Processing (OLAP) workloads in a single platform. Built on MySQL Enterprise Edition, it delivers real-time analytics on transactional data without requiring ETL duplication to a separate analytics database.&lt;/p&gt;
&lt;h3 id=&quot;db-system-architecture-overview&quot;&gt;DB System Architecture Overview&lt;/h3&gt;
&lt;p&gt;A MySQL HeatWave DB System consists of several key components:&lt;/p&gt;
&lt;h4 id=&quot;core-components&quot;&gt;Core Components&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compute Instance&lt;/strong&gt;: The foundational cloud-based compute resource&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL Server&lt;/strong&gt;: MySQL Enterprise Edition with advanced security features including encryption, data masking, authentication, and a database firewall&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: Oracle Linux OS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Virtual Network Interface Card (VNIC)&lt;/strong&gt;: Enables network connectivity&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Block Storage&lt;/strong&gt;: Persistent storage for data and transaction logs&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;prerequisites-for-deployment&quot;&gt;Prerequisites for Deployment&lt;/h4&gt;
&lt;p&gt;Before creating a DB System, you need:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Tenancy&lt;/strong&gt;: Your Oracle Cloud Infrastructure account&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compartment&lt;/strong&gt;: Logical container for organizing resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Policies&lt;/strong&gt;: IAM policies for access control&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Virtual Cloud Network (VCN)&lt;/strong&gt;: Network infrastructure for connectivity&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;db-system-provisioning&quot;&gt;DB System Provisioning&lt;/h3&gt;
&lt;h4 id=&quot;shape-configuration&quot;&gt;Shape Configuration&lt;/h4&gt;
&lt;p&gt;Shapes specify CPU, memory, and network bandwidth. As of 2024, you can provision MySQL HeatWave DB systems using ECPU shapes, which are architecture-agnostic. Shapes can be changed after deployment to scale your resources up or down based on workload demands.&lt;/p&gt;
&lt;h4 id=&quot;storage-capacity&quot;&gt;Storage Capacity&lt;/h4&gt;
&lt;p&gt;Storage stores both data and logs and can be increased as your database grows. The system automatically manages storage allocation for optimal performance.&lt;/p&gt;
&lt;h4 id=&quot;endpoint-configuration&quot;&gt;Endpoint Configuration&lt;/h4&gt;
&lt;p&gt;The endpoint comprises private IP addresses and port numbers that accept client connections. This provides secure, private connectivity to your database instance.&lt;/p&gt;
&lt;h3 id=&quot;data-security-in-heatwave&quot;&gt;Data Security in HeatWave&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave implements comprehensive security measures: data is encrypted and compressed both at rest and in transit. Client applications connect securely to the HeatWave DB System through encrypted channels.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Data Masking&lt;/strong&gt; is commonly implemented for protecting sensitive information such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Social Security Numbers (SSNs)&lt;/li&gt;
&lt;li&gt;Credit card numbers&lt;/li&gt;
&lt;li&gt;Phone numbers&lt;/li&gt;
&lt;li&gt;Personally Identifiable Information (PII)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;high-availability-architecture&quot;&gt;High Availability Architecture&lt;/h3&gt;
&lt;h4 id=&quot;standalone-vs-high-availability-db-systems&quot;&gt;Standalone vs. High Availability DB Systems&lt;/h4&gt;
&lt;p&gt;A &lt;strong&gt;High Availability (HA) DB System&lt;/strong&gt; provides enterprise-grade reliability through:&lt;/p&gt;
&lt;p&gt;Three MySQL instances: one primary instance and two secondary instances, with all data written to the primary instance automatically copied to the secondary instances.&lt;/p&gt;
&lt;h4 id=&quot;distribution-across-availability-domains&quot;&gt;Distribution Across Availability Domains&lt;/h4&gt;
&lt;p&gt;The three instances are deployed across different availability domains (AD1, AD2, AD3) and fault domains. This geographic distribution ensures resilience against localized failures.&lt;/p&gt;
&lt;h4 id=&quot;automatic-failover-mechanism&quot;&gt;Automatic Failover Mechanism&lt;/h4&gt;
&lt;p&gt;In case the primary instance fails, MySQL HeatWave Service automatically promotes one of the secondary instances to function as the primary instance, resuming availability with no data loss.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important Note&lt;/strong&gt;: MySQL HeatWave uses MySQL Group Replication to replicate data from the primary to secondary instances over a secure, managed internal network.&lt;/p&gt;
&lt;h3 id=&quot;heatwave-cluster-architecture&quot;&gt;HeatWave Cluster Architecture&lt;/h3&gt;
&lt;h4 id=&quot;components-and-features&quot;&gt;Components and Features&lt;/h4&gt;
&lt;p&gt;The HeatWave cluster extends your DB System with powerful analytics capabilities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HeatWave Plugin&lt;/strong&gt;: Manages cluster operations and query routing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HeatWave Nodes&lt;/strong&gt;: Store data in memory and process analytics queries, with each node containing an instance of HeatWave&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Loading&lt;/strong&gt;: Tables are loaded from MySQL into the HeatWave cluster&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query Offloading&lt;/strong&gt;: Analytics queries are automatically offloaded to the cluster&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;scalability&quot;&gt;Scalability&lt;/h4&gt;
&lt;p&gt;HeatWave's scale-out architecture enables massive parallelism, allowing the cluster to scale up to 512 nodes for provisioning, loading data, and processing queries.&lt;/p&gt;
&lt;h4 id=&quot;query-processing&quot;&gt;Query Processing&lt;/h4&gt;
&lt;p&gt;MySQL HeatWave Cluster stores data in main memory using a hybrid columnar format that achieves the benefits of columnar processing while avoiding the materialization and update costs of pure columnar format.&lt;/p&gt;
&lt;p&gt;Queries that meet specific prerequisites are automatically offloaded from the MySQL DB System to the HeatWave cluster for accelerated processing, with results returned to the client through the MySQL DB System.&lt;/p&gt;
&lt;h3 id=&quot;heatwave-storage-layer&quot;&gt;HeatWave Storage Layer&lt;/h3&gt;
&lt;p&gt;The HeatWave Storage Layer is a critical component that provides data persistence and rapid recovery:&lt;/p&gt;
&lt;h4 id=&quot;key-features&quot;&gt;Key Features&lt;/h4&gt;
&lt;p&gt;Data loaded into MySQL HeatWave Cluster is automatically persisted to network-attached block storage, known as the MySQL HeatWave Storage Layer, which allows data to be reloaded quickly when the cluster resumes after a pause or recovers from a node or cluster failure.&lt;/p&gt;
&lt;h4 id=&quot;storage-layer-capabilities&quot;&gt;Storage Layer Capabilities&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Automated Persistence&lt;/strong&gt;: Stores a copy of in-memory data automatically&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transparent Updates&lt;/strong&gt;: Changes are propagated without manual intervention&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fast Recovery&lt;/strong&gt;: Enables rapid restoration after failures&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Reload&lt;/strong&gt;: Supports efficient data restoration to memory&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic Expansion&lt;/strong&gt;: On AWS, the storage layer is built on S3, allowing data to be reloaded to each MySQL HeatWave node independently and in parallel&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;self-managing-architecture&quot;&gt;Self-Managing Architecture&lt;/h4&gt;
&lt;p&gt;This automated, self-managing storage layer scales to the size required for your MySQL HeatWave Cluster and operates independently in the background.&lt;/p&gt;
&lt;h3 id=&quot;heatwave-lakehouse&quot;&gt;HeatWave Lakehouse&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave Lakehouse allows enterprises to process and query data across file formats such as CSV and Parquet, as well as Aurora and Redshift backups from AWS, even when data is not stored inside a MySQL database.&lt;/p&gt;
&lt;p&gt;The Lakehouse capability enables organizations to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query up to 400TB of data in object storage&lt;/li&gt;
&lt;li&gt;Combine OLTP data with data lake information&lt;/li&gt;
&lt;li&gt;Eliminate ETL complexity and costs&lt;/li&gt;
&lt;li&gt;Process structured, semi-structured, and unstructured data&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;performance-and-capabilities&quot;&gt;Performance and Capabilities&lt;/h3&gt;
&lt;h4 id=&quot;automl-integration&quot;&gt;AutoML Integration&lt;/h4&gt;
&lt;p&gt;MySQL HeatWave includes built-in machine learning capabilities through HeatWave AutoML, which:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automates model training and selection&lt;/li&gt;
&lt;li&gt;Eliminates the need for separate ML services&lt;/li&gt;
&lt;li&gt;Processes data in-database for security and performance&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;genai-and-vector-store&quot;&gt;GenAI and Vector Store&lt;/h4&gt;
&lt;p&gt;Recent additions include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In-database Large Language Models (LLMs)&lt;/li&gt;
&lt;li&gt;Automated vector store for AI applications&lt;/li&gt;
&lt;li&gt;Natural language query capabilities&lt;/li&gt;
&lt;li&gt;Contextual conversations with your data&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;performance-benchmarks&quot;&gt;Performance Benchmarks&lt;/h4&gt;
&lt;p&gt;Oracle claims HeatWave provides 1,400x faster analytics performance than Amazon RDS Aurora and 6-7x faster than AWS Redshift and Snowflake, based on their benchmarks.&lt;/p&gt;
&lt;h3 id=&quot;multicloud-availability&quot;&gt;Multicloud Availability&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave is available across multiple cloud platforms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Oracle Cloud Infrastructure (OCI)&lt;/strong&gt;: Native availability in all OCI regions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon Web Services (AWS)&lt;/strong&gt;: Native deployment within AWS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Microsoft Azure&lt;/strong&gt;: Available through Oracle Database Service for Azure&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;best-practices-2&quot;&gt;Best Practices&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Enable High Availability&lt;/strong&gt;: For production workloads requiring 99.99% uptime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Shape Performance&lt;/strong&gt;: Use Autopilot Shape Advisor for optimization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implement Data Masking&lt;/strong&gt;: Protect sensitive information at the column level&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leverage Storage Layer&lt;/strong&gt;: Trust automatic persistence for recovery scenarios&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plan Node Capacity&lt;/strong&gt;: Use the Estimate Node Count feature for proper cluster sizing&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;conclusion-3&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave represents a significant advancement in database technology by unifying OLTP and OLAP workloads in a single, fully managed service. Its innovative architecture, featuring automated storage management, high availability, and integrated machine learning capabilities, makes it a compelling choice for organizations seeking to eliminate data duplication, reduce costs, and accelerate insights from their data.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For more detailed information, consult the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/&quot;&gt;official MySQL HeatWave documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/6993/mysql-heatwave-architecture-a-complete-guide</guid>
<pubDate>Sun, 02 Nov 2025 09:22:57 +0000</pubDate>
</item>
<item>
<title>Building Resilient Oracle Databases: Essential Strategies for Security and Maximum Availability</title>
<link>https://coderlegion.com/5275/building-resilient-oracle-databases-essential-strategies-security-maximum-availability</link>
<description>&lt;h2 id=&quot;building-resilient-oracle-databases-essential-strategies-for-security-and-maximum-availability-architecture&quot;&gt;Building Resilient Oracle Databases: Essential Strategies for Security and Maximum Availability Architecture&lt;/h2&gt;
&lt;p&gt;In today's data-driven landscape, ensuring database resilience through robust security measures and high availability architecture is not just best practice—it's business critical. Oracle provides a comprehensive framework for achieving both maximum security and availability through integrated technologies and proven methodologies.&lt;/p&gt;
&lt;h3 id=&quot;securing-data-at-its-source-a-multi-layered-approach&quot;&gt;Securing Data at Its Source: A Multi-Layered Approach&lt;/h3&gt;
&lt;h4 id=&quot;core-security-principles&quot;&gt;Core Security Principles&lt;/h4&gt;
&lt;p&gt;Modern database security requires a defense-in-depth strategy that protects data throughout its entire lifecycle. Oracle Database offers comprehensive encryption, key management, and masking capabilities that scale to enterprise-level workloads, addressing the requirements of most data privacy regulations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Data Encryption and Key Management&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data at Rest&lt;/strong&gt;: Transparent Data Encryption (TDE) for tablespaces and databases&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data in Motion&lt;/strong&gt;: Network encryption using SSL/TLS protocols&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Key Management&lt;/strong&gt;: Oracle Key Vault for centralized key lifecycle management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advanced Features&lt;/strong&gt;: Always Encrypted columns for sensitive data protection&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;2. Access Control and Authentication&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Principle of Least Privilege&lt;/strong&gt;: Grant necessary privileges only. Do not provide database users or roles more privileges than are necessary&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strong Authentication&lt;/strong&gt;: Multi-factor authentication, Kerberos integration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database Vault&lt;/strong&gt;: Separation of duties for privileged users&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Virtual Private Database (VPD)&lt;/strong&gt;: Row-level security policies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;3. Activity Monitoring and Auditing&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unified Auditing&lt;/strong&gt;: Comprehensive tracking of database activities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Real-time Monitoring&lt;/strong&gt;: Immediate detection of suspicious activities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compliance Reporting&lt;/strong&gt;: Automated generation of audit trails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database Firewall&lt;/strong&gt;: Real-time protection against SQL injection attacks&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;security-zones-of-control&quot;&gt;Security Zones of Control&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Assess&lt;/strong&gt;&lt;br&gt;
Continuously evaluate your database's current security state through automated assessments and vulnerability scans.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Detect&lt;/strong&gt;&lt;br&gt;
Identify attempts to access data outside established policies using advanced analytics and machine learning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prevent&lt;/strong&gt;&lt;br&gt;
Block unauthorized access attempts that bypass database control mechanisms through real-time protection.&lt;/p&gt;
&lt;h4 id=&quot;establishing-baseline-security-posture&quot;&gt;Establishing Baseline Security Posture&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;1. System State Assessment&lt;/strong&gt;&lt;br&gt;
Regularly evaluate database configurations against security benchmarks and industry standards.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Security Patch Management&lt;/strong&gt;&lt;br&gt;
Oracle releases Critical Patch Updates quarterly to address security vulnerabilities. Implement automated patch management processes to ensure timely updates.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Comprehensive Database Auditing&lt;/strong&gt;&lt;br&gt;
Monitor all database connections, privileged operations, and data access patterns to establish behavioral baselines.&lt;/p&gt;
&lt;h4 id=&quot;oracle-security-tools-and-services&quot;&gt;Oracle Security Tools and Services&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Oracle Data Safe&lt;/strong&gt;&lt;br&gt;
Oracle Data Safe helps assess your security posture, close gaps that may result in noncompliance, and generate reports to share with auditors. Key capabilities include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security Assessment&lt;/strong&gt;: Updated with additional checks from Oracle Database 19c CIS Benchmark v1.2 and STIG V2R8&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Discovery&lt;/strong&gt;: Automated identification of sensitive data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Masking&lt;/strong&gt;: Replace sensitive data with realistic, yet obscured, data for safe use in nonproduction environments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Activity Auditing&lt;/strong&gt;: Comprehensive user and privilege monitoring&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Database Security Assessment Tool (DBSAT)&lt;/strong&gt;&lt;br&gt;
Oracle Database Security Assessment Tool provides prioritized recommendations on how to mitigate identified security risks or gaps within Oracle Database. Currently in version 3.1.0 (January 2024), DBSAT is a command-line tool focused on detecting potential security vulnerabilities across database, operating system, and network components.&lt;/p&gt;
&lt;h3 id=&quot;oracle-maximum-availability-architecture-maa-&quot;&gt;Oracle Maximum Availability Architecture (MAA)&lt;/h3&gt;
&lt;p&gt;Oracle Maximum Availability Architecture (MAA) provides architecture, configuration, and lifecycle best practices for Oracle Databases and applications, enabling high-availability service levels for databases and applications residing in on-premises, cloud, or hybrid configurations.&lt;/p&gt;
&lt;h4 id=&quot;core-maa-objectives&quot;&gt;Core MAA Objectives&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;High Availability&lt;/strong&gt;&lt;br&gt;
Provides redundant components and automated failover mechanisms to ensure uninterrupted service during hardware failures, planned maintenance, and other disruptions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt; &lt;br&gt;
Ensures consistent performance as application usage grows, automatically scaling resources to meet demand without degrading user experience.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rolling Updates and Patches&lt;/strong&gt;&lt;br&gt;
Minimizes planned maintenance downtime through online patching and rolling upgrade capabilities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Disaster Recovery&lt;/strong&gt;&lt;br&gt;
Protects against complete site outages through geographically distributed backup sites and automated recovery procedures.&lt;/p&gt;
&lt;h4 id=&quot;key-performance-metrics&quot;&gt;Key Performance Metrics&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Recovery Point Objective (RPO)&lt;/strong&gt;&lt;br&gt;
Measures acceptable data loss in time units. Modern MAA implementations can achieve near-zero RPO through synchronous replication.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Recovery Time Objective (RTO)&lt;/strong&gt;&lt;br&gt;
The key goal of Oracle MAA is to meet recovery time objectives (RTO) by minimizing system downtime during failures and recovery operations.&lt;/p&gt;
&lt;h4 id=&quot;chaos-engineering-and-resilience-testing&quot;&gt;Chaos Engineering and Resilience Testing&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Proactive Failure Testing&lt;/strong&gt;&lt;br&gt;
Intentionally introduce controlled failures to validate system resilience and identify potential weaknesses before they impact production.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Failure Scenarios&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Network, server, and storage component failures&lt;/li&gt;
&lt;li&gt;Human errors and data corruption incidents&lt;/li&gt;
&lt;li&gt;Power outages and complete site failures&lt;/li&gt;
&lt;li&gt;Data reorganization and schema changes&lt;/li&gt;
&lt;li&gt;Application bugs and performance degradation&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;maa-technology-stack&quot;&gt;MAA Technology Stack&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Real Application Clusters (RAC)&lt;/strong&gt;&lt;br&gt;
Provides horizontal scalability and high availability through clustered database instances sharing the same storage.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Oracle Active Data Guard&lt;/strong&gt;&lt;br&gt;
Oracle Active Data Guard adds high availability (HA) and disaster recovery (DR) capabilities to an Oracle Database through real-time data replication and automatic failover.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key MAA Capabilities&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Optimal High Availability&lt;/strong&gt;: Automated failover with minimal downtime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Protection&lt;/strong&gt;: Multiple levels of data redundancy and backup&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Active Replication&lt;/strong&gt;: Real-time synchronization across sites&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scale-Out Architecture&lt;/strong&gt;: Horizontal scaling capabilities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application Continuity&lt;/strong&gt;: Transparent recovery for application connections&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;oracle-cloud-database-services&quot;&gt;Oracle Cloud Database Services&lt;/h3&gt;
&lt;h4 id=&quot;service-portfolio&quot;&gt;Service Portfolio&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Oracle Cloud Database:&lt;/strong&gt; Traditional database services with full administrative control and customization options.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Oracle Exadata Database Service:&lt;/strong&gt; High-performance database platform optimized for Oracle workloads with built-in MAA features.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Oracle Autonomous Database:&lt;/strong&gt; Fully automated, standardized Autonomous Database infrastructure means that achieving robust availability and disaster recovery for your mission-critical applications is built into the service foundation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;cloud-maa-benefits&quot;&gt;Cloud MAA Benefits&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Automated Operations&lt;/strong&gt;&lt;br&gt;
Self-healing, self-securing, and self-tuning capabilities reduce operational overhead and human error risks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Global Distribution&lt;/strong&gt;&lt;br&gt;
Multi-region deployment options for optimal disaster recovery and performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Elastic Scaling&lt;/strong&gt;&lt;br&gt;
Dynamic resource allocation based on workload demands without manual intervention.&lt;/p&gt;
&lt;h3 id=&quot;implementation-best-practices&quot;&gt;Implementation Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;security-implementation-strategy&quot;&gt;Security Implementation Strategy&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Risk Assessment&lt;/strong&gt;: Conduct thorough security assessments using Oracle Data Safe and DBSAT&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Defense in Depth&lt;/strong&gt;: Implement multiple security layers rather than relying on single controls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Continuous Monitoring&lt;/strong&gt;: Establish real-time monitoring and automated response procedures&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regular Updates&lt;/strong&gt;: Maintain current security patches and configuration updates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compliance Validation&lt;/strong&gt;: Regular compliance checks against industry standards and regulations&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;maa-implementation-approach&quot;&gt;MAA Implementation Approach&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Architecture Planning&lt;/strong&gt;: Design for your specific RTO/RPO requirements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Redundancy Strategy&lt;/strong&gt;: Implement appropriate levels of redundancy across all tiers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Testing Protocol&lt;/strong&gt;: Regular disaster recovery and failover testing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitoring and Alerting&lt;/strong&gt;: Comprehensive observability across all components&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: Maintain detailed runbooks and recovery procedures&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;integrated-security-and-availability&quot;&gt;Integrated Security and Availability&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Unified Management&lt;/strong&gt;&lt;br&gt;
Use Oracle Enterprise Manager or OCI Console for centralized management of both security and availability features.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Automated Responses&lt;/strong&gt;&lt;br&gt;
Implement automated security incident response that considers availability requirements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compliance Integration&lt;/strong&gt;&lt;br&gt;
Ensure high availability solutions meet regulatory compliance requirements for data protection and audit trails.&lt;/p&gt;
&lt;h3 id=&quot;future-proofing-your-oracle-environment&quot;&gt;Future-Proofing Your Oracle Environment&lt;/h3&gt;
&lt;h4 id=&quot;emerging-technologies&quot;&gt;Emerging Technologies&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Machine Learning Integration&lt;/strong&gt;&lt;br&gt;
Oracle's ML capabilities enhance both security (anomaly detection) and availability (predictive maintenance).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Container and Kubernetes Support&lt;/strong&gt;&lt;br&gt;
Modern deployment patterns with built-in resilience and security features.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Multi-Cloud Strategies&lt;/strong&gt;&lt;br&gt;
Build Multicloud Networks for Business continuity using Oracle's hybrid cloud capabilities.&lt;/p&gt;
&lt;h4 id=&quot;continuous-improvement&quot;&gt;Continuous Improvement&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Regular Architecture Reviews&lt;/strong&gt;&lt;br&gt;
Periodic assessment of MAA implementations against evolving business requirements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Security Posture Evolution&lt;/strong&gt;&lt;br&gt;
Continuous enhancement of security controls based on threat landscape changes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Performance Optimization&lt;/strong&gt;&lt;br&gt;
Ongoing tuning of both security and availability components for optimal performance.&lt;/p&gt;
&lt;h3 id=&quot;conclusion-4&quot;&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Building resilient Oracle database environments requires a holistic approach that integrates security and availability from the ground up. Oracle considers cloud security its highest priority, and the security responsibilities are shared between Oracle and you.&lt;/p&gt;
&lt;p&gt;By implementing Oracle's Maximum Availability Architecture alongside comprehensive security controls, organizations can achieve:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;99.99%+ uptime&lt;/strong&gt; through redundant, self-healing infrastructure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enterprise-grade security&lt;/strong&gt; that meets the most stringent compliance requirements  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated operations&lt;/strong&gt; that reduce human error and operational overhead&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Future-ready architecture&lt;/strong&gt; that scales with business growth&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The combination of Oracle Data Safe, MAA best practices, and cloud-native services provides a robust foundation for mission-critical applications that demand both maximum security and availability.&lt;/p&gt;
&lt;p&gt;Whether you're running traditional on-premises environments, hybrid configurations, or fully cloud-native deployments, Oracle's integrated approach ensures your data remains secure, available, and performant under all conditions.&lt;/p&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/5275/building-resilient-oracle-databases-essential-strategies-security-maximum-availability</guid>
<pubDate>Wed, 10 Sep 2025 16:52:51 +0000</pubDate>
</item>
</channel>
</rss>