惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
U
Unit 42
H
Help Net Security
博客园_首页
雷峰网
雷峰网
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Recorded Future
Recorded Future
aimingoo的专栏
aimingoo的专栏
爱范儿
爱范儿
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Cloudflare Blog
S
Security @ Cisco Blogs
M
MIT News - Artificial intelligence
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
Spread Privacy
Spread Privacy
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
K
Kaspersky official blog
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
C
CERT Recently Published Vulnerability Notes
V
Vulnerabilities – Threatpost
WordPress大学
WordPress大学
C
Cisco Blogs
G
Google Developers Blog
N
News and Events Feed by Topic
P
Palo Alto Networks Blog
Apple Machine Learning Research
Apple Machine Learning Research
Schneier on Security
Schneier on Security
博客园 - 聂微东
Security Latest
Security Latest
Security Archives - TechRepublic
Security Archives - TechRepublic
O
OpenAI News
云风的 BLOG
云风的 BLOG
IT之家
IT之家
PCI Perspectives
PCI Perspectives
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
小众软件
小众软件
Scott Helme
Scott Helme
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 最新话题
Microsoft Azure Blog
Microsoft Azure Blog
Simon Willison's Weblog
Simon Willison's Weblog
N
News and Events Feed by Topic
F
Fortinet All Blogs
The Last Watchdog
The Last Watchdog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How a 2.8ms Network Delta Nearly Broke Our 7 TB Oracle to Amazon RDS Migration
Pavan Bhatia · 2026-05-29 · via DEV Community

Cross-posted from my infrastructure postmortem series at pavanbhatia.hashnode.dev.

At 1:40 AM on Sunday, our 7 TB Oracle-to-Amazon RDS migration was on the verge of collapse.

Database CPU utilization was sitting below 15%, storage I/O looked healthy, and application logs showed zero errors—yet user-facing latency had spiked by nearly 800%. Our final User Acceptance Testing (UAT) validation had ground to a complete halt. We had under four hours before morning business operations resumed and transactional traffic spiked.

As the lead cloud architect steering this cutover, I was looking at a rapidly closing maintenance window. We had to decide whether to continue troubleshooting live under intense time pressure or abort the cutover and execute a disciplined rollback.

What failed that night wasn't Oracle. It was years of hidden assumptions our on-premises architecture had quietly protected us from. Here is the operational breakdown of how we isolated our network constraints, executed a controlled rollback, and ultimately uncovered the real-world cost of cloud network round-trips.


The Data Pump Concurrency Bottleneck

Our initial staging runs with Oracle Data Pump (impdp) showed that the 7 TB data payload was tracking toward a 24-hour import window. In a strict 48-hour cutover timeline, spending half of our entire allocation moving raw bytes was terrifying. It left zero margin for validation, error remediation, or a clean rollback if things went sideways.

Vertical scaling did not solve the bottleneck; the issue was process- and I/O-level concurrency. We provisioned a memory-optimized RDS instance class and maximized storage IOPS, but the import throughput remained unchanged. To find the stall, we pulled an Automatic Workload Repository (AWR) report during the import run.

The metrics told us something critical immediately: compute wasn't the bottleneck. The import workers were completely serializing around index and constraint operations while the database sat mostly idle.

Top User Latency Wait Events

Event                          Waits    Avg Wait  % DB time
---------------------------  ---------  --------  ---------
db file sequential read       4,120,500    3.6ms      52.4%
resmgr:cpu quantum             842,110     3.7ms      11.0%
SQL*Net message from client   9,104,220    0.2ms       8.0%

Enter fullscreen mode Exit fullscreen mode

We refactored our ingestion pipeline to focus on schema deconstruction rather than raw hardware scaling:

  • Parallelism Tuning: We increased the parallel workers incrementally during test runs until throughput plateaued efficiently around 32 workers.
  • Schema Deconstruction: We ran an initial import execution with index and constraint exclusions (EXCLUDE=INDEX,CONSTRAINT), allowing flat tables to ingest via rapid, direct loads. We deferred all foreign keys and constraints to be validated later.
  • Concurrent Indexing: Once the raw data rows were loaded, we executed a multi-threaded script to rebuild indexes and constraints concurrently.

🎉 The Result

Total import time dropped from 24 hours to 8 hours and 12 minutes—a 66% performance gain that secured our ingestion window.


In-Flight Infrastructure: Catching the IaC Deadlock

With data ingestion optimized, we used subsequent test cycles to validate our infrastructure-as-code (IaC) deployment via Terraform. The automated pipeline consistently failed when attempting to provision our secondary read replica.

Our pipeline threw a generic AWS API InvalidDBInstanceState error, stating that the primary database was not in an available state to spin up a replica. Digging into the RDS engine events, we discovered that Oracle's MAX_STRING_SIZE parameter was the culprit. We had set it to EXTENDED to support 32,767-byte columns in our legacy schema.

Enabling EXTENDED requires the database instance to boot in upgrade mode and execute internal data dictionary conversion scripts (utl32k.sql). Terraform's default concurrency created a race: the replica was being created before the primary had finished its upgrade.

What finally exposed the issue was noticing the primary instance repeatedly entering an internal upgrade state while Terraform simultaneously attempted replica creation. To bypass this timing limitation, we modified our deployment runbook into a two-phase execution:

  1. Phase 1: We bootstrapped the cluster resources with a baseline parameter group utilizing the default STANDARD string setting, allowing the AWS API to establish the replication topology successfully.
  2. Phase 2: Once the resources were registered in our Terraform state file, we ran a targeted pipeline execution to apply the EXTENDED parameter group to the primary database alone.

The secondary replica automatically inherited and synchronized the data dictionary upgrades from the primary instance over the wire, stabilizing our deployments and removing the parallel provisioning race condition.


The Cutover Crisis: The 2.8ms Network Tax

The real failure surfaced during our live cutover validation. Our testing showed immediate performance degradation on our core dashboards, measured as P95 end-to-end API latency at the API gateway.

For about 20 minutes, the war room was convinced our AWS Direct Connect link was saturating under validation load, which briefly sent our investigation down a rabbit hole of network packet analysis. However, once we looked at the application traces, the true bottleneck emerged.

The issue was not inside the Oracle engine; it was the physical distance between our remaining on-premises application tier and the new cloud environment.

[On-Prem App Tier] ---> (0.4ms RTT) ---> [On-Prem Legacy Oracle]
[On-Prem App Tier] ---> (3.2ms RTT via Direct Connect) ---> [AWS RDS Oracle]

Enter fullscreen mode Exit fullscreen mode

On-premises, our application servers and the legacy Oracle hardware shared the same local data center fabric, yielding a network Round-Trip Time (RTT) of 0.4ms. Moving the database to Amazon RDS via AWS Direct Connect introduced a hybrid network hop, increasing that RTT to 3.2ms.

A delta of 2.8ms appears negligible on an architectural diagram. In production, it exposed a critical design debt: our application assumed instant, local-fabric latency and had been optimized for throughput, not efficiency.

💡 Key Realization: The cloud network link wasn't the constraint. Our query amplification was.


1. The Read Bottleneck (N+1 Query Chattiness)

Many of our core user dashboards relied on un-batched, sequential loops that executed thousands of individual SELECT queries to render a single interface view. For every user request, our dashboard looped over a list of items, firing one SELECT per item instead of a single IN-clause query.

The math broke our performance requirements:

  • On-Premises Latency: 4,800 queries × 0.4ms RTT = 1.92 seconds network overhead
  • AWS Cloud Latency: 4,800 queries × 3.2ms RTT = 15.36 seconds network overhead (Resulting in a monitored P95 response of 6.1 seconds)

The database completed each query quickly, but spent the remainder of its cycles waiting for the application layer to receive the payload and request the next record over the network link.


2. The Write Bottleneck (Sequence Fetch Allocation)

Unfortunately, the read path was only half the problem. The network tax similarly paralyzed our bulk data-entry processes.

The culprit was our legacy ORM primary key configuration, which utilized an Oracle sequence with an allocation size of 1 (INCREMENT BY 1). On-premises, the local fabric completely masked the fact that the application was making a dedicated network round-trip to ask the database for a new ID sequence number for every single row before executing the corresponding INSERT.

Over the 3.2ms cloud link, inserting 5,000 records forced 10,000 sequential round-trips (5,000 sequence fetches + 5,000 inserts), translating to over 30 seconds of pure network wait time per batch.

Modifying ORM behavior and data-access loops under that intense time pressure would have violated our change-control policy and risked data corruption. I made the call to abort the cutover and run a controlled rollback.


The Reverse Oracle GoldenGate Safety Net

Because this entire validation loop was executed within our isolated testing environment, production data remained completely untouched. However, the simulation proved that our fallback mechanics were sound.

We ran Oracle GoldenGate in reverse: data changes flowed continuously from AWS RDS back to the on-premises database, keeping it configured as a live, active backup. Dropping back to on-premises during this window was entirely seamless. By 5:00 AM Sunday, we had safely rerouted testing traffic back to the legacy database. The fallback process was fully automated, with zero data loss and no disruption to our ongoing business operations.

We spent the subsequent workweek executing targeted application code fixes:

  • Query Batching: We refactored three key endpoints, replacing nested loops with batched SELECTs. This consolidated our 4,800 iterative, single-record queries into 300 single batched SQL queries using IN clauses. Dashboard latency dropped from 4.5 seconds down to under 400ms under identical workloads.
  • JDBC Fetch Tuning: We bumped the default Oracle JDBC driver fetch size from its conservative default up to 100. This ensured that when the database processed one of our 300 consolidated batch queries, the entire dataset was returned to the application server in a single round-trip.
  • Sequence Refactoring: We updated our sequence definitions to allocate IDs in batches (INCREMENT BY 50) and aligned our ORM generators accordingly. This enabled HiLo ID generation, allowing the application server to pull a pool of IDs in a single wire trip and assign them to rows entirely in-memory—reducing primary-key network requests by two orders of magnitude.

The following Saturday, we initiated the cutover again. The dashboard loops that had previously fired 4,800 sequential requests now fired a clean combined total of 350 net round-trips. After the fixes, our 5,000-record batch inserts completed in under 2 seconds instead of 30+.

We completed validation ahead of schedule and were fully live by 3:00 AM with no application performance bottlenecks. Our monitored user-facing P95 response time fell from 6.1 seconds to a crisp 900ms.


Post-Go-Live Validation & The Real-World Failover

To mitigate the risk of an unforeseen infrastructure failure during our first week in the cloud, we kept our reverse Oracle GoldenGate replication pipeline active for two weeks. This ensured that our decommissioned on-premises database remained an up-to-the-second replica of our production cloud environment, providing an immediate fallback option if a critical defect surfaced.

Three weeks after go-live, we got the validation every migration team quietly fears: a real infrastructure failure.

An Amazon EventBridge rule captured an RDS infrastructure event notification indicating that the primary instance in the active Availability Zone (AZ) had encountered a hardware fault. This triggered an automated RDS Multi-AZ failover, promoting the standby instance in the secondary AZ to primary.

Because our application connection pools recycled cleanly, the secondary instance assumed the active workload within two minutes. CloudWatch alarms and synthetic checks confirmed zero impact on user performance. We had successfully survived a production database failure in the cloud with zero downtime—prompting us to permanently decommission the legacy on-premises synchronization.


Real-World Outcomes

Six months after that second cutover weekend, the system processes over 12 million database transactions per day. Moving to Amazon RDS for Oracle eliminated our legacy hardware maintenance overhead, and after the application-side optimizations, overall end-to-end P95 latency is now 35% faster than our previous on-premises baseline.

We spent months planning storage throughput, replication pipelines, rollback mechanics, and failover scenarios. In the end, the migration nearly failed because our application had been built around a network assumption nobody realized existed until the database moved 40 miles away.

Every migration exposes a different constraint. Ours exposed latency amplification, ORM query chattiness, and infrastructure sequencing failures that our on-premises environment had masked for years. The most important lesson wasn't the specific Oracle or AWS tuning itself—it was validating architectural assumptions early enough that rollback remained controlled when those assumptions broke.


Thanks for reading!

If you enjoyed this infrastructure breakdown, follow me here on DEV.to for more deep-dives into real-world production failures and cloud architecture.

You can also find me on LinkedIn to discuss distributed systems and large-scale AWS migrations.