Bee, an Amazon company, is a personal artificial intelligence (AI) device you wear. It listens to your day, understands what happened, and remembers the commitments and ideas you would otherwise lose. Bee uses that understanding to give you help that’s tailored to your life. With Bee, you can:
Get summaries of important conversations and moments.
Recall past interactions when you need them.
Capture commitments and follow-ups from meetings and client conversations.
Spot patterns in your routines and relationships.
Gain meaningful insights about your day.
To deliver these experiences, Bee handles conversations about health, finances, and family, some of the most personal parts of users’ lives. Bee securely manages this sensitive data so that it always remains protected. Bee built an architecture with no mechanism for operators (Bee engineers, other Amazon employees, and AWS infrastructure operators) to access customer data. Bee’s own controls cover the first two groups, and protection from AWS infrastructure operators is inherited from the AWS Nitro System. Bee calls this Zero Operator Access (ZOA). In this post, we show how Bee does all of this and share the AWS building blocks used to achieve ZOA.
Solution overview
The AWS shared responsibility model describes security as two domains: security of the cloud, which AWS is responsible for, and security in the cloud, which is the customer’s responsibility. AWS operator access controls are designed so that AWS personnel have no technical pathway to customer data. Bee applies the same principle to its own operators, Bee engineers and other Amazon employees. That means hardening every layer of the stack.
Bee’s core control is EC2 instance attestation: A user’s device releases the keys needed to decrypt their data only to instances running software it has verified. Attestation proves what runs inside an instance, but it can’t measure what surrounds it, such as which networks the instance can reach or who can change account permissions. So, Bee paired attestation-gated key release with network, storage, and organizational controls that close the paths attestation can’t measure. Figure 1 shows how these controls fit together. The sections that follow walk through each one.
Figure 1: Bee’s Zero Operator Access architecture on AWS
Build time
A transparency service, run by a separate Amazon team that Bee doesn’t control, keeps a copy of every approved Amazon Machine Image (AMI), container, and model for later audits. It publishes the expected measurements for each approved deployment to Sigstore Rekor, a public transparency log.
The attestable AMI is shared to the Bee account, and the transparency proofs are stored in Amazon Simple Storage Service (Amazon S3).
At boot, each instance records what it’s running in NitroTPM. It then gets a TLS certificate from AWS Private Certificate Authority (AWS Private CA) with its attestation and transparency proofs embedded. The Bee app checks this certificate before it shares any keys. If the software has changed, the app refuses to connect.
Runtime
The Bee mobile app only connects to an attested instance over TLS.
The instance presents its certificate. The app verifies the attestation against the AWS Nitro root and the transparency log.
Only if they match does the app release a short-lived key. The key exists only in memory in the app servers and Redis key stores. Inference servers never receive keys.
The first problem Bee had to solve was trust. A user’s device needs to verify that Bee’s servers booted only with the approved software. That verification requires evidence rooted in a trusted mechanism outside the server application itself. Bee uses EC2 instance attestation to provide signed measurements of the instance’s boot software.
Bee builds its base images with an internal, hardened pipeline that produces attestable AMIs for Amazon Elastic Compute Cloud (Amazon EC2). During the build, the pipeline computes reference measurements offline from the Unified Kernel Image (UKI) and the Secure Boot configuration. These are the expected values for platform configuration registers (PCRs), which record cryptographic measurements during boot. Bee uses PCR4, PCR7, and PCR12 as verification targets. Because these values are computed without booting the image, Bee knows the expected measurements before any instance launches.
No interactive access. The image includes no SSH, SSM, or shell, so operators have no path into a running instance.
Only trusted software. The image contains only the components the workload needs, and every component is measured.
Read-only file system and ephemeral local storage. The root filesystem is read-only. Local instance storage is encrypted with a key held only in memory, and instances are replaced rather than rebooted, so no data outlives the instance.
At runtime, the bootloader and operating system measure the boot components and extend those measurements into NitroTPM PCRs. NitroTPM provides an attestation document containing the resulting values, signed by the AWS Nitro System through the AWS Nitro Attestation PKI. Any verifier can check these values against the approved reference measurements. With the same measured boot components and configuration, the selected PCR values remain consistent, making them suitable for remote verification.
Extend the chain of trust to your containers and data
A trusted OS is necessary but not sufficient because Bee’s application containers and model weights can change independently of the AMI. If an unauthorized user could swap a container image or a model file without detection, the attestation document would still show clean boot measurements even though the workload had been altered.
Bee solves this with a custom measured boot tool that runs before any application container starts. It resolves each Docker image in the manifest to its immutable Amazon Elastic Container Registry (Amazon ECR) digest. It also retrieves each Amazon Simple Storage Service (Amazon S3) artifact’s SHA-256 checksum. It computes a deterministic hash across the manifest, all container digests, and all artifact checksums, then extends NitroTPM PCR14 with this value. Any change to any container image, model weight, or the manifest itself produces a different PCR14 and a different attestation document.
Critically, PCR14 is extended before the NitroTPM attestation document is obtained. The attestation document that Bee’s application servers present to clients therefore reflects both the OS state (PCR4, PCR7, PCR12) and the workload state (PCR14) as a single signed hardware measurement.
Before deployment, the transparency service runs an independent signing process. It resolves the same ECR digests and S3 checksums, recomputes the expected PCR14, and commits the full PCR map to Sigstore/Rekor, an independent, publicly auditable transparency log. The resulting proof bundle is stored in regionally replicated S3 buckets so that verification at boot time is fully offline, with no runtime dependency on external infrastructure.
Validate attestation at every connection
At boot, the instance first confirms that its own measurements match the approved entry in the transparency log. If they don’t, it stops there. If they match, it requests a TLS certificate from AWS Private CA, with its attestation document and transparency proof embedded in the certificate. The attestation is tied to that certificate’s key, so it can’t be reused by another instance.
The user’s device decides whether to trust the instance. When it connects, it checks the embedded evidence offline against roots built into the app, including the AWS Nitro root. If the measurements don’t match an approved configuration, the client rejects the connection and shares no keys.
The same certificates protect traffic between instances over mutual TLS. Only roles that need to start connections, such as application servers, receive client certificates. Inference instances don’t, so they can’t reach key stores or other services.
Limit what the network can reach
All attested EC2 instances run in isolated subnets of an Amazon Virtual Private Cloud (Amazon VPC) with no internet egress. The only outbound paths are VPC endpoints to Amazon Relational Database Service (Amazon RDS), Amazon ElastiCache, and tightly scoped AWS Lambda functions. These functions handle external integrations such as email or push notifications. Lambda functions receive only data already encrypted with user keys. They never see plaintext.
Keep encryption keys out of persistent storage
Users’ encryption keys originate on their devices. After verifying an instance’s attestation, the device releases a short-lived, scoped key to that instance. The key exists only in memory, in the application instance and in Redis key stores running inside attested instances with persistence disabled. It expires after 7 days without user activity. Because AWS never holds this key, no storage layer, backup, IAM policy, or KMS grant can provide access to it.
Sensitive data is encrypted inside the attested instance before it reaches Amazon RDS, Amazon ElastiCache, or Amazon S3, so those services store only ciphertext. Plaintext stays inside the attested boundary. For the full key hierarchy and data flow, see the Bee Private Compute whitepaper.
Use AWS organizational controls to eliminate unilateral access
Strong technical controls also need strong permission boundaries. If one person could change those controls, they could be bypassed. Bee is designed so that no single team can do this. The Bee team manages the private CA and the deployment pipeline but doesn’t control the transparency service. The transparency team can commit entries to the Sigstore log but has no access to Bee’s AWS accounts. Deploying code that doesn’t appear in the public transparency log would require coordination across independent teams.
AWS Service Control Policies (SCPs) back this separation at the infrastructure level. SCPs apply across all Bee accounts, limit which actions are possible in each account, and need multiple levels of approval to change. This makes the separation of duties enforceable in AWS itself, not only through process. SCPs add defense in depth. The primary safeguard is still attestation: Any change to the software changes its measurements, and the Bee app refuses to connect to software it doesn’t recognize.
Conclusion
In this post, we showed how Bee implemented Zero Operator Access for personal AI on AWS. Users hold their own keys, so they decide who can read their data. Before the Bee app shares a key, it checks that the server is running approved, publicly logged software, and no operator or policy can override that check. Amazon EC2 instance attestation makes that check verifiable. Network isolation, ephemeral storage and organizational controls close the paths attestation can’t measure.
Next, Bee is moving its inference to Amazon Bedrock Mantle, which provides zero operator access as a managed capability. User-held keys and attested application servers will stay part of the Bee architecture, so data stays protected from Bee operators.
You can apply the same pattern to any workload that handles sensitive data. To get started:
If your sensitive workloads run in containers, AWS Nitro Sandboxes give each Amazon EKS pod, Amazon ECS task, or Amazon EC2 workload its own hardware-isolated VM, with attestation and zero operator access built in.
When the Cognition team set out to give Devin, their AI software engineer, the ability to build Apple apps, they ran into a basic requirement: Devin needed a Mac. The process of building, testing, and signing apps for iPhone, iPad, and Mac requires both Apple hardware and macOS, regardless of who (or what) writes the code, which was not supported until a couple months ago. To give Devin access to a Mac development environment, Cognition now runs macOS environments on Amazon Elastic Compute Cloud (Amazon EC2) Mac instances. With access to cloud-based Macs, Devin can build an iOS app, run it in the iOS Simulator, and check how it behaves all before it hands back a merge-ready change.
Within six weeks of launch, nearly 1,000 organizations were running Devin on macOS, according to Cognition. Cognition starts a fresh macOS virtual machine (VM) for each Devin session in under a minute, using a fleet of EC2 Mac hosts across six AWS Regions. By Cognition’s estimate, that startup time puts customers into a working macOS environment 15–20 times faster than setting up a Mac host themselves.
This post explains why Devin needed its own Mac, how Cognition built Devin workspaces on EC2 Mac, and how to plan a macOS fleet for AI agents or automated testing.
Why an AI coding agent needs its own Mac
Prior to this launch, Devin Cloud ran sessions only on Linux and Windows VMs. Devin could write Swift code and syntax in those sessions, but without macOS and Xcode it couldn’t run or test the app, so it depended on a customer’s continuous integration (CI) system or the customer’s own Mac fleet to build and test. Even then, simply having a successful build doesn’t show whether the app behaves correctly. One example of testing behavior is where an iPhone game is designed to resume where the player paused it, even after the app closes; in order to check that behavior, a software development agent has to play the game, pause it, quit, relaunch, and confirm the saved state.
You can virtualize macOS, but a Devin workspace needs more than just a bootable virtual operating system environment. Cognition needed each macOS workspace to provide the same properties as its other cloud workspaces:
A disk that keeps the work of a session, so an idle session doesn’t keep a VM running.
Network access that follows the access rules of the session.
A development environment that is ready before Devin starts.
A way for both the user and Devin to see and operate the running app.
Why Cognition chose AWS
Cognition required macOS machines to scale Devin beyond Linux and Windows, but sought to avoid the overhead of buying, racking, and maintaining physical Mac computers. The following properties of EC2 Mac shaped the Cognition design:
Apple silicon hardware in the cloud: Each EC2 Mac instance is a physical Mac mini or Mac Studio attached to the AWS Nitro System, so Cognition can run the Apple Virtualization framework on EC2 Mac the same way it would on an on-premises Mac.
Capacity through an API: Cognition allocates Dedicated Hosts and launches Mac instances with the Amazon EC2 API, instead of ordering and shipping machines.
Regions around the world: EC2 Mac is available in multiple AWS Regions, and Cognition runs in six of them.
Cognition builds Devin macOS workspaces on EC2 Mac instances, which run as bare metal instances on Amazon EC2 Dedicated Hosts. Available with Apple silicon, these instances are built on Apple Mac computers and the AWS Nitro System.
Each EC2 Mac instance runs on its own Dedicated Host, which has a minimum allocation period of 24 hours, so Cognition separates the life of a Devin session from the life of a host. In Regions where they don’t have preallocated capacity, Cognition uses an Amazon EC2 Auto Scaling group to allocate and release Dedicated Hosts.
On each host in its fleet, a Cognition VM manager uses the Apple Virtualization framework to run macOS guest VMs from images that Cognition prepares and manages. Each bare metal EC2 Mac host runs two isolated Devin workspaces at a time, because the macOS Software License Agreement (SLA) (SLA) allows up to two additional copies of macOS in virtual operating system environments on each Mac, a limit macOS enforces. Idle Devin sessions release their VMs for other Devin sessions to use, so a singular host is able to serve multiple Devin sessions a day.
Figure 1 shows how one EC2 Mac Dedicated Host serves Devin sessions. The host runs a bare metal Mac instance in one of the six AWS Regions in the Cognition fleet, with one guest VM per active session. Each guest runs Xcode tools and the iOS Simulator with the app under test, plus a live view and an accessibility tree from accessibility-cli. The user’s browser exchanges video and input with the live view, and the Devin agent queries and acts on the accessibility tree.
On the host, the VM manager runs the guests with the Virtualization framework, while a snapshot process with a Network Block Device (NBD) frontend handles disk I/O for each guest and exchanges snapshots with snapshot storage. The Devin agent and snapshot storage also run on AWS as Devin Cloud services inside the same Region, with Devin sessions hosted on Amazon EC2 and snapshots stored in Amazon Simple Storage Service (Amazon S3) (Amazon S3). For networking, a user-space Ethernet gateway takes Ethernet frames from a guest and passes IP packets to macOS packet filter (pf) rules and proxies, which apply the session access rules and send allowed traffic to the internet.
Figure 1: Devin macOS sessions on an Amazon EC2 Mac Dedicated Host
Keep session state with disk snapshots
Much of the work users do with Devin Cloud is asynchronous, and an idle session doesn’t need a running VM, so Cognition leverages the same snapshot system for macOS as its Linux VMs. The snapshot system runs as a separate process on the host and handles the VM’s disk reads and writes. Because the guest operating system sees only an ordinary virtual disk, the guest doesn’t need to know about snapshots.
On Linux, Cognition connects VMs to this storage process with vhost-user. The Virtualization framework doesn’t support vhost-user, but it does support NBD attachments, so Cognition added an NBD frontend to its snapshot system and kept the same storage design behind the new frontend. When a guest shuts down, the storage process keeps running to persist pending writes and upload the updated snapshot. The VM manager waits for the upload to finish before it completes cleanup, so stopping a session doesn’t interrupt the work that saves it.
Cognition reports that about 90% of sessions give up their Mac VM when idle and resume from a snapshot in seconds. On average, a session frees and reclaims its VM multiple times, so Mac capacity goes to active work, not idle sessions.
Apply network access rules with a user-space Ethernet gateway
Devin Cloud applies the access rules of each session to outbound traffic and blocks access to protected host infrastructure. The Virtualization framework offers three ways to connect a guest to the network: bridged networking, network address translation (NAT), and a file-handle attachment, which exchanges raw Ethernet frames over a local Unix datagram socket. NAT needs the least setup, but the Apple implementation also manages rules in pf, the macOS packet filter. Because Cognition also uses pf for its network controls, the two systems raced to configure the same filter.
Cognition chose the file-handle attachment instead and built its own Ethernet gateway to run in user space on the host, giving each Mac VM a separate gateway and its own session policy enforcement. Each Mac VM has its own gateway and its own session policy enforcement. The gateway answers Address Resolution Protocol requests from the guest and validates Ethernet addressing. It also checks that the source IP address of each packet matches the address assigned to the guest. The gateway then passes accepted IP packets into a tunnel interface on the host, where pf rules and proxies route the traffic and apply the access policy of the session.
Prepare guest images before the first boot
A Devin workspace needs more than a fresh macOS install: a user account, a usable desktop, Xcode tools, and the permissions Devin needs to observe and control apps. A fresh install asks for permissions such as accessibility and screen recording in dialogs, and each dialog would block Devin until a person approved it.
To avoid those dialogs, Cognition mounts the guest image disk on the host and prepares its state directly, creating the user and updating the macOS internal configuration databases so the permissions are in place before the guest boots. Cognition then boots the prepared image to install the remaining developer tools, verify Xcode, warm up the iOS Simulator, and let Spotlight indexing and other background setup finish. Cognition also turns off background services development sessions don’t need. With all this preparation done ahead of time, a new session can start building and testing as soon as its VM starts.
Give users a responsive live view of the app
Users can watch the macOS desktop in a Virtual Network Computing (VNC) view and their app in a new iOS Simulator pane in the Devin session. From either view, users can also try the app themselves and take control when they want.
Figure 2 shows a recorded Devin session from Cognition, in which Devin builds a 3D iPhone game and tests it in the iOS Simulator while the session’s Computer pane shows the macOS desktop.”
Figure 2: Devin builds and tests a 3D iPhone game on macOS. Video courtesy of Cognition
Two steps decide whether the live view responds fast enough for users to operate the app: capturing the screen and delivering the video. For the macOS desktop, ScreenCaptureKit, the Apple desktop capture API, supplies screen images from a limited pool of reusable buffers. When Cognition needs to keep the last captured image, it keeps its own copy instead of holding a pooled buffer, because holding a buffer while the screen is idle can delay the next screen change.
After capture, the desktop and Simulator video is encoded, sent to the user’s browser, and displayed. When one stage can’t keep up, frames wait between stages, and the stream can look smooth while it shows an old state of the app. In the iPhone game example, a user might press Pause and still see the game move, because the viewer is still showing frames from before the press. To keep the view current, Cognition limits how many frames can wait between stages and doesn’t replay a stale backlog.
Because compressed video frames often build on earlier frames, dropping a frame can leave the frames after it impossible to decode. A keyframe doesn’t depend on earlier frames, so the decoder can start fresh from it. When the Simulator stream falls behind, it restarts from a recent keyframe or asks for a new one and skips the missed frames. Keyframes are part of the compressed video stream, so they’re separate from the screen images Cognition copies at capture.
Let Devin operate native apps through the accessibility tree
Like users, Devin needs to see and operate the app, and it also needs an efficient way to check the result of each action. Devin does this through computer use, which in its simplest form takes a screenshot, has a model find a control in the image, clicks it, and takes another screenshot. This loop is slow and costly across the many pause, quit, and relaunch paths that Devin tests compared to web apps, where browser automation is more efficient. This is because the browser exposes the page structure, so Devin can find a named button or read a field’s value without working from pixels.
Native macOS apps and apps in the iOS Simulator run outside the browser, but they expose a structure of their own: the accessibility tree. Built for assistive technologies, the tree describes each control by its role, name, value, state, and relationships to other controls. Cognition exposes this tree to the Devin computer-use tool, so Devin can confirm that a control is a Resume button instead of guessing from pixels. Devin queries for a control, acts on the reference the query returns, and then reads the tree again to report what changed. The following exchange, adapted from Bringing macOS to Devin, shows a query for a Resume button and the press that follows.
Cognition built these capabilities on the open source accessibility-cli project from Dioxus, which is now part of Cognition. The project provides accessibility, input, and screen capture building blocks, and Devin turns them into the observe, reference, and act loop shown here. Even with the accessibility tree, Devin still relies on screenshots to check how the app looks. In the game example, a closed pause menu doesn’t prove the game restored the player’s position, because the app might draw gameplay directly instead of describing it in the tree.
Results
Cognition launched macOS support for Devin on September 15, 2026, and nearly 1,000 organizations were running Devin on macOS within six weeks. Devin no longer needs a customer’s CI system or Mac computers to build and test Apple apps, because it now builds, runs, and verifies iPhone, iPad, and Mac apps in its own cloud workspace. From that workspace, Devin also uploads builds to TestFlight, the Apple beta testing service.
“With Amazon EC2 Mac, we gave Devin macOS environments in the cloud, unlocking iOS and macOS development. Now customers can hand Devin platform-specific tasks such as building and testing iOS applications, without anyone managing Mac hardware. Our mac-m4pro.metal and mac-m4.metal fleet spans six regions, and we can mint fresh macOS VMs for Devin in under a minute.”
— Evan Almloff, Member of Technical Staff, Cognition
Wispr, which makes the Wispr Flow voice dictation app, uses Devin for macOS to test its iOS app end to end.
“At Wispr, a big part of testing our iOS app is making sure recording and transcription work end to end. The biggest blocker for us was end to end testing with Audio and Keyboard extension. With Devin’s macOS support, the pace of development has accelerated and it has given us more confidence in shipping features and triaging bugs. The velocity unlock is huge and cut down code review time by 70% and improved our velocity by nearly 2x.”
— Sumit Oberoi, Lead iOS Engineer, Wispr
Plan your own macOS fleet on EC2 Mac
The following points from the Amazon EC2 User Guide affect how you design a macOS fleet:
Each Dedicated Host runs one Mac instance, and you can release a host only after its 24-hour minimum allocation period.
Cognition gave Devin its own cloud Mac by running a fresh macOS guest VM for each session on Amazon EC2 Mac bare metal hosts. Disk snapshots, a user-space Ethernet gateway, prepared guest images, and accessibility-based control turn each VM into a workspace where Devin can build, run, and verify Apple apps.
Klaviyo (NYSE: KVYO) is an autonomous business-to-consumer (B2C) customer relationship management (CRM) platform used by more than 200,000 brands to understand and act on customer relationships in real time. Every personalized email, SMS, and push notification that Klaviyo sends depends on a streaming pipeline that ingests roughly 3 billion events per day. These events range from email opens and website visits to purchase completions and cart abandonments.
In this post, we share how Klaviyo migrated from RabbitMQ to Amazon Managed Streaming for Apache Kafka (Amazon MSK) Express brokers. We also show how Amazon MSK Express let a small team scale its event pipeline ahead of Black Friday/Cyber Monday (BFCM) 2025. With Amazon MSK Express, Klaviyo delivered more than 22.7 billion messages, up 25 percent year over year, and scaled back down afterward over a five-day period.
The challenge
Events are the lifeblood of Klaviyo’s platform. Every customer interaction flows through the streaming pipeline. Klaviyo’s previous RabbitMQ-based event infrastructure supported the platform through years of rapid growth. As volume climbed, scaling it beyond a certain point became increasingly difficult, so the team set out to build a foundation for the next stage of scale, with three requirements:
Absorb extreme bursts – BFCM drives roughly 7 times normal event volume, concentrated into five days.
Serve two service level objective (SLO) classes on one pipeline – Real-time triggers (5-second SLO) and analytics aggregates (20-minute SLO) share infrastructure, so slower work can never hold up time-critical events.
Zero data loss – Every event is a customer interaction that drives personalized marketing, so nothing can be silently dropped.
The replacement had to sustain peaks of 170,000 events per second, absorb a 7 times spike, and scale back down afterward.
Solution overview
Klaviyo rebuilt its event gateway infrastructure on Apache Kafka, choosing Amazon MSK Express brokers as its fully managed streaming backbone serving as the front door for all inbound events.
Figure 1: Klaviyo’s event gateway architecture on Amazon MSK Express, showing the gRPC publisher, p10/p20/p30 priority topics, the Kubernetes orchestrator, retry topics and dead-letter queue, Amazon S3 failure capture, and a second gateway cluster in eu-central-1
The solution includes the following key components:
Event gateway cluster – The entry point for all inbound events (email opens, clicks, site activity, API calls), running on express.m7g.4xlarge brokers in the US, with a second cluster in the EU.
Three-tier priority topics – Events are routed to priority topics (p10, p20, p30) with 360 partitions each. The partition count is set by the consumer topology rather than the broker count: the event orchestrator runs as StatefulSets with one pod per partition, which comes to 90 pods in each of four Kubernetes clusters and 360 pods in total.
Graduated retry architecture – Five retry delay levels with exponential backoff, plus a dead-letter queue, so no event is silently dropped.
Priority-based event processing
Rather than treating all events equally, Klaviyo routes events to priority tiers through a gRPC publisher proxy. This design degrades gracefully under extreme load. High-priority events (such as purchase confirmations that trigger transactional flows) are processed first, while lower-priority events (such as batch analytics updates) can tolerate higher latency.
Critically, Klaviyo runs one unified set of processors across all three priority levels instead of standing up separate infrastructure per level. That consolidation cut costs by roughly 30 percent through improved resource utilization. For the design in depth, see Building a Distributed Priority Queue in Kafka.
Resilient event publishing
Klaviyo designed its event publisher to survive failure at every layer. A publish that fails against one Kafka cluster has several fallback mechanisms to make sure that there will be no permanent data loss. Most failures recover automatically, and the rest are preserved for replay. Over one three-month window, roughly 20,000 events were recovered without human intervention, out of approximately 300 billion processed in that period.
Klaviyo also retains seven days of event history for replay in the case of downstream incidents.
The clearest demonstration of this architecture came during BFCM 2025, the largest ecommerce event of the year, when the pipeline carried the traffic behind Klaviyo customers’ most revenue-critical campaigns across five consecutive days.
The scale-out timeline
Period
Brokers
Context
Steady state (through September 2025)
12
Normal daily processing of ~3B events
Early October 2025
18
First capacity increase ahead of the holiday season
Late October–November 2025 (BFCM)
60
Full Black Friday / Cyber Monday capacity
December 2025 (post-BFCM)
18
Optimized steady-state fleet
The team scaled the event gateway cluster up several-fold over about seven weeks, held it through Cyber Monday, then scaled it back down in December.
Why MSK Express made this possible
Three capabilities of MSK Express were critical to making this operational with a lean team.
No storage provisioning – Express brokers remove storage sizing and provisioning entirely. You pay for the data ingested into the cluster and the data stored in it, per GB per hour, and all stored data is replicated across three Availability Zones for high availability. This pay-as-you-go model eliminates wasted capacity costs. For Klaviyo, it meant a large holiday scale-out required no storage capacity planning at all.
Intelligent Rebalancing – Adding brokers to an Apache Kafka cluster normally means redistributing partition data across the new brokers, which traditionally requires careful manual planning, monitoring, and throttle management. MSK Express Intelligent Rebalancing automates that redistribution without manual intervention or performance degradation, and AWS reports that Express brokers rebalance partitions 180 times faster than Standard brokers. For Klaviyo, this meant adding brokers at scale for BFCM without an engineer owning partition reassignment at scale.
Built-in high availability – Based on AWS internal testing, Express brokers recover from failure 90 percent faster than Standard brokers, thanks to storage improvements. A replacement node starts up with almost no disruption to the rest of the cluster, rather than triggering a significant rebalance. Express brokers are also highly available by default, with the service managing the critical cluster and topic configurations that would otherwise need hand-tuning.
Results
Since migrating to Amazon MSK Express, Klaviyo has achieved the following results:
Multi-fold broker scale-out in under two months to absorb BFCM peak traffic, with a clean scale-down afterward.
Approximately 30 percent cost reduction from running unified processors across all three priority levels instead of separate infrastructure per level.
5-second SLO held for real-time event triggers at a peak of 170,000 events per second.
22.7 billion messages delivered over BFCM 2025, up 25 percent year over year.
Multi-Region since May 2026, with a second event gateway cluster in eu-central-1 serving European customers.
MSK Express adopted across Klaviyo’s event gateway clusters in both US and EU AWS Regions.
As Klaviyo’s engineering team wrote in Rebuilding Event Infrastructure at Scale:
“Moving to managed Kafka infrastructure on AWS MSK was one of those decisions that keeps paying dividends.”
It freed up engineers to spend their time building features rather than operating messaging infrastructure.
Key learnings
Based on Klaviyo’s experience building and operating this architecture, here are key takeaways for teams considering a similar approach:
Design for extreme elasticity from day one – Klaviyo’s BFCM traffic drives a multi-fold surge in event volume into five days. Designing partition layouts, topic structures, and consumer groups to accommodate elastic scaling before you need it avoids painful re-architecture under pressure.
Size partitions for your consumers, not your brokers – Klaviyo’s 360 partitions per topic come from its consumer topology (one orchestrator pod per partition), which stays fixed while the broker fleet scales up and back down underneath it. Coupling partition count to broker count would have forced a partition change in the middle of the holiday ramp.
Scale down as deliberately as you scale up – Klaviyo returned to a right-sized fleet after BFCM rather than carrying peak capacity all year. Because Express bills storage per GB rather than per provisioned volume, scaling down left no stranded storage cost behind.
Run multiple SLO classes on one pipeline – A single set of processors serves all three priority tiers, which cut costs by roughly 30 percent. Priority routing still protects latency: real-time triggers held their 5-second SLO at a peak of 170,000 events per second.
Build fault tolerance into every layer – Cross-cluster failover, a dead-letter queue, and an Amazon Simple Storage Service (Amazon S3) fallback mean individual failures don’t cause data loss. Express broker recovery keeps a lost broker from turning into a cluster-wide disruption.
Conclusion
Klaviyo’s journey from RabbitMQ to Amazon MSK Express demonstrates how a managed streaming service helps high-growth companies operate mission-critical event infrastructure at massive scale without proportionally growing their operations team. By combining MSK Express Intelligent Rebalancing with thoughtful architecture design (priority-based topics, graduated retry queues, and layered failure capture), Klaviyo’s lean infrastructure team scaled 5 times during the largest ecommerce event of the year.
Klaviyo’s use of Amazon MSK has since grown beyond the event pipeline. Its change data capture (CDC) infrastructure now runs on Amazon MSK Express as well. The team is also evaluating migrating its remaining self-managed Apache Kafka clusters on Amazon Elastic Compute Cloud (Amazon EC2), which serve data lake workloads, to MSK.
If you’re operating Apache Kafka workloads that require elastic scaling, operational simplicity, or both, consider Amazon MSK Express brokers for your next streaming workload.
Are you an integration architect, platform lead, or engineering manager spending a considerable amount on middleware licenses only to move data between systems? This post shows how Country Road Group replaced that middleware with a pattern-driven integration solution on AWS.
Enterprise integration solutions like BizTalk, MuleSoft, TIBCO and Boomi solved the right problem when they emerged. But they also tightly coupled applications to the middleware itself, through proprietary adapters, orchestrations, and message formats. That coupling has become a major source of cost and pain. Many organizations now pay hundreds of thousands per year in licensing, hosting, and maintenance for middleware that delivers no new capability. Meanwhile, the talent to maintain it disappears from the market. The interfaces themselves haven’t changed: publish-subscribe, content-based routing, request-reply, scatter-gather. Cloud-native services now implement them directly, without requiring a middleware runtime in between.
Country Road Group (CRG) is a major Australian fashion retailer operating five brands (Country Road, Mimco, Witchery, Politix, and Trenery) across more than 600 stores. CRG faced exactly this problem. Their 21 integration interfaces ran on Microsoft BizTalk Server hosted on VMware, connecting point-of-sale systems, Oracle RMS databases, and ecommerce platforms. BizTalk was approaching end-of-support. VMware costs were escalating post-Broadcom acquisition. And the team couldn’t hire BizTalk developers anymore.
In this post, we walk through CRG’s Strategic Integration Platform (SIP) and the declarative, pattern-led approach behind it. Rather than writing orchestration code for each interface, CRG’s teams declare which integration pattern an interface uses, and pre-built Terraform modules provision the infrastructure behind it. We cover the four processing lanes that replaced BizTalk and the custom Error Management System that handles failures across them.
The approach doesn’t depend on any one infrastructure-as-code tool. To help your team adopt it, we’re also releasing a starter kit: the Enterprise Integration Patterns AWS Cloud Development Kit (AWS CDK) Library. It’s an open-source set of 29 constructs that implement the same patterns as reusable infrastructure. Teams using Terraform can use it as a reference implementation. The kit includes an agent skill that helps AI coding assistants such as Kiro and Claude Code select, configure, and compose the right pattern.
Why CRG built SIP
CRG’s existing integration ecosystem suffered from tool sprawl and the presence of end-of-life middleware (BizTalk 2013), leading to increased production instability and operational overhead.
SIP addressed four key value drivers
Legacy debt: Decommission BizTalk 2013 and its unsupported VMware/Broadcom infrastructure.
Tool sprawl: Consolidate BizTalk, Workato, Apollo, and Kafka into a single integration solution with one engineering skillset.
Low velocity: Adopt API-first and continuous integration and continuous delivery (CI/CD) patterns to accelerate new partner integrations.
Security and resiliency risk: Standardize authentication and authorization across every interface and treat dead-letter queues (DLQs) as data stores. Failed messages hold full copies of customer payloads, so DLQs need the same encryption, retention, and access controls as the primary channel to stay within data residency and retention requirements.
SIP architecture overview
The SIP follows a “Compose on Cloud-Native” strategy. It combines AWS serverless compute (Spring Boot on AWS Lambda, AWS Step Functions, Amazon EventBridge) with Apache Camel on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate for long-running and stateful flows.
The architecture is organized into three layers as shown in Figure 1: a pattern layer where each interface is composed from standardized integration patterns, an AWS service layer where Terraform and CI/CD templates provision and govern infrastructure, and a source-and-target connectivity layer bridging on-premises, cloud, and B2B endpoints.
Traffic flows through a four-lane, pattern-led service bus (batch, API, JDBC, and event), as shown in Figure 2. Each lane routes to the appropriate compute runtime based on payload characteristics and processing duration.
Figure 1: CRG strategic integration solution — key building blocks
Pattern layer: Each of the 21 interfaces is expressed as a composition of standardized integration patterns (publish-subscribe, content-based routing, and others). This layer contains the business-specific logic: Lambda handlers that validate, transform, and route payloads, orchestrated by Step Functions for multi-step workflows and triggered by Amazon EventBridge rules or Automic. The patterns act as a shared vocabulary across the engineering team. Deployment of an interface starts by selecting a declarative pattern or Terraform code, not by writing infrastructure from scratch.
AWS service layer: The solution provisions its integration surface from AWS managed services, grouped by role. Amazon API Gateway is the entry point, with AWS WAF shielding and rate limiting in front. AWS Lambda handles stateless event processing, and AWS Step Functions orchestrates multi-step workflows with standardized retry and catch logic. Amazon EventBridge is the canonical event bus, with Amazon Simple Queue Service (Amazon SQS) and Amazon Simple Notification Service (Amazon SNS) providing asynchronous buffering and fan-out. Amazon Simple Storage Service (Amazon S3) persists messages, using S3 Intelligent-Tiering and archival to Amazon S3 Glacier storage classes. AWS Transfer Family provides managed SFTP and FTP endpoints. Amazon ECS with AWS Fargate runs Apache Camel routes for long-running flows, and Amazon DynamoDB holds metadata and the error index. Terraform is the authoritative provisioning engine for every AWS resource.
Source and target connectivity layer: On the source side, SIP integrates with on-premises, OCI, legacy core applications (Oracle RMS, Manhattan WMS, Magenta Retail), cloud and digital platforms (Salesforce Service Cloud, eStar Online), and B2B partner portals. On the target side, flows deliver to Oracle databases, eStar (ecommerce), file systems, and partner endpoints.
Note: SIP pulls. Sources don’t push. SIP retrieves data from source systems on its own schedule rather than accepting unbounded pushes. The consumer, not the producer, controls the rate. Where pull doesn’t fit: Some sources can only push, such as SaaS webhooks. In those cases, SIP accepts the push into a queue and processes it at its own pace, so the same principle holds.
Figure 2: CRG Strategic Integration Platform — multi-lane service bus architecture showing four processing paths (batch, API, JDBC, event) with transformation routing and error management
SIP routes traffic through four pattern-led lanes
Lane 1 (MFT/Batch) handles file-based ingestion: Automic or Amazon EventBridge triggers AWS Transfer Family to receive SFTP traffic, archive to S3, and hand off to a parser Lambda for validation and transformation.
Lane 2 (API/Real-Time): Processes synchronous REST requests through Amazon API Gateway into a Step Functions orchestrator. A transformation engine routes to the appropriate runtime: Lambda for sub-five-minute jobs, or Apache Camel on ECS Fargate for long-running and stateful flows.
Lane 3 (JDBC/Data Aggregator): This pattern handles direct database connectivity for bulk extractions, routing through Lambda and Amazon AppFlow for lightweight aggregation or ECS Fargate for heavier workloads.
Lane 4 (Event/Message) manages asynchronous flows: External events enter through API Gateway while internal events route through Amazon EventBridge, with Amazon SNS for fan-out broadcasting and Amazon SQS for buffered consumption.
Across all four lanes, the Error Management System (EMS) provides a unified error handling layer. Failed transactions route to a dead letter queue in Amazon SQS. EMS captures the error metadata in DynamoDB and persists the payload in Amazon S3, with every failure carrying a correlation ID and a standardized JSON error contract. It is built on Spring Boot running on Lambda, with a Next.js front end on AWS Amplify.
L1 and L2 operators use the EMS dashboard to inspect, modify, and resubmit failed transactions idempotently, without developer involvement. New interfaces onboard to EMS automatically through a unique interface ID. This moved CRG from developer-led (L4) error recovery to operator-led (L1) first-line resolution.
Key design decisions
Lambda-first, ECS as fallback: Lambda handles short-duration event processing, Apache Camel on ECS Fargate serves long-running, stateful, and large-file flows.
Reproducible infrastructure: Every AWS resource in the platform is defined in Terraform, so any environment can be rebuilt exactly from code. That fixes configuration drift, a bad change, or an accidentally deleted resource, and the same templates stand up a new environment or Region. Terraform state is held in a versioned, access-controlled S3 bucket. Infrastructure as code rebuilds the platform, not its data, so data is protected separately. DynamoDB point-in-time recovery restores tables, S3 versioning restores objects, and dead-letter queues hold failed messages for redrive. Runtime failures such as an Availability Zone outage don’t need a redeploy at all, because Lambda, SQS, DynamoDB, and Step Functions run across multiple Availability Zones by default.
Amazon EventBridge as canonical event bus: All inter-pattern communication flows through Amazon EventBridge for content-based routing, event replay, and native integration with over 200 AWS services.
Five-layer security: AWS Identity and Access Management (IAM) least-privilege role-based access control (RBAC), AWS WAF with virtual private cloud (VPC) isolation, data classification (Public through Restricted), TLS 1.2+ in transit with AWS Key Management Service (AWS KMS) encryption at rest, and structured audit logging with automated personally identifiable information (PII) redaction.
Open source: Enterprise Integration Patterns CDK Library
In this post, we share an open-source AWS CDK construct library that codifies 29 canonical integration patterns as reusable L3 constructs. Each construct provisions messaging infrastructure, IAM permissions, dead-letter queues, and retry logic from a single declaration. Amazon CloudWatch alarms are deliberately left to the consumer, because thresholds and notification targets are environment specific. The library uses TypeScript and AWS CDK. Teams using Terraform or other infrastructure as code tools can reference the patterns and translate to their provisioning framework.
Prerequisites
An AWS account with the AWS CDK bootstrapped in your target AWS Region, Node.js 20 or later, and the AWS CDK CLI v2. Familiarity with TypeScript helps but the examples are short. For Path 2 you also need Kiro or Claude Code.
Getting started
There are two ways to go from a requirement to a deployed pattern. Path 1 is hands-on: you write the construct declaration and run the CDK commands yourself. Path 2 is agent-assisted: the agents shipped in the repository select and configure the construct for you, and you run the final deploy. Both produce the same thing, a small app.ts that instantiates one or more of the 29 library constructs, so the security posture is identical whichever you choose. Start with Path 1 if you already know which pattern you need. Start with Path 2 if you are coming from a legacy platform’s vocabulary and want help mapping it. Both paths begin the same way:
git clone https://github.com/aws-samples/sample-enterprise-integration-patterns-cdk.git
cd sample-enterprise-integration-patterns-cdk
npm ci
npm run build
npm test
The repository is a construct library, not a deployable application: app.ts ships as an empty stub, and cdk synth on a fresh clone produces no stacks by design.
Path 1: Declare a pattern yourself
Open app.ts and declare the construct you need. The README’s Implementation Guide has worked examples for request-reply, publish-subscribe, scatter-gather, and saga. Then synthesize and deploy:
npx cdk synth
npx cdk deploy
Path 2: Let the agents do the selection and configuration
Open the repository in Kiro or Claude Code and select an agent from the chat input. Kiro, the agentic coding IDE and CLI from AWS shown in Figure 3, uses spec-driven development to translate natural-language requirements into pattern compositions. Describe the integration requirement in your own terms, and the agent selects the right construct from the library, writes the declaration into app.ts with correctly configured props, and validates it with npm run build, npm test, and cdk synth. Deployment stays with you: the shipped eip-architect agent is denied cdk deploy and cdk destroy by design, so nothing reaches an account without a human running it. When the agent reports the declaration ready, you run the same two commands as Path 1.
The repository ships two agent skills and two custom agents for this. Use them in order, or go straight to the second if you already know what you are building.
integration-advisor runs discovery. It asks the questions, maps each of your existing interfaces to a construct, and writes an assessment file. It touches no code.
eip-architect picks that assessment up and writes the CDK declarations that instantiate the right library constructs with the correct configuration for each pattern, then verifies them.
Figure 3: Two agents in action, integration-advisor and eip-architect, running in the Kiro CLI
Clean up
Remove anything you deployed with npx cdk destroy. The constructs default to RemovalPolicy.DESTROY, so queues, tables, and buckets created by a pattern are removed with the stack.
Results
Annual integration service costs dropped from approximately $300,000 to $60,000, an 80 percent saving. Four middleware tools (BizTalk, Workato, Apollo, and Kafka) consolidated to one. The primary objective, full decommissioning of Microsoft BizTalk Server and its associated VMware/Broadcom infrastructure, has been accomplished. CRG now deploys new interfaces through standardized patterns in hours rather than weeks, using cookie-cutter Terraform templates and automated CI/CD pipelines. The Error Management System shifted failure resolution from engineering to L1 operators, fundamentally changing the support cost model. Distributed telemetry across Amazon CloudWatch, AWS X-Ray, and Dynatrace provides end-to-end transaction tracing with correlation IDs through every integration hop. CRG migrated interfaces in waves grouped by business function, with service-group rollback allowing any failed wave to revert independently. The architecture is cloud-native by design: because the pattern layer is decoupled from the service layer, you can incorporate new AWS services as steps within any existing pattern composition without re-architecting the platform.
Conclusion
For organizations retiring legacy middleware or designing integrations from scratch, the goal is the same: a modern, decoupled architecture where systems exchange data through well-understood patterns, not through a central runtime they all depend on. CRG’s approach offers a replicable playbook. Legacy integration middleware carries compounding costs: licensing, hosting, scarce talent, and opportunity cost from slow delivery cycles. A pattern-driven migration on cloud-native services addresses all four simultaneously. The open-source AWS CDK construct library and Kiro agent skill published alongside this post give your team a head start, packaging the patterns CRG proved in production. Whether you run BizTalk, MuleSoft, TIBCO, or Boomi, the integration patterns are the same. Only the execution layer changes.
“Our billing transformation with Amazon Redshift empowered the business to deliver new ways of selling which were impossible to consider before. The fact that it did this while simultaneously reducing costs by 70% and reducing operational overhead told us how powerful the approach was.”
— Sean McKibben, Principal Software Engineer, Twilio
Twilio is a cloud communications platform with APIs for messaging, voice, email, and video. It serves over 400,000 active customer accounts and more than 12 million developers worldwide to build unique, personalized experiences for their customers. Twilio’s Commerce Platform business unit owns shopping, metering, and rating domains, processing tens of billions of usage events per month across 200 million price points. The platform supports Twilio’s Opportunity-to-Revenue (OTR) initiative, a company-wide program to modernize the full billing lifecycle from customer intake through invoicing.
Challenges with the legacy billing system
Twilio built its billing system on Amazon Aurora MySQL, which reliably powered 70 partitioned database instances and converted billions of events into invoices across messaging, voice, email, and video. As Twilio’s business grew and data volumes expanded significantly, the team recognized an opportunity to evolve the architecture to meet new demands.
Following are the primary challenges with the legacy platform:
Processing slowdowns, with backlogs sometimes taking hours to clear.
Operational fragility because of frequent ETL failures requiring engineers to spend more time troubleshooting pipelines than delivering new features.
Higher infrastructure costs that were disproportionate to the business value delivered. It also lacked the flexibility to smoothly deliver features like backdated changes to pricing models or complex organizational lifecycles without manual intervention.
The billing system needs to generate invoice line items with financial-grade consistency. There can be no duplicate charges or missing events. The existing system could not support new pricing models without re-architecting, and the finance team could not run analytical queries without impacting production.
Twilio needed a distributed data warehouse architecture that could handle both transactional billing integrity and analytical flexibility. The architecture had to process billing calculations in minutes rather than hours and let finance and product teams query data without impacting production.
Overview of the solution
Twilio’s Commerce Platform team evaluated several approaches, including traditional data warehouses, data lakes with query engines, and split architectures with separate operational and analytical systems. Traditional data warehouses are optimized for analytics at the expense of real-time data consistency while operational databases handle transactional workloads but struggle with complex analytical queries at scale.
With Amazon Redshift, Twilio bridged that gap, helping queries return consistent results even for concurrent write workloads, while still maintaining high analytical performance. The key capabilities that drove Twilio to adopt Amazon Redshift Serverless are as follows:
Serverless operations — Amazon Redshift Serverless eliminates provisioning, capacity planning, and failover management. Compute scales automatically in response to workload demand, optimizing cost without manual intervention.
Real-time streaming ingestion — Billing events stream continuously through Amazon MSK. Amazon Redshift streaming ingestion delivers near real-time event data directly into the data warehouse with no requirement of intermediate landing zones.
Transactional integrity — Using serializable isolation with Amazon Redshift helped deliver consistent query results across concurrent workloads, thereby preventing data anomalies that would require custom reconciliation logic.
Materialized views AUTO refresh — Materialized views (MV) with AUTO refresh incrementally aggregate billing events by customer, product, and day, delivering near real-time rated data to downstream workgroups without batch processing.
Distributed data warehouse — With Amazon Redshift data sharing, multiple workgroups securely share data across workloads. This provides workload isolation by running analytical queries on an independent consumer workgroup without slowing down invoice processing, along with cost visibility per workload.
Transformation orchestration with dbt — dbt (data build tool) is used for orchestrating Amazon Redshift MV refreshes and stored procedure execution, managing the dependency graph across more than 200 million price points with auto-generated documentation and full calculation lineage. Amazon Redshift full SQL compatibility with dbt Core allows them to define metering, rating, and bookkeeping logic as reproducible SQL directed acyclic graphs (DAGs).
The following diagram illustrates the architecture of the solution implemented by Twilio:
Figure 1: End-to-end solution architecture
The key implementation steps for the architecture are as follows:
1. Ingestion layer
Twilio’s billing events originate from product teams across messaging, voice, email, and video. The data from these source systems are ingested into the billing system using the following ingestion pipelines:
Streaming ingestion
Each product emits usage events to Amazon MSK topics within their Amazon MSK Serverless clusters. Billing events from these topics flow into Amazon Redshift using streaming ingestion. AUTO refresh option for Amazon Redshift MVs provides real-time aggregation as events land, incrementally aggregated by customer, product, and date, thereby processing billions of events daily.
Serializable transaction isolation, combined with deduplication logic in the materialized views, allows each event to be counted exactly once.
Zero-ETL integration
Twilio’s product catalog and pricing configuration data live across multiple Amazon Aurora MySQL clusters. This legacy system contains customer account data, pricing configurations, and historical billing records that must be accessible to the new engine for reconciliation. The legacy system priced everything with whatever configuration was current at the time of processing, which worked well for forward-looking billing. However, the team needed the flexibility to reprice historical usage for corrections, promotional adjustments, and contract changes.
Using Zero-ETL with history mode for integrating Amazon Aurora databases with Amazon Redshift, every price update and configuration change is automatically captured with timestamps. As a result, the team can reconstruct any bill from any point in time after history mode was enabled. They can also reprice historical usage with the exact configuration that should have applied, or model what invoices would look like under different scenarios.
Additionally, Zero-ETL replicates data from the legacy MySQL billing shards into Amazon Redshift Serverless with CDC, eliminating custom extraction pipelines. This allowed:
Billing accuracy validation during the parallel-run period.
A unified query layer across all shards without managing shard-aware queries.
COPY command to load from Amazon S3
Finalized invoice data is exported from the invoicing platform, Zuora, in Apache Parquet format to Amazon S3, providing completed invoice line items, customer charges, and billing summaries that need to be available for customer self-service and console experiences. This invoice data in Amazon S3 is loaded into Amazon Redshift tables using COPY from Parquet on Amazon S3.
2. Transformation layer
The billing transformation logic runs on open source dbt Core with SQL DAGs defining the following transformation pipelines:
Metering
Metering deduplicates raw billing events using transaction identifiers and then aggregates events by customer, product, and time period. It also handles edge cases like late-arriving events and event corrections. dbt Core orchestrates the ingestion while auto-maintained incrementally refreshed Materialized Views aggregate billing events.
Rating
Rating applies pricing rules to metered aggregates. It manages over 200 million price points across multi-tiered volume discounts, promotional discounts that stack in specific orders, multi-product bundles, and bifurcated taxes. Each pricing rule is a discrete SQL model, and dbt orchestrates the dependency graph between them.
Bookkeeping
dbt Core orchestrates SQL transformation DAGs that generate priced aggregate artifacts formatted as invoice line items for the invoicing platform. The Bookkeeper system also creates read-only Iceberg tables from rating system data shares for data lake delivery. dbt cleans and transforms invoice data returned from the invoicing platform through Amazon S3 in Parquet format before it is written to Amazon DynamoDB for customer console experiences.
3. Storage layer
The billing engine uses multiple Amazon Redshift Serverless workgroups with AI-driven scaling, primarily 128 Redshift Processing Units (RPUs) base, up to 1,024 for heavy workloads. Amazon Redshift data sharing distributes rated data across workgroups without ETL or data copies, across all consumers in real time.
As part of the billing pipeline, three Amazon Redshift Serverless workgroups serve distinct workloads:
Metering workgroup
The Amazon Redshift Serverless workgroup hosts the auto-refreshing MVs that deduplicate and aggregate billing events and stores over half a trillion events available for immediate querying. It writes curated financial datasets directly to Amazon S3 as Iceberg tables, indexed with AWS Glue Data Catalog.
Rating workgroup
This Amazon Redshift Serverless workgroup processes pricing configuration information, from aggregated Zero-ETL sources. It then applies pricing to usage aggregates to create the central system of record for rated usage. These core datasets are then shared with Bookkeeper for use-case-specific delivery.
Bookkeeper workgroup (invoice generation)
The Amazon Redshift Serverless workgroup for invoice generation receives rated data through data shares from the rating workgroup. Data shares from this workgroup are also used to feed the Customer Usage API workgroup. This also stores priced aggregate artifacts formatted as invoice line items for the invoicing platform. It processes the invoicing platform’s return data to Amazon S3 and writes to Amazon DynamoDB for customer console experiences.
In addition, the following Amazon Redshift Serverless workgroup serves Twilio’s end customers through their public APIs:
Customer Usage API workgroup
This dedicated Amazon Redshift Serverless workgroup receives rated usage data and product catalog configurations through stored procedures from the source systems and metered aggregates through data shares from the bookkeeper workgroup. It serves near real-time billing queries for the customer-facing usage API without impacting the billing pipeline’s compute resources.
4. Consumption layer
Processed billing data serves five downstream consumers:
Invoicing platform — The Bookkeeper workgroup delivers priced aggregates as invoice line items for customer billing.
Twilio Public APIs — The Customer Usage API workgroup powers near real-time billing queries for customers, backed by live data shares from the Metering workgroup.
One Admin — Internal billing operations dashboards served directly from Amazon Redshift with sub-minute response times.
One Console — Customer self-service experiences, for example balance inquiries, CSV invoice downloads, and so on, are served from Amazon DynamoDB. The Bookkeeper workgroup loads finalized invoice data returned from the invoicing platform to DynamoDB for low-latency API serving end-users.
Product Teams — Amazon Athena queries curated financial datasets on Iceberg tables through the AWS Glue Data Catalog, providing broader organizational access without direct Amazon Redshift access.
Results
Twilio’s modernized billing engine cut infrastructure costs by 70% while accelerating billing recalculations by 12x, all while processing billions of events a month. Twilio launched the new billing system in production in mid-2026, providing rated usage for real customer invoices through Zuora. This new engine modernized on Amazon Redshift Serverless delivered measurable improvements across every dimension, which include:
70% lower infrastructure cost — Ongoing costs for the billing system dropped by 70%, while the system scaled to store almost two trillion events that the legacy architecture could not accommodate.
12x faster billing recalculation — Full month recalculations lowered from over 6 hours down to 30 minutes, along with retroactive pricing changes and scenario modeling that were previously impractical.
Over 80% reduction in processing time — 80-85% operational gain across the pipeline, with the team meeting business service level agreements (SLAs).
Sub-minute financial reporting — Finance dashboards moved from daily batch refreshes to sub-minute response times, providing near real-time visibility into billing data.
Complete pricing flexibility — The rating engine now manages Twilio’s complete catalog of 200 million price points, up from a constrained subset, with no duplicate charges or missed events.
Leaner operation — A small team manages what previously required a much larger operations team.
Most significantly, engineers shifted from firefighting pipeline failures to building new product capabilities, a cultural transformation driven by reliability and simplicity of the serverless architecture.
Conclusion
In this post, we showed how Twilio modernized their legacy billing system by adopting Amazon Redshift Serverless as the foundation for a financial-grade, real-time billing system at scale.
The modernized architecture is driven by streaming ingestion using Amazon MSK along with Amazon Redshift Zero-ETL from Amazon Aurora MySQL. With direct writes to Amazon S3 Iceberg tables cataloged with AWS Glue Data Catalog and dbt-driven transformations, Twilio built a billing engine that scales with their business. The new solution helped engineering teams to focus on billing product innovation rather than infrastructure operations. Learn more about how Amazon Redshift helped Twilio redesign their billing engine from their talk at AWS re:Invent 2025, where they co-presented with the Amazon Redshift and Amazon Athena service teams.
To learn more about the AWS services used to build modern data solutions on AWS, refer to the AWS public documentation and stay up to date through the AWS Big Data Blog.
Moonfrog Labs uses Amazon Redshift to analyze mobile game telemetry. Each session, purchase, and player drop-off generates events that product and analytics teams use to understand game performance. Faster loading and querying help those teams work with fresher data.
Moonfrog runs a single production analytics cluster with roughly 148 TB in Amazon Redshift Managed Storage (RMS) and about 4,000 warehouse tables. It also queries roughly 1,000 external data lake tables. The warehouse supports telemetry ingestion, revenue reporting, marketing attribution, and self-service dashboards for product, data science, analytics, and support teams.
In this post, we show how Moonfrog migrated its production analytics warehouse from Amazon Redshift RA3 to RG instances using elastic resize. We explain how the team selected capacity for growing analytics demand and more frequent loading, verified warehouse and data lake access, and assessed performance and costs after migration.
The challenge
Moonfrog’s RA3 cluster ran reliably, with no stability issues. Its constraint was compute headroom as analytics demand grew. Ingestion volume was steady before migration. Growth came from analytical queries and data lake scans. The team already planned to expand from five RA3 nodes to six or seven nodes and wanted capacity to load warehouse data more frequently.
The five-node ra3.4xlarge cluster averaged about 54% CPU utilization. In approximately 98% of hours, CPU peaked at or above 90%. Other indicators showed demand increasing:
SELECT queries per day increased 31% from January to July.
Mean workload management (WLM) queue wait for highest-priority queries rose from 505 milliseconds in May to 940.7 milliseconds in July.
Concurrency scaling usage nearly doubled over the same period, from 4,453 to 8,516 seconds per day.
A COPY operation averaged 16.8 seconds on RA3. That duration constrained how often the stats pipeline could load. The team evaluated RG as a way to support growing analytics demand and make more frequent loads practical.
Moonfrog also queried roughly 1,000 external tables in Amazon Simple Storage Service (Amazon S3). Data scanned through Redshift Spectrum increased 33%, from 84.9 TB in March to 112.5 TB in June. The separate Spectrum scanning charge added to the cost of expanding RA3 compute.
Moonfrog used WLM query monitoring rules to stop scans larger than one terabyte. These rules controlled scan spend under the RA3 configuration.
The one-year no-upfront reserved node commitment for ra3.4xlarge expired in July 2026. Renewal gave Moonfrog an opportunity to re-evaluate its compute commitment and determine whether switching to RG would provide additional headroom for its growing workload needs.
Solution overview
Amazon Redshift RG instances use AWS Graviton processors and an integrated data lake query engine. AWS publishes benchmarks of up to 2.2 times faster warehouse workloads and up to 2.4 times faster Apache Iceberg workloads, at 30% lower price per vCPU than RA3. These benchmarks are separate from Moonfrog’s production results. RG runs Apache Iceberg and Apache Parquet scans on cluster nodes, removing the separate per-terabyte Spectrum charge for these scans. Elastic resize supports changing the node family and capacity without a customer-managed export and reload.
Moonfrog retained its ingestion and analytics architecture at cutover. No service was added or removed, and applications continued to use the same warehouse.
The following diagram illustrates the architecture.
Figure 1: The ingestion pipeline writes columnar files to Amazon S3. COPY loads warehouse tables, and the integrated data lake engine on RG queries external tables in place. Conversational analytics is a planned use of the additional headroom
The architecture uses the following AWS services:
Amazon Redshift provides the analytics warehouse and integrated data lake engine.
Amazon S3 stores event files, load staging data, and external data lake tables.
Moonfrog established a baseline, used elastic resize to change the node family, and verified warehouse and data lake access. It then evaluated the early results before selecting its final configuration.
Step 1: Establish a baseline
Before the change, the team captured Amazon CloudWatch metrics for CPU utilization, WLM queue wait by priority, query duration by type, and queries per day. COPY loads and SELECT queries were measured separately. Billing records provided reserved compute, Spectrum scanning, and concurrency scaling costs so the comparison covered each billing line affected by the move.
Step 2: Validate the target configuration and use elastic resize
AWS recommends testing the target RG configuration in a non-production environment with representative workloads before migrating production. That testing is intended to measure benefits, identify issues, and validate the target size before the production migration.
On 26 July, Moonfrog used elastic resize to move from five ra3.4xlarge nodes to eight rg.4xlarge nodes, temporarily providing extra capacity to reduce migration risk. It did not export or reload the 148 TB warehouse. Schemas, ETL jobs, application SQL, drivers, connection strings, and BI tools continued to work.
Amazon CloudWatch recorded one five-minute interval in which the cluster reported unhealthy. Database connections recovered immediately afterward. This sampling interval describes the observed impact. It does not establish an exact five-minute outage duration.
AWS guidance describes elastic resize as a short operation, typically about 10 to 15 minutes. After an RA3-to-RG node-type change, data hydration brings frequently accessed data from managed storage into the new nodes’ local cache. This cache warming should be considered when interpreting early performance measurements.
Step 3: Verify warehouse and data lake access
Moonfrog verified that warehouse loads and external queries continued after the resize. External schemas and tables remained in use, with AWS Glue Data Catalog providing their metadata.
Moonfrog confirmed that per-terabyte S3 scanning charges were eliminated for its RG queries in the subsequent billing records. Those queries used provisioned cluster capacity, which remained billable.
Step 4: Review workload management rules
Moonfrog’s Auto WLM configuration included separate queues for administrators, analysts, ETL, loading, and visualization, along with short query acceleration. These queues carried across the migration. The team reviewed query monitoring rules because data lake scans now consumed RG cluster capacity.
The review accounted for data lake scans sharing compute with warehouse workloads. Rules that previously controlled scan spend could still protect these shared resources.
Results and key benefits
The following four CloudWatch charts cover 1 May to 25 October 2026. Each marks the 26 July resize and shades the 26 July–3 August period when the cluster was reduced from eight to seven to six RG nodes. Query duration and WLM wait charts show seven-day rolling means. Query counts include COPY, SELECT, INSERT, utility, and other operations.
Stage 1: Evaluate RG after cutover
The first evaluation focused on workload continuity and query runtime. Warehouse loads and data lake queries continued, and the applications used the same schemas, SQL, drivers, and connection strings. Queries on the initial RG configuration were completing within expected runtimes. Moonfrog then reduced the node count in stages to assess whether each reduction affected query runtime.
The cleanest comparison of COPY duration is 27–31 July, when load volume remained unchanged. Mean duration fell from 16.8 seconds on RA3 to 3.6 seconds on RG, about 79% shorter. This window falls within the 26 July–3 August right-sizing period, before the final six-node configuration was established.
Select six nodes
Moonfrog reduced the cluster from eight to seven and then six RG nodes within eight days. The team retained the additional node relative to its five-node RA3 baseline to support growing analytical demand and more frequent loading. It had already planned to expand RA3 to six or seven nodes.
The move from five RA3 nodes to six RG nodes increased node count by 20%. Published node specifications list 12 vCPUs per ra3.4xlarge and 16 per rg.4xlarge, so provisioned vCPUs increased from 60 to 96, or 60%. The results reflect the change in both node family and capacity.
Stage 2: Sustain performance as workloads grow
After validating the available headroom on the six-node configuration, Moonfrog increased loading frequency on 24 August. The cluster now executes more than 70,000 COPY operations a day, about 4.3 times the RA3 baseline. These loads use smaller, more frequent batches, so later COPY duration also reflects the changed loading pattern. Figure 2 shows the early duration improvement and subsequent performance as the workload changed.
In late August, after the 24 August increase in loading frequency, Moonfrog purchased a one-year no-upfront reservation for the six-node RG configuration. The purchase followed its evaluation of RG with production traffic and committed capacity for anticipated workload growth.
Figure 2: Mean COPY and SELECT duration. The early COPY comparison uses unchanged volume. Later means also reflect smaller batches after 24 August
More daily queries with compute headroom
Daily queries across all types increased from around 49,122 on RA3 to 83,603 in August, 125,350 in September, and 125,374 during 1–25 October. From September onward, this was more than 2.5 times the RA3 baseline. COPY accounts for much of that increase, so total query growth should be read alongside the query mix in Figure 3.
Figure 3: Successful daily queries by type. COPY frequency increased on 24 August, after the migration and right-sizing period
Concurrency scaling remained enabled to absorb peak bursts alongside the six reserved nodes. Average daily usage was 14–29% below the RA3 baseline in August, September, and October, even as total query volume grew. Usage increased from September to October as demand rose.
Average CPU utilization fell from about 54% on RA3 to 35–39% from September onward, despite the higher query count. Figure 4 distinguishes daily average CPU from the typical peak, defined as the daily mean of each hour’s maximum CPU reading.
Figure 4: CPU utilization before and after the resize. The typical peak is an average of hourly maximum readings, not the single daily maximum
Queue waits as demand grows
Queue waits fell after migration and rose from their August lows as traffic increased in October. During 1–25 October, highest-priority waits averaged 561 milliseconds versus a July RA3 baseline of 940.7 milliseconds, and high-priority waits averaged 193 milliseconds versus 294 milliseconds. Normal-priority waits were about 11 milliseconds, above their July baseline of about 3.6 milliseconds. Figure 5 uses a separate vertical scale for each priority.
Figure 5: Seven-day rolling mean WLM queue wait by priority. Dashed lines mark July RA3 baselines. Each panel has its own scale
Integrated data lake queries and billing
External data lake queries continued after migration. Moonfrog confirmed that the separate Spectrum scanning charge remained exactly $0 from 27 July through the reported months:
The Amazon Redshift system views showed that external queries continued. A recent three-day sample recorded roughly 200,000 external queries against Amazon S3, including Parquet scans. External schemas and tables remained in use.
Billing records showed no separate per-terabyte scanning charge. External scans use provisioned RG capacity, which remains billable. Amazon S3 storage and other charges are outside this comparison.
Cost per query
Moonfrog chose additional capacity for growth, and monthly spend across reserved compute, Spectrum scanning, and concurrency scaling increased approximately 4–6%. On a consistent 30-day basis, cost per 1,000 total queries fell approximately 59% in September and 58% in October. Costs per 1,000 SELECT queries fell 38–50% across August through October.
Metric
RA3 × 5 Before
RG × 6 August
RG × 6 September
RG × 6 Oct 1–25
Queries per day All types
49,122
83,603
125,350
125,374
Cost per 1,000 total queries
$5.60
$3.45 −38%
$2.28 −59%
$2.33 −58%
Reported cost per 1,000 SELECT
$45.60
$22.73 −50%
$25.19 −45%
$28.34 −38%
Cost per 1,000 total queries is calculated by dividing the combined 30-day spend for reserved compute, Spectrum scanning, and concurrency scaling by 30 times the average daily query count, then multiplying by 1,000. These are aggregate cost measures, not the execution cost of an individual query.
How the team plans to use the headroom
The larger configuration created room to test additional analytical use cases. Earlier measurements showed mean short-query duration falling from about 2.8 seconds to 1.8 seconds. That observation applies to the measured short-query workload and does not establish a response-time guarantee for every analytical question.
Moonfrog plans to evaluate conversational analytics using large language model (LLM) agents. Such agents may execute several queries to answer one question, so query latency is one part of the end-to-end response time. The additional compute headroom gives the team room to test these workloads alongside existing analytics.
Lessons learned
Use a reserved node renewal as an opportunity to review capacity and architecture for your growing workload needs. Moonfrog evaluated RG before making another one-year commitment.
Size the cluster for expected workload growth and assess results against the capacity provisioned. Moonfrog added a sixth node for headroom. Interpret total query counts alongside the query mix, because smaller, more frequent COPY batches increase the number of operations.
Include concurrency scaling in capacity planning. In this deployment it continued to absorb peak bursts alongside the reserved nodes, so evaluate its contribution when assessing warehouse throughput.
Separate immediate migration results from subsequent workload changes. The unchanged-volume COPY comparison captures the first days after cutover. Later results include the loading cadence change and rising demand. Measure dashboard latency and query abandonment separately to quantify the effect on users.
Next steps
Moonfrog has already increased warehouse loading frequency. The team plans to measure dashboard load times and query abandonment to assess how greater freshness and shorter query durations affect the experience of product and analytics teams.
Moonfrog is considering Apache Iceberg for data lake tables currently stored as Parquet files. The table format would add capabilities such as schema evolution and time travel. The team will evaluate these changes alongside performance and operating requirements.
The team also plans to evaluate broader natural language access. Governance must define which teams can access each table and how exploratory queries share cluster resources. End-to-end agent response time will need separate measurement.
Conclusion
Moonfrog migrated its 148 TB production Amazon Redshift warehouse from five RA3 nodes to RG using elastic resize, then settled on six nodes after eight days of measured right-sizing. RA3 had run reliably. The change addressed growing analytics demand and the need for more frequent warehouse loads. COPY duration fell from 16.8 seconds to 3.6 seconds at unchanged volume immediately after cutover.
With six RG nodes, Moonfrog handled more than 125,000 daily queries across all types from September onward, over 2.5 times the RA3 baseline. Average CPU utilization was 35–39%. More frequent COPY batches contributed to the change in query mix. External queries continued with no separate Spectrum scanning charge, and concurrency scaling provided burst capacity alongside the reserved nodes.
To evaluate RG for your warehouse, review Amazon Redshift pricing, the elastic resize documentation, and the RA3 to RG migration best practices. Establish a baseline and test representative workloads in a non-production environment first. Validate warehouse and data lake access, then compare total spend and cost per unit of work before committing to reserved capacity.
Aderant, a global provider of business management software for the legal industry, modernized the data pipeline powering its Stridyn analytics tool using Apache Iceberg, AWS Lambda, and AWS Glue. The new architecture delivers near real-time data availability for 700 client environments across 266 source tables. It replaces a batch-oriented pipeline that took 15 minutes per processing cycle with an event-driven system that processes change data capture (CDC) events in single-digit seconds.
In this post, we share how Aderant redesigned its multilayer data pipeline using a medallion architecture (bronze, silver, and gold layers) built on Apache Iceberg tables. This approach achieved 10–26x faster query performance and a 77 percent cost reduction compared to alternative approaches. We include architecture details, performance benchmarks, and the decision framework so that analytics teams managing multi-tenant SaaS tools can apply the same pattern.
The challenge: Batch processing limiting analytics freshness
Aderant’s Stridyn analytics application serves 700 client environments running Expert Sierra, its cloud-based legal practice management solution. The tool processes data from 266 source tables in Microsoft SQL Server databases, delivering financial reports, billing analytics, and operational dashboards to law firms globally.
The existing pipeline faced several challenges:
Slow processing times. A full data processing cycle took approximately 15 minutes, with batch job overhead adding latency before data transformation could begin.
Limited real-time data availability. Clients experienced delays between operational changes and analytics visibility, impacting time-sensitive billing and matter management decisions.
Performance issues with complex queries. Reports involving window functions, joins across multiple fact tables, and common table expressions (CTEs) suffered from slow response times when querying external tables through Amazon Redshift Spectrum.
Scalability constraints. The architecture struggled to handle custom data, schema changes, and a growing volume of CDC events that already reached 380 million per month across all tenants.
The catalyst for modernization came from Aderant’s commitment to delivering near real-time data availability, making sure data is accessible within minutes from source to target without changing the end-user experience.
The solution: Event-driven medallion architecture with Apache Iceberg
Aderant built a new data pipeline using a medallion architecture with three distinct layers (bronze, silver, and gold), all built on Apache Iceberg tables stored in Amazon Simple Storage Service (Amazon S3). The architecture uses AWS Lambda for event-driven CDC processing, AWS Glue for transformations, and Amazon Redshift for the final analytics serving layer.
How it works: The lifecycle of a data change
The following steps describe what happens when a record changes in a client’s source database.
CDC capture and delivery.AWS Database Migration Service (AWS DMS) captures changes from Microsoft SQL Server databases and writes Parquet files to an S3 landing zone, organized by table and tenant.
Event-driven ingestion (raw to bronze). An S3 event notification triggers an Amazon Simple Queue Service (Amazon SQS) message, which invokes a Lambda function that processes the CDC payload and writes to bronze-layer Iceberg tables in single-digit seconds per event.
Bronze-to-silver transformation. AWS Glue jobs read incremental data from bronze tables using Amazon DynamoDB-based watermarking, apply normalization and deduplication through Iceberg MERGE operations, and produce current-state silver tables with ACID adherence.
Silver-to-gold aggregation. The gold layer uses two approaches based on table complexity: incremental AWS Glue jobs for 77 standard gold tables, and materialized views with Iceberg snapshot comparison for 34 tables with complex query patterns that cannot be easily incrementalized.
Gold-to-Amazon Redshift delivery. Delta changesets from materialized view snapshots are written to native Amazon Redshift tables, where columnar storage, zone maps, and sort keys deliver sub-100-millisecond query performance for end-user dashboards.
Why Apache Iceberg
Aderant chose Apache Iceberg as the table format across all pipeline layers for three reasons.
ACID transactions for concurrent operations. With 700 tenants generating CDC events simultaneously, Iceberg’s snapshot isolation helps prevent conflicts when multiple Lambda functions write to the same tables concurrently.
Time travel and snapshot comparison. For the 34 complex gold tables, Iceberg’s snapshot metadata identifies deltas without manual watermarking. The system compares consecutive snapshots to determine exactly which rows changed, then writes only those deltas to Amazon Redshift.
Schema evolution without pipeline disruption. As Aderant onboards new data sources and clients customize their schemas, Iceberg handles column additions and type changes without requiring full table rebuilds.
Why AWS Lambda for CDC processing
After evaluating three architectural approaches, the team chose Lambda based on cost, latency, and operational simplicity. The Docker container image deployment model (using Amazon Elastic Container Registry) accommodates the large library dependencies required for Iceberg operations, including PyIceberg and pandas. The pay-per-invocation model also aligns naturally with CDC workloads, where event volume fluctuates throughout the day, scaling to zero during quiet periods and handling 10x seasonal spikes without pre-provisioned capacity.
Architecture
The following diagram illustrates the end-to-end data flow from source databases through the medallion layers to the analytics serving layer.
Figure 1: End-to-end data flow through the medallion architecture, from source databases to the Amazon Redshift serving layer
The pipeline begins at the source layer, where AWS DMS replicates CDC events from Microsoft SQL Server databases into an Amazon S3 landing zone as Parquet files. When new files arrive, Amazon S3 Event Notifications publish messages to an Amazon SQS queue. The queue serves as a buffer to handle burst traffic and provides dead-letter queue capabilities for failed events.
AWS Lambda functions, deployed as Docker containers through Amazon Elastic Container Registry (Amazon ECR), consume messages from the SQS queue and write to bronze-layer Iceberg tables in Amazon S3. These Lambda functions use the PyIceberg library to perform ACID-aligned writes, and Amazon DynamoDB stores watermark state to track processing progress and help prevent duplicate writes. The AWS Glue Data Catalog registers Iceberg table metadata across the bronze, silver, and gold layers.
Amazon EventBridge triggers the next stage on a 5-minute schedule, invoking a decision Lambda function that checks whether bronze-to-silver AWS Glue jobs should run based on data availability. When new data is present, AWS Glue 5.0 jobs (running Apache Spark 3.5 on Python 3.11) read incrementally from bronze tables. These jobs apply MERGE operations for deduplication and normalization, then write clean records to silver-layer Iceberg tables. DynamoDB watermarks make sure each AWS Glue job processes only new data since its last successful run.
The silver-to-gold transition follows two paths. For the 77 standard gold tables, Amazon EventBridge detects the completion of bronze-to-silver jobs and triggers a second decision Lambda. That Lambda launches incremental AWS Glue jobs that write directly to Amazon Redshift native tables through the Amazon Redshift Data API. For the 34 complex gold tables, AWS Glue materialized views perform the transformation in SQL. A separate AWS Glue job compares Iceberg snapshots to extract only the changed rows and writes those delta changesets to Amazon Redshift native tables.
Amazon Redshift Serverless serves as the final analytics layer, where native tables with columnar storage, zone maps, and sort keys deliver sub-100-millisecond query latency. A GraphQL Data API layer sits between Amazon Redshift and the end-user dashboards, serving 42 pre-built reports including financial statements, billing analytics, and firm overview dashboards.
Amazon CloudWatch provides end-to-end observability across pipeline components, with custom metrics tracking processing latency, error rates, and throughput per tenant. AWS Identity and Access Management (IAM) enforces least-privilege access, and S3 data is encrypted using AWS Key Management Service (AWS KMS) with server-side encryption. The entire infrastructure is defined in Terraform and deployed through GitHub Actions continuous integration and continuous delivery (CI/CD) pipelines.
Materialized views: Solving the complex query problem
A notable aspect of the architecture is how Aderant handles the 34 gold tables that involve complex SQL patterns: LAG/window functions, joins across multiple fact tables, UNIONs with aggregations, and CTEs.
For these tables, traditional incremental processing would require redesigning each query’s logic. Instead, the team uses AWS Glue materialized views as an intermediate step:
Create materialized views using standard Spark SQL (CREATE MATERIALIZED VIEW AS SELECT ...) against silver-layer Iceberg tables.
Automatic change tracking through Apache Iceberg, which monitors source table changes without manual watermarking.
Scheduled refresh every 2–5 minutes through AWS Glue jobs (bypassing the 1-hour minimum for automatic refresh).
Delta extraction by comparing Iceberg snapshots between refreshes.
Write to Amazon Redshift only the changed rows as native table updates.
This approach alleviates the need to rewrite complex analytical queries while still achieving incremental processing. The materialized view handles the computational complexity, and Iceberg’s snapshot comparison identifies what changed.
Quantifiable results
The architecture improvements delivered measurable gains across three dimensions: query performance, pipeline latency, and infrastructure cost.
Query performance
The team benchmarked 16 analytical queries, ranging from simple aggregations to complex pivots over 9 million rows, comparing Amazon Redshift native tables against external tables queried through Amazon Redshift Spectrum. Across all query types, native tables delivered 10–26x faster response times, consistently returning results in under 100 milliseconds regardless of dataset size. The largest improvement came on smaller, frequently accessed datasets (25.8x speedup), while complex pivot queries with window functions still achieved a 13.7x improvement. These benchmarks were conducted on Amazon Redshift Serverless at 16 RPU, meaning provisioned clusters with dedicated compute and persistent caching would perform even better.
The team also validated Amazon S3 Express One Zone for workloads that remain on S3-based Iceberg tables without Amazon Redshift. It reduced query latency by 31–78 percent compared to Amazon S3 Standard, with the greatest gains on complex queries involving multiple table scans.
Pipeline latency
The largest operational improvement is end-to-end processing time. The previous pipeline required approximately 15 minutes per full processing cycle. The new event-driven ingestion layer processes CDC events without batch job overhead. CDC events now flow from source database to bronze-layer Iceberg tables in single-digit seconds. Gold layer refreshes complete in under 5 minutes for initial loads and under 1 minute for incremental updates. The system sustains throughput of 186,000+ events per second across all 266 tables and 700 tenants.
Infrastructure cost
By choosing Lambda-based event processing over streaming alternatives, Aderant achieved a 77 percent reduction in pipeline compute costs. The serverless, pay-per-invocation model scales to zero during quiet periods and handles 10x seasonal spikes without pre-provisioned capacity, keeping costs proportional to actual data volume rather than reserved infrastructure.
In production: Multi-tenant operations
The architecture runs in production today, processing data for 700 client environments across 266 source tables. Three aspects of the implementation stand out.
Tenant isolation with shared infrastructure. Each tenant’s CDC events flow through the same Lambda functions and AWS Glue jobs, but Iceberg’s partition-by-tenant structure maintains data isolation. Configuration files drive per-tenant behavior without code changes.
Graceful handling of complex reports. The Expert Bill Report, one of Aderant’s most complex analytical outputs involving multiple dimension tables and fact aggregations, processes 900,000 records in approximately 5 minutes for initial load, with subsequent incremental runs handling only changed records in seconds.
Self-healing watermark management. DynamoDB-based watermarks track the last processed timestamp per table per tenant. If a Lambda function fails, the watermark remains unchanged, and the next invocation reprocesses from the correct point, providing exactly-once semantics without complex distributed transaction logic.
Looking ahead
Aderant plans to continue expanding the tool’s capabilities.
Streaming analytics for high-volume tenants. The Lambda-based architecture supports a hybrid model where tenants with the highest event volumes can migrate to Amazon Kinesis streaming for sub-second latency, while standard tenants remain on the cost-effective Lambda path.
AI-powered analytics. Integration with Amazon Bedrock for natural language querying of the gold layer, so law firm users can ask questions about their billing and matter data conversationally.
Automated data quality. Expanding the validation framework to continuously monitor data consistency between pipeline layers, with automated alerting when discrepancies are detected.
Conclusion
Aderant’s journey from batch-oriented data processing to an event-driven, Iceberg-based pipeline demonstrates what is possible when you combine modern open table formats with serverless compute. The new architecture processes CDC events in single-digit seconds instead of 15-minute batch cycles. It delivers 10–26x faster query performance through native Amazon Redshift tables and reduces infrastructure costs by 77 percent compared to streaming alternatives.
The key insight is that not every table needs the same processing strategy. Aderant uses incremental AWS Glue jobs for straightforward tables and materialized views with Iceberg snapshot comparison for complex analytical patterns. This approach delivers near real-time freshness across all 111 gold tables without rewriting complex SQL logic.
For analytics teams managing multi-tenant SaaS tools, Aderant’s experience shows the value of Apache Iceberg. Its ACID alignment, time-travel capabilities, and schema evolution support make it a strong foundation for production data pipelines at scale.
This post is co-authored with Tunde Fowora, Principal Architect at United Airlines. United Airlines, headquartered in Chicago, IL, United States, is the world’s largest airline based on revenue passenger miles, according to United Airlines.
In this post, we explore how United Airlines adopted Apache Iceberg for large-scale data processing while managing near-real-time data synchronization from transactional databases.
United Airlines needed to replicate frequently changing reference data in near-real-time from an operational Amazon Aurora MySQL-Compatible Edition (Aurora MySQL) database to a new cloud-native analytics system built on Apache Iceberg, during a multi-year modernization. Until that migration completed, changes in the source database still had to reach analysts and downstream systems within minutes. The legacy batch process could not keep pace, so teams analyzed market patterns on stale data, which delayed business decisions.
To meet that need, United Airlines built a near-real-time Change Data Capture (CDC) pipeline using Amazon Kinesis Data Streams (Kinesis Data Streams), AWS Lambda (Lambda), Amazon Data Firehose (Firehose), and Apache Iceberg on Amazon Simple Storage Service (Amazon S3) to ingest database change events emitted from a database CDC engine. At United, database CDC is implemented using the AWS Database Migration Service (AWS DMS) CDC engine. Moving to Iceberg removed the scalability limits of the legacy SQL databases. Queries scanning more than 10 million rows no longer hit those bottlenecks, and several hundred business analysts could run complex queries across a broader data domain. In United’s testing, average query latency improved 5x. Because those queries run inside downstream AWS Glue extract, transform, and load (ETL) jobs, total job processing time dropped 2x while reducing billed AWS Glue run time. Once landed in Iceberg tables, the data is queryable from AWS Glue, Amazon Redshift, and Amazon Athena. Any Iceberg-compatible engine can access the data.
The streaming layer is what keeps this pattern straightforward to operate. Amazon Data Firehose reads the change events from Kinesis Data Streams, writes them to the Iceberg table as Parquet files, applies each insert, update, and delete, and commits a new table snapshot. You don’t build a separate application or manage servers for that delivery step. Kinesis Data Streams can also run in on-demand mode, which scales capacity automatically as change volume grows.
In this post, you’ll learn how to reproduce this approach for your own high-volume CDC requirements, including AWS CloudFormation automation, Amazon CloudWatch monitoring, and performance trade-offs. This architecture is valuable for any industry that needs near-real-time analytics on transactional data, such as financial services, retail inventory management, and travel and hospitality revenue optimization.
Note on this walkthrough: The following is grounded in United Airlines’ pre-production implementation but is intentionally simplified so you can reproduce it quickly. Read these points before you begin:
CDC engine: United Airlines runs this pipeline on standard (provisioned) AWS DMS. Use any CDC engine that can write change events to Kinesis Data Streams and supports your source database. For simplicity, this walkthrough and the accompanying template use AWS DMS Serverless, which removes replication-instance sizing and management. In this walkthrough, AWS DMS writes each change to Kinesis Data Streams as a record that holds the row data plus metadata such as the schema name, table name, and operation type. The downstream pipeline, from Kinesis Data Streams through Iceberg, stays the same whatever engine you pick. The AWS Lambda transform is the one engine-specific piece: it parses the CDC engine’s record format and emits the destination database, table, and operation that Firehose needs to route each record (Route incoming records to different Iceberg tables), so you rewrite it when you change engines.
Query engine: At United Airlines, analysts primarily use Amazon Redshift Serverless. This walkthrough uses only Amazon Athena for validation, to keep the steps focused. Because the data lands in open Apache Iceberg tables cataloged in the AWS Glue Data Catalog, the same data layer is queryable from multiple engines, including AWS Glue, Amazon Redshift, and Amazon Athena.
Scope of the template: The provided AWS CloudFormation template is a simplified, representative view of what United Airlines built, not the complete production solution. Its purpose is to give you a working starting point that you can adapt and make your own. It is not intended to cover every automation, hardening, or operational requirement.
Operational settings: The template uses demo values, not production-tuned ones. It logs at debug level in the CDC engine and uses four provisioned Kinesis shards with 24-hour retention that aren’t sized for a specific throughput. For variable workloads, consider on-demand capacity mode. The Firehose Iceberg destination uses a 1 MB, 3-second buffer and a 300-second retry duration so results appear quickly in the demo. A short buffer commits a snapshot and delete files every few seconds. Before production use, review buffering, error handling, and monitoring in Set up the Firehose stream, Handle failure in data transformation, and Considerations and limitations for Apache Iceberg tables.
Single-table scope: The provided template replicates one source table (a single CDC engine selection rule mapped to one Iceberg destination table). Replicating additional tables requires extending the template. Use it at your own discretion.
Schema evolution: Enterprise workloads often need to handle source schema changes made with data definition language (DDL) statements over time. That is not covered by this walkthrough. Firehose handles source schema changes as described in Considerations and limitations for Apache Iceberg tables. If a source record has a new field that isn’t in the table, but all other column names and data types match, Firehose skips the new field. If column names or data types don’t match, Firehose returns an error and sends the record to the S3 error bucket. At United Airlines, schema evolution is handled outside of this architecture pattern, not in the Lambda transform.
Solution walkthrough
The following demonstrates how to implement near-real-time Change Data Capture (CDC) replication from Aurora MySQL to Apache Iceberg using AWS managed services. The solution uses a managed, event-driven architecture. CloudFormation automates the replication pipeline, while you manually configure the source and destination endpoints.
Figure 1 shows the services that make up the near-real-time data replication pipeline:
Figure 1: Architecture overview
Data flow:
The CDC engine captures changes from Aurora MySQL by reading the binary log.
Amazon Kinesis Data Streams receives and buffers the CDC events.
Amazon Data Firehose reads from the stream and batches records.
Firehose invokes an AWS Lambda function, coded for the CDC engine’s record format, to transform each batch.
Firehose writes Parquet data files to the Apache Iceberg table in Amazon S3.
Firehose commits each write as a new Iceberg snapshot, which updates the table’s metadata pointer in the AWS Glue Data Catalog.
Amazon Athena and Amazon Redshift Serverless look up table metadata in the Data Catalog and read the data files from Amazon S3.
The solution architecture can be divided into the following areas:
Data ingestion and streaming
The CDC engine captures changes from an Aurora MySQL database with minimal impact on the source database. Changes stream continuously to Amazon Kinesis Data Streams, which provides durable, scalable real-time data streaming and acts as a buffer between source replication and downstream processing.
Amazon Data Firehose consumes data from Kinesis Data Streams, performing data transformation and batching to prepare data for efficient storage. It reduces infrastructure management overhead while batching records efficiently based on the configured buffer size and interval.
The Firehose buffer interval sets the trade-off between latency and cost. In a low-volume test of about 120 rows, United set the buffer interval to 1 second and saw end-to-end latency as low as 10 seconds. For a large initial load of about 1.5 million rows, United used a 60-second interval in their environment to balance latency, cost, and file size, and the load completed in about 2 hours 22 minutes (about 176 rows per second). United measured these latencies manually against average row throughput.
Processing and storage
An AWS Lambda function processes streaming data in near-real-time. It works in tandem with Amazon Data Firehose (Firehose) to parse CDC event records, extract operation types (INSERT/UPDATE/DELETE), and convert records to the Iceberg-compatible format with the appropriate operation field. Amazon Data Firehose then commits the writes as ACID-compliant (Atomicity, Consistency, Isolation, and Durability) Iceberg snapshots using optimistic concurrency control, updating table metadata automatically. Lambda and Firehose scale with the stream, but the template’s provisioned Kinesis shards and DMS capacity range (1–2 DMS capacity units (DCUs)) are fixed limits.
Firehose applies CDC operations to the Iceberg table using the merge-on-read (MOR) approach: an UPDATE or DELETE is written as a delete file plus, for an update, a new data file, which the query engine merges at read time to resolve the current row state (see Prerequisites to use Apache Iceberg Tables as a destination). This requires the Iceberg table to be format-version 2 and a unique key, which the template sets on the delivery stream.
The template defines no DMS partition-key rule, so DMS uses the schema and table name as the Kinesis partition key and every change for the table lands on one shard, so the other three shards stay idle and throughput is limited to what one shard supports. To spread load and keep per-row order, set the partition key to the table’s primary key in a DMS object-mapping rule (Kinesis as a DMS target). The Lambda function in the template passes each row through and adds the destination table and operation that Firehose uses to insert, update, or delete it.
The self-managed Apache Iceberg tables on Amazon S3 store data in columnar Parquet format, providing durability, scalability, and cost-effective storage. United Airlines pre-creates the Iceberg tables using Amazon Athena, which now hold over 2 TB of data.
Metadata and analytics
AWS Glue Data Catalog serves as the centralized metadata repository, storing Apache Iceberg table metadata, maintaining schema versions and partition information, and supporting schema evolution and governance across the organization.
Amazon Redshift Serverless queries the same Iceberg tables through the AWS Glue Data Catalog. You can reference the table through the auto-mounted awsdatacatalog database (awsdatacatalog.market_db.market_rule) or create an external schema on the Glue database. See Referencing Iceberg tables in Amazon Redshift.
Amazon Athena queries the same tables through the Glue Data Catalog (Query Apache Iceberg tables), with pay-per-query SQL access for ad hoc analysis and data validation and no infrastructure to manage. In our walkthrough test, an UPDATE and a DELETE at the source returned the correct current rows from both Athena and Redshift Serverless.
Solution creation
Prerequisites
Before you begin, make sure you have:
Source database: An Amazon Aurora MySQL cluster with binary logging enabled. Extensibility to other database engines depends on the CDC engine choice. In this example, AWS DMS supports DMS-compatible sources such as PostgreSQL, Oracle, SQL Server, and others. See AWS DMS source documentation. Also, create a secret using AWS Secrets Manager to connect to the database. The secret must contain the Aurora connection details (username, password, host, and port). Note its Amazon Resource Name (ARN), which you will use in Step 2 and as the DmsSourceSecretArn CloudFormation parameter. Create it manually because the Aurora-managed secret omits host and port and will not work with DMS. Also create an IAM access role that DMS can assume to read this secret: give it a trust policy allowing the regional DMS service principal dms..amazonaws.com (for example, dms.us-east-1.amazonaws.com) to assume it, and a permissions policy granting secretsmanager:GetSecretValue on the secret’s ARN. You will attach this role to the source endpoint in Step 2. This walkthrough and template implement the CDC layer with AWS DMS, so the Secrets Manager secret and access role here are DMS-specific. A different CDC engine may authenticate differently and would need corresponding changes.
Network connectivity: A virtual private cloud (VPC) with private subnets where the Aurora MySQL cluster and the replication resources can reach each other, with security group rules allowing access on the database port (3306). Because DMS Serverless runs inside your VPC with no public IP, create a Kinesis Data Streams VPC interface endpoint (com.amazonaws..kinesis-streams) so the replication can reach the Kinesis target. Because the source endpoint authenticates with a Secrets Manager secret, also create a Secrets Manager interface endpoint (com.amazonaws..secretsmanager). Finally, the Aurora cluster’s own security group must allow inbound MySQL (TCP 3306) from the replication’s security group, since the cluster is outside the CloudFormation stack.
AWS permissions: AWS Identity and Access Management (IAM) permissions to create the resources in the stack: the DMS target endpoint and Serverless replication config, Kinesis stream, Lambda function, Firehose delivery stream, CloudWatch log groups, an AWS Key Management Service (AWS KMS) key, and the three IAM service roles (requires CAPABILITY_NAMED_IAM) plus the CloudFormation stack itself. Because the stack creates IAM roles, the deploying identity also needs iam:CreateRole/PutRolePolicy and iam:PassRole so CloudFormation can attach roles to their respective resources during creation.
AWS Command Line Interface (AWS CLI): Installed and configured with appropriate credentials.
Step 1: Configure source database
Assumption: You have an existing Amazon Aurora MySQL cluster. This step is not automated by CloudFormation. This walkthrough was tested on Aurora MySQL version 3.08.0 (compatible with MySQL 8.0).
All SQL in this step (the binlog retention command, the verification query, and the schema and seed statements) runs against your Aurora MySQL database as the admin user, using any MySQL client (or the RDS Data API if the cluster is private). The parameter-group settings in items 1–2 are configured in the RDS console or CLI.
Configure binary logging:
1. In a custom DB cluster parameter group, set binlog_format = ROW, binlog_row_image = FULL, and binlog_checksum = NONE. On Aurora MySQL these come from the cluster parameter group and cannot be set with SET GLOBAL.
2. Associate the parameter group with your cluster if it isn’t already, then reboot the writer instance. binlog_format is a static parameter, so binary logging turns on only after the reboot.
3. Set the binlog retention window on the writer: CALL mysql.rds_set_configuration('binlog retention hours', 24); Set this longer than the longest time the replication might be stopped. Aurora MySQL version 3 allows up to 2,160 hours, or 90 days (Setting up binary log replication). DMS Serverless doesn’t support custom CDC start points (AWS DMS Serverless limitations), so if the replication stays stopped longer than this window, you must restart it with a full reload.
4. Make sure the DMS database user has the REPLICATION CLIENT and REPLICATION SLAVE privileges (see the following note).
Note: For simplicity this walkthrough uses the Aurora admin user for both the Step 1 SQL and the DMS source endpoint, so the “DMS user” in the preceding step is that same admin user, which already holds these privileges. In production, create separate least-privilege users per job. For example, a dedicated DMS replication user with only REPLICATION CLIENT, REPLICATION SLAVE, and SELECT on the source table.
After the reboot, confirm the settings on the writer:
SHOW VARIABLES WHERE Variable_name IN
('log_bin', 'binlog_format', 'binlog_row_image', 'binlog_checksum');
Expect log_bin = ON, binlog_format = ROW, binlog_row_image = FULL, and binlog_checksum = NONE. The log_bin = ON check is the important one as it confirms binary logging is actually active (which requires the reboot to have taken effect), not merely that the format is configured. If log_bin is OFF, confirm the parameter group is associated with the cluster and reboot the writer before continuing.
If your database and tables are not already created in the source database, you may create them using the following SQL commands:
CREATE DATABASE market_db;
USE market_db;
CREATE TABLE market_rule (
rule_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(120) NOT NULL,
weight INT NOT NULL DEFAULT 0,
status VARCHAR(10) NOT NULL DEFAULT 'DRAFT',
effective_from DATETIME(6) NOT NULL,
market_from VARCHAR(30) NOT NULL,
market_to VARCHAR(30) NOT NULL,
created_at DATETIME(6),
updated_at DATETIME(6)
);
Insert two sample rows so the full-load phase has data to replicate and the Step 6 validation returns results:
Note: For non-MySQL sources, refer to source-specific CDC configuration in the CDC engine documentation (AWS DMS documentation in this example).
Figure 2 shows how to verify the results of Step 1:
Figure 2: Confirmation of binlog activation
Step 2: Create CDC engine source endpoint
Assumption: Your VPC networking and security groups allow the replication resources to reach the Aurora MySQL cluster on port 3306 (see Prerequisites). This step is manual and must be completed before you deploy the CloudFormation stack.
Navigate to AWS DMS Console, then Endpoints, then Create endpoint.
Configure:
Endpoint type: Source endpoint
Endpoint identifier: mysql-source-endpoint
Source engine: Amazon Aurora MySQL
Server name: Your Aurora cluster writer endpoint
Port: 3306 (or appropriate port)
User credentials: reference the Secrets Manager secret and the access role you created in Prerequisites (recommended). Alternatively, you enter the username and password directly on the endpoint instead of using a secret and role.
SSL mode: This walkthrough leaves SSL mode at none, the default for Aurora MySQL endpoints, so the connection between the DMS CDC engine and Aurora isn’t encrypted. For production, set SSL mode to verify-ca or verify-full and attach the Amazon RDS CA certificate (Using SSL with AWS Database Migration Service). On Aurora MySQL version 8.4, require_secure_transport is on by default and rejects SSL mode none, so you must enable SSL.
Figure 3: Confirmation of DMS endpoint connection
Save the endpoint ARN. You’ll need it as the DmsSourceEndpointArn CloudFormation parameter. You’ll also need the ARN of the Secrets Manager secret this endpoint uses (from Prerequisites) as the DmsSourceSecretArn parameter.
Step 3: Set up VPC infrastructure
Assumption: You have an existing VPC with private subnets. These resources are not created by CloudFormation.
First-time DMS setup: If you have never created a DMS subnet group in this account, AWS requires a service role named exactly dms-vpc-role (with a trust policy for dms.amazonaws.com and the AWS-managed policy AmazonDMSVPCManagementRole) so DMS can manage the replication network interfaces. Create it once before the next step. Without it, creating the subnet group fails with an “IAM Role dms-vpc-role is not configured properly” error. The AWS Management Console usually creates this role automatically the first time. If you use the CLI or API, create it explicitly.
Create DMS subnet group:.
DMS Console, then Subnet groups, then Create subnet group
Select at least 2 private subnets in different Availability Zones
Save the subnet group ARN (arn:aws:dms:<region>:<account-id>:subgrp:<subnet-group-name>)
Create security group (for the DMS replication):.
EC2 Console, then Security Groups, then Create security group
Inbound: HTTPS (443) from your VPC CIDR, so the replication can reach the interface endpoints
Outbound: allow HTTPS (443) to AWS services and MySQL (3306) to the Aurora cluster (the default “all traffic” outbound also works)
Save the security group ID
Then, on the Aurora cluster’s security group, add an inbound rule: MySQL (3306) from this DMS security group
Create VPC endpoints (required because the replication runs privately with no internet access):.
VPC Console, then Endpoints, then Create endpoint
Create an interface endpoint for Kinesis Data Streams: service com.amazonaws..kinesis-streams. Select your private subnets. Attach the DMS security group. Enable Enable DNS name (private DNS)
Create an interface endpoint for Secrets Manager: service com.amazonaws..secretsmanager. Same subnets, same security group, private DNS enabled
The interface endpoints show Pending briefly, then Available
Step 4: Create destination infrastructure
Assumption: These resources must exist before CloudFormation deployment. They are not automated. Athena must be set up with a results bucket prior to executing these steps. If the table’s S3 location is registered with AWS Lake Formation, create the table before you register it. Athena doesn’t support DDL on Iceberg tables whose location is registered with Lake Formation (Considerations and limitations for querying data registered with Lake Formation).
The commands in items 1 and 2 are run from the AWS CLI.
1. Create the S3 bucket: Replace amzn-s3-demo-bucket throughout with a globally unique bucket name of your own as S3 bucket names are global, so the literal example name will not be available. Use that same name in the Glue table LOCATION (step 3) and in the CloudFormation S3BucketName parameter (Step 5)
2. Create the AWS Glue Data Catalog database: Note this is a different resource from the Aurora market_db you created in Step 1. The names match by convention, but the Aurora database holds your source data while this Glue Data Catalog database registers the Iceberg destination table:
3. Create Iceberg table: Run the following in the Amazon Athena query editor (this is Athena DDL, not MySQL). Athena creates the Iceberg table and registers it in the AWS Glue Data Catalog:
After Step 4, the AWS console should look like Figure 4.
Figure 4: Confirmation of Iceberg table creation
Step 5: Deploy CloudFormation stack
What CloudFormation automates: The template provisions the complete replication pipeline: the Kinesis stream, DMS Serverless replication, Lambda function, Firehose delivery stream, IAM roles, and CloudWatch logs.
What CloudFormation does NOT create: Source endpoint, VPC infrastructure, S3 bucket, AWS Glue database, or Iceberg table (created in steps 1–4).
Lake Formation prerequisite: If your account uses AWS Lake Formation permissions for the AWS Glue Data Catalog instead of the IAM-only default (Changing the default settings for your data lake), the Firehose delivery stream’s role must be authorized in Lake Formation to access the Iceberg table created earlier. Otherwise stack creation can fail. In that case, before deploying, either grant the Firehose role Lake Formation ALL (in production, stick to granting only the minimum permissions needed rule) permissions on market_db.market_rule, or switch that database and table to IAM-based access by granting IAM_ALLOWED_PRINCIPALS ALL permissions. With IAM_ALLOWED_PRINCIPALS, IAM policies alone control access to those resources, which weakens Lake Formation governance.
Lambda Function (Python 3.14) for CDC transformation.
Data Firehose Delivery Stream with Iceberg destination.
IAM Roles.
KMS Key (CloudWatch log encryption)
CloudWatch Log Groups.
When deployment finishes, the stack status shows CREATE_COMPLETE, as in Figure 5.
Figure 5: CloudFormation stack in CREATE_COMPLETE status
Step 6: Validate CDC engine replication
Assumption: CloudFormation has completed successfully.
DMS Console → Migrate or replicate → Tasks → select your task → Actions → Start. Start the replication (it moves through several provisioning states before reaching Running)
Starting the task opens a Start task screen with a premigration assessment option (and a CDC stop-mode setting). You can leave the assessment enabled to pre-check prerequisites, or turn it off for a quick start. Either way, choose Start task. The task then provisions serverless capacity before it begins loading. Note: it is observed that serverless capacity provisioning can take up to about 40 minutes on first start. The task shows “Provisioning capacity” during this time. This is normal, not a failure.
Monitor Table statistics within the replication’s detail view:
After Step 6, the AWS DMS console shows the full-load results in Figure 6.
Figure 6: DMS full load completed with 2 total rows
DMS Table statistics: market_rule, Table completed, Total rows 2.
Validation using Athena: Run SELECT * FROM market_db.market_rule. In the Athena query editor and confirm the row count matches the DMS full-load count (2), as shown in Figure 7. This confirms the rows reached the Iceberg table, not just the Kinesis target.
Figure 7: Athena returns both rows from the Iceberg table, matching the CDC engine full-load count
Step 7: Generate a CDC event
Assumption: Full load is complete and the replication task shows “Load completed, replication ongoing.” This step creates a live change so you can observe it flow through the pipeline in the following steps.
Insert a test record into the source Aurora MySQL database (using the same query editor or client you used in Step 1):
The CDC engine captures this change from the binary log and streams it through the pipeline. Figure 8 shows the CDC engine table statistics after the insert. The following steps verify the change at each stage: Lambda, Firehose, and Athena.
Figure 8: CDC engine table statistics after the CDC insert (3 total rows, 1 insert)
Step 8: Verify Lambda transformation
Assumption: You performed the CDC insert in Step 7. This is a console validation step.
Verify: Invocations registered, Error count 0, Success rate 100%. Logs show CDC operation detection (INSERT/UPDATE/DELETE) and successful record transformation, no errors.
After Step 8, the Lambda Monitor tab should look like Figure 9.
Figure 9: Lambda Monitor tab showing a 100% success rate and zero errors after the CDC insert
Step 9: Monitor Firehose delivery
Assumption: Lambda is successfully processing records. This is a console validation step.
Data Firehose Console → Delivery streams → select your stream.
Monitoring tab, verify that Incoming records show data flow from Kinesis, Delivery to Iceberg – Success matches incoming, Failed = 0, and DataFreshness stays steady rather than climbing. A rising value means Firehose is falling behind.
After Step 9, the Firehose Monitoring tab should look like Figure 10.
Figure 10: Firehose delivery metrics for the CDC insert, showing 100% delivery success, one row delivered, and zero failed rows
Confirm the change in Athena. After Firehose delivers the record (see the preceding data freshness metric), query for it:
SELECT * FROM market_db.market_rule WHERE name = 'SYD-MEL Easter Peak';
Validation: The new record appears in the Iceberg table, confirming near-real-time CDC replication.
Figure 11: Athena returns the row inserted in the source database
Optional: test UPDATE and DELETE on the source (for example, UPDATE market_rule SET weight = 120 WHERE rule_id = 3; and DELETE FROM market_rule WHERE rule_id = 1;), then query the table from Amazon Athena and Amazon Redshift Serverless (SELECT * FROM awsdatacatalog.market_db.market_rule;) to confirm both return the current rows.
Step 10: Set up monitoring dashboard
Assumption: All components are operational. This is an optional step for ongoing monitoring.
Create a CloudWatch dashboard with these metrics:
AWS DMS: CDCLatencySource and CDCLatencyTarget, which show how far the replication is behind the source and the target (AWS DMS Serverless components)
Kinesis Data Streams: GetRecords.IteratorAgeMilliseconds, which shows how far Firehose is behind the stream (Recommended alarms)
Firehose: DeliveryToIceberg.DataFreshness and DeliveryToIceberg.FailedRowCount (Monitor metrics)
Set alarm thresholds based on your own latency requirements.
Operational monitoring
After deploying this solution, United Airlines established operational procedures for Iceberg table maintenance to sustain query performance over time. Each Firehose commit creates new data files, and every update also writes a delete file, so a high-traffic table accumulates many small files that slow reads. To manage this, you can enable automatic compaction in the AWS Glue Data Catalog, or run the Athena OPTIMIZE command to compact files on a schedule. To reclaim storage, use the Athena VACUUM command to expire old snapshots and remove orphan files. The AWS Glue Data Catalog can also perform this table optimization automatically. United Airlines also monitors the health of the CDC replication and has a defined procedure to restart replication and reconcile data if a task stops or fails.
Cost considerations
Important: The resources created in this walkthrough incur charges while running. The following are us-east-1 list prices at the time of writing. Check each pricing page for current rates:
AWS DMS Serverless: $0.0819 per DCU-hour for Single-AZ and $0.1639 for Multi-AZ. The template deploys Multi-AZ with 1–2 DCUs, so about $0.16–$0.33 per hour while the replication runs (AWS DMS pricing).
Kinesis Data Streams: $0.015 per shard-hour ($0.06 per hour for the template’s four shards), plus $0.014 per million PUT payload units (Kinesis Data Streams pricing).
Firehose: $0.045 per GB for Iceberg delivery with Kinesis Data Streams as the source (first 250 TB per month). Any extra bytes added by the Lambda transform are billed at the same rate (Amazon Data Firehose pricing).
Amazon S3: storage for data and metadata files, plus PUT requests. Every update writes a delete file, which adds PUT charges (Firehose Iceberg considerations).
VPC endpoints: the Kinesis and Secrets Manager interface endpoints are billed hourly per Availability Zone plus $0.01 per GB processed (AWS PrivateLink pricing).
Table maintenance: if you enable Glue Data Catalog compaction or run Athena OPTIMIZE, those jobs add AWS Glue or Athena charges.
Cleanup
To avoid incurring future charges, delete the resources in this order:
Stop the DMS Serverless replication and wait until its status is Stopped. AWS DMS can delete a serverless replication only when it is stopped or failed (AWS DMS Serverless limitations).
Delete the CloudFormation stack. This removes the replication, the Kinesis target endpoint, the Kinesis data stream, the Lambda function, the Firehose stream, the IAM roles, the KMS key, and the log groups.
Delete the resources you created manually:
The DMS source endpoint (Step 2)
The Kinesis and Secrets Manager interface endpoints, which are billed hourly, the DMS subnet group, and the security group (Step 3)
The Glue table and database. Empty and delete the S3 bucket, including the firehose-errors/ and processing-failed/ prefixes (Step 4)
The Secrets Manager secret and its DMS access role (Prerequisites)
Any Lake Formation grants you added for the Firehose role
The dms-vpc-role, only if you created it for this walkthrough and no other DMS resources use it
The Aurora MySQL cluster and its parameter group, if you don’t want to keep them
Verification: Confirm cleanup completion by checking that the CloudFormation stack shows as deleted and verifying through the AWS Management Console that no billable resources remain active.
Conclusion
This serverless architecture delivers near-real-time replication from Aurora MySQL to Apache Iceberg. United Airlines has seen end-to-end latency as low as about 10 seconds, and you can trade latency against cost by adjusting the Firehose buffer interval. Pay-per-use serverless components keep spend tied to usage, and Iceberg provides ACID transactions and time travel for regulatory requirements. The pipeline scales through managed services, and AWS Glue, Amazon Redshift, and Amazon Athena can all query the same data.
This architecture allowed United Airlines to expand its use of Apache Iceberg for business analytics, improving performance, cost, and data availability, and giving several hundred users of the Revenue Management data platform access to near-real-time reference data.
With biopharma commercial teams facing increasingly complex big data challenges, Veeva used Amazon EMR on EKS to increase speed and efficiency in delivering performance data to biopharma customers, supporting insight generation to find and treat more patients. Therapies designated as “orphan” in the United States that treat rare diseases affecting fewer than 200,000 Americans made up half of U.S. novel drug approvals in 2025, and the continuing shift toward developing therapies for rare and complex disease states only amplifies the need for scalable analytics infrastructure.
Veeva Systems, a leader in cloud-based software for the global life sciences industry, addresses this changing data landscape with Veeva Compass and the Compass Data Network. Compass unifies prescriptions, in-office procedures, and diagnoses into a suite of data products customers use to segment economies with greater precision, prioritize the right healthcare providers, and bring the right therapies to more patients, faster.
Veeva is continuously evaluating and adding new data partners to the Compass network, using both closed and open sources to fill the gaps left by traditional patient data products and meet the biopharma industry’s current and future data needs. To support this ever-growing network, the company undertook an ambitious architecture transformation with Amazon EMR on EKS. Veeva Compass uses faster, more efficient compute to deliver data from suppliers to customers within hours while drastically increasing efficiency by accelerating analytics and supporting AI workflows. This system flags new patient and healthcare provider (HCP) events earlier so that medical reps can engage with healthcare providers at the right time with more precise information.
This post explores the AWS analytics architecture that powers the petabyte-scale elastic big data processing Veeva Compass implemented with Amazon EMR on EKS. Specifically, it explores how Compass avoided execution slowdowns while continuing to increase data volumes to meet customer needs.
The challenges of extracting data insights at petabyte scale
The foundation of Veeva Compass is an analytics lake that was originally designed to process hundreds of terabytes daily. Through years of consistent growth fueled by global customer expansion and the growing gap between legacy data products and industry needs, the Veeva Compass analytics lake grew. It increased support for the number of data sources and Veeva products. This resulted in an exponential growth of data volumes. With the quantity and size of batch jobs becoming more variable, Veeva decided to revisit the original Amazon EMR on Amazon Elastic Compute Cloud (Amazon EC2) architecture.
The batch job variability challenges manifested in a few important ways. Whenever Spark executors ran out of memory, the shuffle stages in Spark were unable to compensate, and executor tasks would spill to disk. This would add hours to overall job execution time with executors relying on disk storage to complete their tasks. A significant portion of the analytics budget was allocated to several provisioned Amazon EMR clusters that were idle during the afternoon waiting for the next series of job runs. To better use these clusters, Veeva distributed jobs across resources. But that led to noisy neighbor challenges where one team’s large join operation would monopolize the cluster and block another team’s service level agreement (SLA)-critical pipeline.
Veeva needed a more scalable solution that could scale out to hundreds of Spark executors in minutes when jobs arrived, then scale in when jobs complete, delivering both performance and cost efficiency. Veeva needed to rethink how it provisioned compute resources and managed Spark workloads.
The solution: Amazon EMR on EKS with Karpenter
Let’s explore how Veeva used Amazon EMR on EKS with Karpenter to scale its analytics capabilities and reduce Spark run times. Amazon EMR on EKS runs each Spark application as an ephemeral job inside Kubernetes, decoupling compute from storage. Data lives in Amazon Simple Storage Service (Amazon S3), durable and accessible. Spark executors run as pods that are created and terminated with each job. With Amazon EMR on EKS, Veeva is no longer dependent on always-on clusters and consumes compute only when needed.
The diversity of data types in the analytics workloads requires fine-grained control to provision the optimal compute nodes for each job. Veeva’s original cluster design relied on pre-configured node groups, where you define instance types and sizes upfront. This approach worked for other Veeva workload profiles, but Spark workloads are different. One job might need memory-optimized instances for wide joins, while another needs compute-optimized nodes for CPU-intensive transformations.
To address this challenge, Veeva added real-time EC2 instance type provisioning using Karpenter. For example, a Spark job might request 800 executors with 16 GB memory and 4 cores each. Karpenter reacts to pending pod requests in 60–90 seconds, analyzes the requirements, selects optimal instance types from across over 20 families, and launches nodes. When the job is complete, those nodes terminate within minutes. Karpenter also handles bin-packing, which is a placement strategy where pods are consolidated into fewer EKS nodes to optimize cost and improve resource utilization.
Amazon EMR on EKS with Karpenter architecture overview
Veeva’s analytics architecture follows a medallion data design pattern. This pattern progressively refines data in stages: bronze (raw), silver (cleaned), and gold (aggregated) layers within the same storage system.
Figure 1: Amazon EMR on EKS architecture spanning the storage, compute, orchestration, and query layers
The architecture comprises four layers:
Storage layer: Amazon S3 stores data across bronze (raw), silver (cleaned), and gold (business-ready aggregated) layers. S3 organizes the data in Delta Lake format with daily partitions and continuous compaction to help prevent small-file proliferation.
Compute layer: Amazon EMR on EKS runs Spark applications as Kubernetes jobs. Each application gets its own isolated set of pods that exist only for the duration of that job.
Orchestration layer: Karpenter watches for pending Spark executor pods and provisions EC2 nodes to run them. It selects instance types based on pod resource requests, Availability Zone (AZ) capacity, and Spot pricing, then terminates nodes when they’re no longer needed.
Query layer: An Amazon EMR on EKS cluster running Trino (formerly PrestoSQL) supports interactive queries against the transformed Delta tables, so analysts can explore petabyte-scale datasets with sub-second response times.
This separation of concerns delivers the elasticity required for petabyte-scale operations.
Spark application layer instance types
Veeva selected three distinct node profiles optimized for different Spark workload characteristics:
Driver nodes: Spark drivers and Airflow workers run on On-Demand Instances for reliability. Drivers coordinate job execution and can’t tolerate interruptions because of Spot instance reclamations. These nodes run continuously but represent less than 5 percent of total compute cost.
Executor nodes: General Extract, Transform, Load (ETL) and memory-intensive joins run on approximately 70 percent Spot Instances. Karpenter spreads across multiple instance families to maximize Spot availability. When interruptions occur, Spark’s checkpointing and Adaptive Query Execution handle recovery automatically.
Shuffle-heavy nodes: Workloads with high shuffle I/O run on NVMe-backed instances. The local SSD storage improves performance when executors spill to disk during wide joins. These run at approximately 50 percent Spot because the NVMe instance families have slightly lower Spot availability.
Partition strategy and tuning for large datasets
With the compute and orchestration layers optimized, Veeva turned its attention to improving the partition strategy, data layout, and Spark configuration.
Partition strategy: Veeva’s data is partitioned by date (YYYY-MM-DD) plus a high-cardinality dimension like region or customer segment. This simplifies partition pruning while avoiding the small-file problems that degrade query performance. Target file size is around 256–512 MB per Parquet file. Nightly compaction jobs use Delta Lake’s OPTIMIZE command with Z-ordering on frequently filtered columns, which improved query performance by 3–5x.
Shuffle and query tuning: Using Adaptive Query Execution (AQE) as a query optimization capability transformed Veeva’s most problematic Spark workload. AQE allows Spark to dynamically adjust the query plan based on runtime statistics rather than relying on static estimates. To enable these dynamic adjustments, enable AQE, configure initial partition counts for wide joins, handle data skew automatically, and enable speculative execution to recover from stragglers.
Additionally, Veeva caches some of the dimension tables in memory to avoid repeated reads from S3. For jobs that reference the same lookup tables multiple times, this optimization reduced runtime by 20–30 percent.
The combination of proper partitioning, continuous compaction, and AQE tuning reduced the skewed join stage run time from 7 hours to 55 minutes.
Observability as the foundational component for Amazon EMR on EKS operations
An observability architecture that monitors the entire stack and delivers operational insights is essential for maintaining SLAs and troubleshooting performance issues before they impact production pipelines.
The observability stack has four layers:
Spark History Server runs on EKS with S3-backed event logs. With Spark History Server, you can replay the entire execution graph, examine stage-level metrics, and identify bottlenecks.
Prometheus and Grafana track real-time metrics. Key metrics include executor CPU and memory utilization, pending-pod queue depth, shuffle-spill ratios, and Karpenter provisioning latency.
Amazon CloudWatch Logs Insights aggregates driver and executor logs with automated alerting. When a job fails, Amazon CloudWatch sends an immediate notification with stack traces and error context.
OpenTelemetry traces link Spark jobs to the broader orchestration layer (Airflow, AWS Step Functions). This end-to-end visibility provides insights into how individual job performance impacts downstream dependencies.
To help proactively identify bottlenecks before they cascade into SLA violations, Veeva configured critical alerts such as pending pods exceeding thresholds indicating capacity constraints, high shuffle-spill ratios signaling memory pressure, and excessive repartitioning indicating significant data skew.
Securing multi-tenant data analytics
Datasets that include prescription and claims data require robust security controls. Veeva’s architecture follows AWS best practices for least-privilege access and strict tenant isolation.
IAM Roles for Service Accounts (IRSA) provide each Spark job with temporary credentials scoped to specific S3 prefixes and AWS Lake Formation permissions. Jobs can read from bronze and silver zones but only write to their designated output paths. Using Kubernetes namespaces with taints and tolerations clearly defines workload placement. Each team operates in their own namespace with dedicated service accounts and resource quotas.
Encryption is enforced at rest with AWS Key Management Service (AWS KMS) and in transit using TLS. Amazon S3 uses customer-managed keys to encrypt all data. Spark shuffle data is encrypted using Spark’s built-in encryption. Lineage and auditing through AWS Lake Formation and OpenLineage track data transformations across the entire pipeline.
Measurable improvements
The migration from Amazon EMR on EC2 to Amazon EMR on EKS with Karpenter produced measurable improvements across every key metric:
Metric
Amazon EMR on EC2
Amazon EMR on EKS + Karpenter
Improvement
Bronze→Silver ETL (1 PB)
9h 12m
4h 07m
55% faster
Daily 20 TB compaction
3h 40m
1h 55m
48% faster
Scale-out 40→520 nodes
18 min
5m 42s
68% faster
Idle EC2 cost/month
$42,000.00
$0.00
100% reduction
Spot instance share
0%
~70%
~63% cost savings
Bin-packing failures
Frequent
Near-zero
—
The largest improvement came from scale-to-zero capability. The previous Amazon EMR cluster design ran 24/7 to avoid the 15–20-minute startup time, costing $42,000 monthly in idle compute. With Karpenter, nodes launch in under 6 minutes and terminate automatically, alleviating idle costs. This reduced launch time matters when you have SLA-critical pipelines that need to start processing immediately. For the largest bronze-to-silver ETL job processing approximately 1 PB of data, Karpenter scaled the cluster from 40 to 520 nodes in 5 minutes 42 seconds. It then spun everything down minutes after completion. That level of elasticity is difficult to achieve with traditional automated scaling approaches. By diversifying across over 20 Spot instance types, Karpenter achieves higher Spot availability and lower interruption rates. The executor fleet runs approximately 70 percent Spot, delivering approximately 63 percent cost savings compared to On-Demand pricing.
For Veeva Compass’s business, the speed improvements are as impactful as the cost savings. Several of their most common customer use cases are highly dependent on data delivery speed. For example, medical field reps at a biopharma company rely on alerts from patient data to guide their engagement strategies day to day. The faster Veeva can deliver a new diagnosis or procedure to a customer, the faster that customer’s field team can act.
Lessons learned along the implementation journey
After a year of operating petabyte-scale analytics on Amazon EMR on EKS, here are the lessons that delivered the most value:
Partition hygiene matters more than hardware. Veeva spent weeks tuning executor memory and instance types before realizing the real bottleneck was small-file proliferation. Implementing nightly compaction reduced job runtime by 40 percent without changing cluster configuration.
Compaction must be frequent. Waiting for monthly compaction windows creates trillions of tiny Parquet files that degrade query performance. Daily compaction on hot partitions and weekly compaction on cold partitions keeps file counts manageable.
Design for Spot interruptions. Assume 5–10 percent hourly churn in your executor fleet. Use Spark checkpointing for long-running jobs, enable AQE for query optimization, and rely on Spark retries and re-computation to handle executor failures.
Synthetic benchmarking pays off. Before migrating production workloads, Veeva ran synthetic tests at 1 PB, 2 PB, and 5 PB scale. This exposed Garbage Collection (GC) pressure and shuffle limits that would have caused production incidents.
Speculative execution saves hours. For skew-heavy wide joins, enabling speculative execution allows Spark to launch backup tasks for stragglers. This single configuration change reduced the skewed join stage run time from 7 hours to 55 minutes.
Karpenter consolidation compounds savings. Beyond Spot pricing, Karpenter’s bin-packing and consolidation features deliver another 8–12 percent EC2 savings.
Conclusion
Veeva Compass’s journey from Amazon EMR on EC2 to Amazon EMR on EKS with Karpenter demonstrates how modern cloud-native architectures can transform petabyte-scale analytics workloads. By embracing ephemeral compute, intelligent autoscaling, and continuous optimization, Veeva achieved measurable improvements in both performance and cost efficiency. They reduced critical ETL runtimes by over 50 percent while alleviating $42,000 in monthly idle compute costs.
These cost and performance improvements are important for Veeva Compass’s business practice. The ability to quickly serve large amounts of data to biopharma commercial teams enables faster and more precise analytics, especially as biopharma companies continue to drive increased data demand by exploring AI use cases. These improvements help Veeva Compass customers act with speed and precision to quickly deliver the right therapies to patients in need.
If you’re facing similar challenges with growing data volumes and complex Spark workloads, consider exploring Amazon EMR on EKS and Karpenter as a foundation for elastic, cost-effective big data processing. To learn more about building scalable analytics on AWS, visit the Amazon EMR documentation and explore Karpenter best practices.
In this post, we discuss how Rakbank retail digital banking platform ingests approximately 150 GB a day of telemetry across a cross-account, Multi-Availability Zone (Multi-AZ) Amazon OpenSearch Service design, with hot/warm/cold tiering, 7-year compliance retention backed by Amazon Simple Storage Service (Amazon S3), and approximately 55 percent cost savings over an all-hot cluster.
Context and workload profile
Rakbank’s retail digital banking platform runs as containerized microservices on Amazon Elastic Kubernetes Service (Amazon EKS), and its observability requirements are driven by a few hard numbers. The platform now generates roughly 150 GB of logs per day on average, up from about 5 GB/day before the migration. That produces around 9 TB retained in OpenSearch Service over a 60-day window (150 GB/day × 60 days), with the most recent 30 days directly searchable. Retention runs to seven years for compliance, aligned with Central Bank of the UAE (CBUAE) requirements and Rakbank’s internal data-retention policy. At an average of 150 GB per day, that archives approximately 54 TB of log data per year, or approximately 383 TB over seven years. On the consumption side, 25 dashboards serve about 25 concurrent users. The data itself has an important property: logs are append-only. After written, a log document is never updated or deleted, so there is no update or delete-by-query churn. (Where regulatory write-once-read-many immutability is required, the S3 archive bucket can enforce it with Amazon S3 Object Lock.)
The append-only pattern is architecturally significant: because indices are no longer written to once they roll over, force-merging them to a single segment per shard before warm migration is safe, and there is no update overhead as indices roll down the tiers.
Telemetry pipeline: Fluent Bit
Instrumentation follows an instrument once, standardize everywhere model on a Fluent Bit standard across all banking domains (retail, business, wholesale). Concretely:
Fluent Bit runs as a DaemonSet on the EKS cluster, tailing container stdout/stderr on each node and enriching records with Kubernetes metadata (pod, namespace, labels) before routing.
Fluent Bit performs a dual-write/parallel archive: one path ships to the OpenSearch Service ingest endpoint (hot), a parallel path lands raw log objects directly in Amazon Simple Storage Service (Amazon S3) for durable backup independent of the search tier.
Cross-account topology and private connectivity
The design separates the workload from its observability plane using two accounts:
Application account
Amazon EKS cluster running the app pods in the Application virtual private cloud (VPC).
Fluent Bit DaemonSet for container-log collection and routing.
A parallel archive path to Amazon S3 (Log Archive & Backup).
Observability account
A dedicated OpenSearch Service centralized logging domain in the OpenSearch Service VPC, spanning three Availability Zones.
OpenSearch Service Dashboards as the access/visualization layer, routed to the hot data nodes.
Connectivity. Cross-account log flow traverses an AWS Transit Gateway, keeping all communication private within AWS. No traffic egresses to the public internet. In practice, Transit Gateway route tables provide reachability between the application and OpenSearch Service VPCs. Access is scoped at the VPC boundary by security groups and network ACLs that permit only the required ingest traffic (HTTPS/443) to the domain.
The following diagram shows the full cross-account path: application pods write logs through a Fluent Bit DaemonSet, which both forwards them privately over AWS Transit Gateway to the OpenSearch Service domain and archives a parallel copy to Amazon S3.
Figure 1: Centralized observability platform showing cross-account log flow from the EKS application account across AWS Transit Gateway into the Multi-AZ OpenSearch Service domain with hot, UltraWarm, and cold tiering and Amazon S3 archival
In the Application account, three application pods on the Amazon EKS cluster write logs that a Fluent Bit DaemonSet collects. Fluent Bit ships one copy over AWS Transit Gateway to the Observability account and archives a parallel copy to the Amazon S3 Log Archive and Backup bucket. In the Observability account, the OpenSearch Service centralized logging domain spans three Availability Zones. Each zone has a dedicated cluster-manager node (m8g.large.search) and a hot data node (m8g.2xlarge.search) that ages out to an UltraWarm node (ultrawarm1.medium.search) and then to a shared, node-free S3-backed cold storage tier. OpenSearch Service Dashboards reads from the hot data nodes for visualization.
Identity and cross-account authorization flow
The platform spans two accounts, with access governed by the layered security model of OpenSearch Service: network isolation (VPC and private Transit Gateway connectivity), the domain’s resource-based access policy, and fine-grained access control (FGAC) on the VPC domain. End users reach OpenSearch Service Dashboards through Security Assertion Markup Language (SAML) 2.0 single sign-on federated to Rakbank’s corporate Active Directory. Access follows existing enterprise identities and group memberships, with no separate OpenSearch Service credentials. Log ingestion from the application account is authorized separately from user access, keeping the write path and the read path on distinct, least-privilege roles. Together these layers keep all telemetry flowing privately within AWS while access stays centrally governed in Active Directory.
Cluster topology (per-AZ node roles)
The domain is a 3-AZ deployment with dedicated cluster-manager nodes separated from data nodes:
Role
Per-AZ instance
Count
Purpose
Cluster manager
m8g.large.search
3 (1/AZ)
Cluster state, shard allocation, no data
Hot data node
m8g.2xlarge.search
3 (1/AZ)
Active indexing + real-time query
UltraWarm node
ultrawarm1.medium.search
3 (1/AZ)
Read-only, S3-backed warm segments
Cold tier
No nodes
—
Detached S3-backed storage, managed by OpenSearch Service
The hot data and cluster-manager nodes are Graviton (m8g) for better price/performance. Dedicated cluster-manager nodes isolate cluster-state management from indexing and query load, which matters after you’re pushing 150 GB/day through the hot tier.
Storage tiering: right data · right store · right cost
The core mechanism is OpenSearch Service multi-tier storage, with indices aging through tiers using Index State Management (ISM) policies keyed off index age:
Tier
Backing
Retention
Access pattern
Instance/store
Hot
Amazon Elastic Block Store (Amazon EBS) (gp3) volumes on data nodes
0–15 days
Real-time dashboards, active troubleshooting, alerting
m8g.2xlarge.search
Warm (UltraWarm)
Amazon S3 + local cache
15–30 days
Read-only historical analysis. Cost-optimized, still fully searchable
ultrawarm1.medium.search
Cold
Amazon S3 (detached, no nodes)
30–60 days
Older logs for on-demand investigation. Attach to UltraWarm when needed
S3-backed, 0 compute at rest
How the lifecycle behaves:
Hot → UltraWarm: ISM transitions indices at approximately 15 days. UltraWarm keeps primary shard data in S3 while caching hot blocks locally, so queries still run, only at higher latency and far lower cost per GB. Because rolled-over indices are no longer written to, they are force-merged before migration for faster warm-tier read performance.
UltraWarm → Cold: At approximately 30 days, indices detach to the cold tier, which is pure S3 storage with no dedicated compute. Cold indices are not directly searchable: to query them, you selectively attach them back to UltraWarm nodes on demand. (Querying the raw S3 archive without reattaching is a separate path that uses Amazon Athena.)
Compliance archive (S3 + Athena): Everything also lands in a separate Amazon S3 bucket for the full 7-year window, and is queried with Amazon Athena, at the lowest cost per GB. This decouples how long data must be kept from how much hot compute is paid for.
Durability details called out in the design: The durability of Amazon S3 means the design can run 0 replicas on the warm/cold tiers and remain durable (S3 handles redundancy), which further cuts cost. UltraWarm is a read-only warm tier, and Graviton (m8g) powers the hot and cluster-manager nodes.
Alerting. Hot-tier data drives OpenSearch Service alerting with email and Microsoft Teams destinations for real-time operational alarms.
Production sizing and cost model
Sizing target: 150 GB/day average, 60-day retention (30 days directly searchable) (the cluster is provisioned with headroom for an approximately 200 GB/day peak, which is the basis for the node sizing that follows). Rakbank evaluated two topologies:
Option 1 — Hot + UltraWarm (recommended)
3 × m8g.2xlarge hot data nodes.
3 × ultrawarm1.medium.search + cold tier.
3 × m8g.large dedicated cluster-manager nodes.
Approximately 55 percent savings compared to all-hot.
Option 2 — All Hot
3 × r8g.4xlarge, approximately 8,320 GB each.
3 × m8g.large admin, no warm tier.
Higher cost, all data resident hot.
Pricing is On-Demand. Reserved Instances reduce it further. The takeaway: for a 9 TB, 60-day window, the bulk of data is rarely queried after the first couple of weeks. Pushing older indices to an S3-backed warm/cold tier removes the need to keep the full working set on hot r8g nodes, which is where the approximately 55 percent delta comes from.
Scaling the observability architecture with OpenSearch Service
As the platform grew from approximately 5 GB/day to approximately 150 GB/day with 25 dashboards and approximately 25 concurrent users, the observability architecture had to meet three requirements:
Predictable cost at high ingestion volume, repeated dashboard queries without per-query cost coupling, and multi-tier retention spanning real-time access through to 7-year archival. OpenSearch Service meets these requirements with an instance-based model and hot/warm/cold tiering: ingestion and queries run on provisioned capacity, and older indices age into S3-backed tiers for long-term retention at a low cost per GB. This gives Rakbank a predictable, capacity-based cost model as data volume and dashboard usage grow.
Resilience: Multi-AZ and the Standby trade-off
Deployment option
SLA
Failover
Nodes
Multi-AZ (no Standby)
99.9% out-of-the-box
automatic
3 AZ · 3 data nodes + 3 dedicated cluster-manager nodes
Multi-AZ with Standby
99.99%
< 1 min automatic on AZ failure
3 AZ · 2 data active + 1 standby
The trade-off to understand: with Multi-AZ with Standby enabled, only two of three data nodes serve search requests. The third is reserved for failover. That is a 33 percent reduction in active search capacity in exchange for the higher service level agreement (SLA). Standby also requires at least two replicas per index, which increases storage, and is supported only on specific instance families, so check the current list before planning it. If a 99.99 percent SLA is not a hard requirement, running without Standby keeps all data nodes serving search. Rakbank runs its production domain without Standby, with data nodes across all three Availability Zones and replica shards for redundancy.
AI-powered observability capabilities
Rakbank is evaluating newer, machine learning (ML) and agent-driven features of OpenSearch Service that can layer on top of the tiered store:
AI Assistant – Natural-language → query generation (for example, “Show error spikes in the last 24h”), backed by Amazon Bedrock.
MCP Server + Agent investigator – DevOps agents autonomously execute PPL queries for root-cause analysis. A Memory Store provides persistent context across agent conversations.
Direct Query – Query Amazon S3 data without ingesting it into OpenSearch Service, an option alongside Amazon Athena for the S3 archive.
Trace Correlation – Available as trace collection is added to the pipeline: unify logs, traces, and metrics in one view, with automatic trace/log correlation and service maps.
Query surface – PPL, DSL, SQL, PromQL. Integrates with Amazon Managed Service for Prometheus and Amazon OpenSearch Ingestion for high-performance ingest.
Outcomes
Running on the Fluent Bit standard, the platform now serves three audiences from a single pane of glass. Support operations get faster triage and guided troubleshooting, engineering teams use it for root-cause analysis and debugging across the request path, and the business gains journey trends and actionable insights.
Net results: lower mean time to resolution (MTTR), higher reliability, data-driven insights, and improved operational efficiency. In their own environment, Rakbank measured faster performance after upgrading across OpenSearch Service versions (1.3 → current), with single-digit-millisecond latencies for lexical and vector queries.
Engineering lessons learned
Multi-tier from day one – Design hot/warm/cold up front. Retrofitting tiering onto a live 150 GB/day cluster is significantly harder than starting with ISM policies in place.
Size for peak, not today – Ingestion grows as more microservices come online. Provision headroom in the hot tier and shard count.
Model the Standby trade-off explicitly – 99.99 percent costs you 33 percent of active search capacity and requires two replicas per index. Decide per workload whether that SLA is worth it.
Exploit the append-only advantage – Append-only logs are the recommended candidate for multi-tier storage: no update overhead, clean force-merge before warm migration, and predictable rollover.
At British Airways (BA), engineering at scale means supporting services used across the airline for millions of passengers, while simultaneously preparing for what comes next. After completing a major migration of legacy data center infrastructure to AWS, the next question was how BA could use its new cloud capabilities to improve scalability and efficiency. The team also wanted to accelerate the next phase of modernization.
As part of this next phase, BA began exploring how agentic AI could help accelerate the modernization of its technology estate. Working with AWS, the team identified AWS Transform custom as a way to support this at scale. This purpose-built solution is designed to modernize large legacy platforms using agentic AI and automation. The first major target was a legacy Java platform of more than 250 business services across around 750 code repositories. BA set out to migrate it from Amazon Elastic Compute Cloud (Amazon EC2) to a modern, cloud-native architecture on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate and AWS Graviton. The new architecture is containerized, auto scaling, and resilient by design.
About British Airways
British Airways is the UK’s flag carrier airline, serving more than 40 million customers annually across more than 200 destinations worldwide, and a subsidiary of International Airlines Group (IAG).
Challenge
British Airways’ Java platform had supported the airline for many years, but maintaining and updating it required valuable engineering time that could be more efficiently spent advancing innovation. As BA continued to modernize its technology foundations, the team identified an opportunity to move services to a more scalable architecture and simplify their ongoing management.
“Can AI really transform hundreds of code repositories at enterprise scale? That was the question everyone asked when we started this journey. With more than 250 business services on a legacy platform, maintaining the estate demanded considerable engineering time. We needed a more efficient approach that would free our teams to focus on innovation rather than routine maintenance.”
— Gary Holland, Principal Platform Architect at British Airways
Solution
British Airways partnered with AWS to deploy AWS Transform custom, purpose-built to modernize large legacy estates using agentic AI and automation. Starting with an Experience Based Acceleration (EBA) using Amazon Q Developer, the team moved swiftly. When AWS Transform custom launched at AWS re:Invent 2025, BA was among the first to build with it. Its first fully transformed service went live in production shortly after.
How the transformation engine works
Each service passes through a 20-step transformation lifecycle that blends deterministic automation with agentic AI, designed to be repeatable across hundreds of services without manual re-engineering.
Figure 1: The 20-step transformation lifecycle British Airways uses with AWS Transform custom
Phase 1: Deterministic preparation. GitHub Actions workflows analyze each service repository to identify the production-versioned artifact currently deployed, then catalog its dependencies and data source configurations. Automation runs against live production logs to extract peak and mean traffic rates. It then infers the non-functional requirements (scaling thresholds, resource sizing, and observability settings) needed to configure each service’s new container on Amazon ECS. Baseline regression and performance test packs are executed against the existing platform to establish a known-good benchmark before any code is touched. The infrastructure for each service is then created, and the service code is copied, branched, and wired up, ready for transformation.
Phase 2: Agentic transformation. AWS Transform custom transforms the codebase for the target architecture. This includes upgrading to Java 21 and migrating from Amazon EC2 deployment patterns to Amazon ECS on AWS Fargate with Graviton. It also replaces legacy framework dependencies and resolves hard-coded version numbers that would otherwise block future patching. The agentic engine handles the complex transformation activity that would previously have consumed months of engineering time per service. The team then checks for any remaining hard-coded version numbers and pushes the transformed code to GitHub.
Phase 3: Deterministic testing and deployment. The transformed code is built and deployed into lower environments, and API gateway routing is updated to point to Amazon ECS. The service is then validated through the same automated regression and performance test packs run during Phase 1. Results are compared against the baseline to confirm that business logic is preserved. Human-in-the-loop code reviews, security and code quality scanning, a service operations review, and cybersecurity approval confirm that every service meets BA’s standards before support handover and go-live.
This separation of concerns is deliberate. Deterministic steps handle everything that should be repeatable and auditable. Agentic AI handles the complex transformation work that would otherwise consume months of engineering time. The result is a repeatable engine that can securely and accurately process hundreds of services far faster than a manual, service-by-service migration.
With AWS Transform custom, British Airways can:
Accelerate the modernization of Java services while reducing the manual effort required from engineers.
Move services from Amazon EC2 to a more scalable architecture using Amazon ECS on AWS Fargate with Graviton, supported by testing and assurance to confirm that business logic continues to perform as intended.
Upgrade outdated software versions and frameworks, supporting a more resilient and maintainable platform.
Apply lessons from the work to other engineering activities, including improving unit-test coverage.
Outcome
The benefits go beyond the technology itself. By reducing the manual effort involved in modernization, BA can give engineers more time to focus on resilient technology and better experiences for colleagues and customers.
“Modernising hundreds of code repositories is a significant engineering challenge. By combining agentic and generative AI and automation with human review and assurance, we’re accelerating that work and reducing the manual effort involved. Most importantly, it gives our engineers more time to focus on delivering value to the business and better experiences for our colleagues and customers.”
— Gary Holland, Principal Platform Architect at British Airways
“This is more than a technology upgrade. It is about building stronger, more resilient technology foundations for British Airways so our teams can deliver change more quickly and create better experiences for our customers. The early results are encouraging, and we are now applying what we have learned across the wider platform.”
— Liz Wright, Director of Delivery for BA Digital Customer and Commercial
Get started today
For British Airways, the work demonstrates how modern cloud technology, automation, and responsible use of AI can strengthen the airline’s technology foundations and create more capacity to innovate for customers.
If you’re planning to modernize your own Java applications, explore AWS Transform custom to see how agentic AI and automation, combined with human review, can reduce the manual effort involved.
Clinical trial recruitment is often described as a patient-matching challenge. In practice, it is much broader. Patient Recruitment teams need to understand where potential participants are in the recruitment journey, how sites are performing, which geographies may offer the strongest opportunities, and whether enough patients may meet increasingly complex study criteria. The answers often sit across different systems, datasets, surveys, questionnaires, consent records, marketing interactions, and operational workflows.
For Thermo Fisher Scientific, improving that experience required more than introducing a new application. It required rethinking the data foundation supporting patient recruitment and creating a more scalable way to turn recruitment data into actionable insights.
Using AWS, Thermo Fisher Scientific established a modern patient recruitment data foundation which brings together and curates data for analytics and AI-enabled use cases. Built on this foundation are complementary capabilities including Patient Recruitment’s Central Insights Hub (CIH), which provides recruitment analytics and operational visibility, and Patient Match AI, Thermo Fisher Scientific’s proprietary tool, that supports self-service patient search, feasibility assessment, and cohort discovery through natural-language interaction.
The impact is particularly visible in cohort discovery. Questions that could previously involve days or even weeks of analysis and back-and-forth with technical teams can now be explored and refined in minutes, giving recruitment teams a faster path from a question to an actionable patient population.
As these capabilities moved toward production, Thermo Fisher Scientific also worked with AWS Countdown Premium to strengthen operational readiness, support launch activities, and reduce risk during a critical stage of the transformation.
The challenge
Over time, patient recruitment data had grown across multiple systems and use cases. Patient information, surveys and questionnaires, recruitment funnel activity, marketing interactions, consent information, site data, and other operational datasets did not always exist in a single, consistent form.
That fragmentation created several challenges.
Recruitment teams needed faster ways to identify and refine relevant patient populations across large volumes of records. They also needed a clearer view of recruitment performance across studies, sites, and geographies. At the same time, the organization wanted to introduce AI-enabled capabilities without compromising data quality, privacy, governance, or compliance.
Existing processes often depended on specialized technical teams to translate business or clinical questions into database queries, retrieve the appropriate data, validate the results, and then repeat the process as criteria changed.
For a simple question, that approach could be manageable. For complex cohort discovery involving multiple clinical, demographic, geographic, or consent-related criteria, it could become a lengthy iterative process.
Thermo Fisher Scientific therefore faced two connected challenges: modernizing the patient recruitment data environment and making that data easier for business users to explore and act on.
Building the data foundation first
Rather than treating AI as a layer that could simply be added to existing systems, the team started with the data. Thermo Fisher Scientific established a modern patient recruitment data foundation on AWS to bring together information from previously disconnected sources and prepare it for downstream analytics and intelligent applications.
The new foundation standardizes and curates data from sources such as patient profiles, surveys, questionnaires, recruitment funnel activity, marketing information, consent data, and other recruitment datasets. Data transformations help create more consistent structures and reusable datasets for applications that depend on them.
This approach provides an important separation of concerns: source systems continue to serve their operational purposes, while curated datasets are prepared specifically for analytics, reporting, and AI-driven workloads.
For the business, the result is a more trusted and reusable source of recruitment information. For technology teams, it creates a scalable foundation that can support multiple products instead of building separate data pipelines for every new use case.
Turning recruitment data into operational insight with Central Insights Hub
One of the capabilities supported by this broader modernization is Central Insights Hub (CIH), Thermo Fisher’s in-house custom UI layer built using open-source technologies.
CIH is a centralized clinical trial recruitment analytics platform that helps teams understand how recruitment efforts are performing across studies.
Through interactive dashboards and visualizations, users can follow the recruitment journey from initial patient engagement through milestones such as pre-screening, referral to a study site, consent, enrollment, and randomization.
The platform brings together views of patient progression, site activity, recruitment timelines, geographic performance, and other operational measures. As CIH has evolved, additional capabilities have expanded visibility into areas such as recruitment costs, participant demographics, disqualification trends, site-patient engagement, and marketing-channel performance.
This gives recruitment teams a common place to identify bottlenecks, compare activity across sites and countries, understand where additional attention may be required, and make more timely decisions.
CIH shows how recruitment is performing and where teams should focus.
Making cohort discovery self-service with Patient Match AI
Patient Match AI, an internal tool within Thermo Fisher, addresses a different, but complementary, challenge: helping users quickly determine which patient populations may be relevant to a recruitment need.
Instead of asking a technical team to manually construct database queries, users can describe what they are looking for in natural language.
For example, a user may begin by asking for the number of patients who meet a broad clinical condition. They can then progressively refine that population by age, geography, diagnosis, treatment history, demographic characteristics, consent or contactability criteria, and other available attributes.
The intended experience follows a straightforward progression:
COUNT → REFINE → TARGETED LIST → EXPORT
Users can start by understanding the size of a potential population, refine the criteria as they learn more, and then move toward a targeted patient cohort when appropriate.
This changes the working model from a series of handoffs to a more interactive, self-service experience.
Tasks that previously could require several rounds of analysis over days or weeks can, for many common feasibility workflows, now be explored in minutes. Recruitment teams can test assumptions, adjust criteria, and understand how those changes affect the potential population without restarting the process each time.
Patient Match AI also supports aggregate insights and visualizations, helping users better understand the composition of a cohort before progressing to governed workflows when patient identity information is required.
Privacy, governance, consent, contactability, and personally identifiable information (PII) controls, consistent with applicable regulatory requirements, remain an important part of the design. The objective is not unrestricted access to patient data, but a faster and more intuitive way to work within established recruitment and governance processes.
Architecture overview
The following diagram shows how data moves from source systems through the curated data foundation into Patient Match AI and Central Insights Hub, and the key AWS services involved at each stage.
Figure 1: How data moves from source systems through the curated data foundation into Patient Match AI and Central Insights Hub
The solution uses a cloud-native architecture on AWS that combines managed services for data storage, transformation, orchestration, analytics, AI workloads, and application delivery.
Amazon Simple Storage Service (Amazon S3) provides scalable storage for recruitment data, while AWS Glue supports data transformation and cataloging. AWS Step Functions orchestrates multi-stage data processing workflows, and Amazon Athena runs analytical queries across curated datasets.
The analytics layer uses Apache Iceberg tables on Amazon S3, providing a flexible foundation for large-scale analytical workloads and supporting continued growth in both data volume and use cases.
A key architectural principle is the separation of operational application workloads from analytical processing. Complex cohort and eligibility queries can therefore run across large volumes of patient profiles without placing the same workload on transactional application databases.
Thermo Fisher’s identity resolution and profile consolidation processes also help bring together records originating from multiple systems, reducing duplication and establishing a more consistent view for downstream recruitment use cases.
The outcome is not simply a collection of cloud services. It is an architecture designed so that data can be ingested, curated, queried, and reused across analytics and AI capabilities without rebuilding the underlying foundation for every product.
Source systems include patient profiles, surveys and questionnaires, recruitment funnel activity, marketing and consent data, and site and operational data. These sources are ingested into the data foundation. There, AWS Step Functions orchestrates multi-stage processing, Amazon S3 provides storage, and AWS Glue handles transformation and cataloging. An identity resolution step consolidates profiles and reduces duplication.
Curated data then flows into two separated stores. Amazon DocumentDB (with MongoDB compatibility) holds identity, health, and operations data. The team selected it as the closest managed equivalent to the MongoDB database they had previously relied on. Amazon S3 with Apache Iceberg tables, queried through Amazon Athena, holds the analytics data.
These curated datasets feed the intelligence layer. Central Insights Hub provides recruitment analytics, and Patient Match AI supports natural-language cohort discovery through a COUNT, REFINE, TARGETED LIST, and EXPORT workflow. Amazon Elastic Container Service (Amazon ECS) hosts the API layer, and AWS Lambda performs patient match scoring. Results reach recruitment teams for feasibility, cohort discovery, and site, geographic, and funnel performance analysis. Throughout, privacy, governance, consent, contactability, and PII controls remain part of the design.
Preparing for production with AWS Countdown Premium
Building technology was only part of the journey. Moving a large-scale recruitment capability into production required confidence that the architecture, capacity, operating procedures, and support model were ready for launch.
Thermo Fisher Scientific engaged AWS Countdown Premium from the testing phase onward.
AWS Countdown Premium is an engineer-led support service that provides designated expertise and guidance across critical phases of cloud projects. For this engagement, that support helped the team prepare for launch in four key areas.
Designated engineering expertise
A specialist engineer selected from a team of AWS experts served as a consistent technical point of contact and developed a deeper understanding of the Patient Match AI architecture.
That continuity was valuable when working through complex technical issues. Rather than rebuilding context for each support interaction, the team could work with an engineer who was already familiar with the system and could coordinate access to additional AWS subject matter experts when needed.
One example from the engagement: Pipeline design review: An AWS specialist engineer reviewed key design decisions ahead of launch. The patient scoring logic moved away from retrieving every record before ranking, and the pipeline was parallelized before sorting and querying. For long-running external calls in AWS Step Functions, the team adopted the wait-for-callback pattern, so they pay only for state transitions and not for idle wait time.
Operational readiness and proactive planning
The engagement focused on identifying potential issues before production rather than waiting for them to appear during launch.
Pre-event reviews, capacity planning, operational runbooks, and decision frameworks helped the team validate that the environment was prepared to support large-scale patient recruitment workloads.
Another example from the engagement: AWS Glue readiness review: An AWS Glue specialist reviewed the team’s extract, transform, and load (ETL) jobs in non-production and shared written recommendations before launch. The team also received guidance on reading Apache Iceberg tables through the AWS Glue Iceberg REST endpoint and on putting AWS Glue Studio visual jobs under source control.
Support during go-live
During launch, coordinated AWS support provided another layer of technical coverage for troubleshooting and issue resolution.
For a production system supporting clinical recruitment workflows, this helped the team move through go-live with greater confidence and a clear escalation path for issues requiring AWS expertise.
Post-launch stabilization
Support continued beyond the initial deployment.
This provided continuity as the team monitored production behavior, addressed early issues, and transitioned from launch activities into normal operations.
Results
By combining a modern cloud architecture with support from AWS Countdown Premium, Thermo Fisher Scientific achieved several key outcomes:
Unified patient data – More than 20 million patient profile records, about 1.6 TB, were brought together from previously separate sources, including patient profiles, surveys, questionnaires, recruitment funnel data, marketing information and consent data.
Self-service cohort discovery – With Patient Match AI, recruitment teams can find and refine patient populations by asking questions in plain language, and the shared test queries run in under six seconds against the full dataset.
Faster feasibility analysis – Cohort analysis now takes minutes as opposed to days for many common feasibility and patient discovery workflows.
More timely insights – Recruitment data is kept up to date continuously, so it is available right away for AI-driven patient search and shortly afterward for analytics dashboards.
Modernized data foundation – The move to a data foundation built on AWS reduces reliance on the earlier Snowflake-backed dashboard environment.
Successful production launch – Patient Match AI went live in production in Q2 FY26. AWS Countdown Premium supported the launch through an architecture review, readiness reviews for Amazon DocumentDB and AWS Glue, and expert guidance on workflow design and query optimization over a four-month engagement.
Designated engineering support – A dedicated Countdown Premium engineer worked with the Amazon DocumentDB service team and specialists to tune the database, cutting estimated processing time by more than 3x.
Lower launch risk – Testing at full scale against the complete 20 million record dataset exposed query performance problems early, so they could be fixed before go-live.
Looking ahead
The broader value of this transformation goes beyond any single application. Thermo Fisher Scientific has established a modern, curated patient recruitment data foundation that can support different types of experiences, from operational analytics in Central Insights Hub to AI-powered cohort discovery through Patient Match AI, and that shared foundation creates an opportunity to continue evolving recruitment capabilities without repeatedly rebuilding the underlying data infrastructure.
More importantly, it changes how recruitment teams can work with data.
Instead of waiting for information to move through multiple technical handoffs, teams can increasingly interact with trusted recruitment data directly, using dashboards to understand what is happening and natural-language tools to explore what may be possible.
Conclusion
Thermo Fisher Scientific’s modernization of its patient recruitment environment, including a modern, curated patient recruitment data foundation, Central Insights Hub (CIH), and Patient Match AI, demonstrates how organizations can combine modern data architecture, analytics, and AI capabilities to solve complex, high-stakes business problems.
By using AWS services for data management, orchestration, analytics, and AI, the team created an environment that makes recruitment information easier to access, understand, and act on. Processes that once required substantial manual analysis can now be more timely, interactive, and self-service.
AWS Countdown Premium played an important role in de-risking the transition to production. Designated engineering support, proactive planning, launch assistance, and post-launch stabilization helped the team move these capabilities into production with greater confidence and operational readiness.
For Thermo Fisher Scientific, the result is more than a technology modernization. It is a foundation for helping recruitment teams move from data to insight, and from insight to action, faster.
Every day, Zillow sends home shoppers more than 100 million personalized email and push notifications: saved search alerts, home recommendations, property updates, seller reports, and reminders. These messages are one of Zillow’s core ways to engage home shoppers, and Zillow delivers them on time with consistent behavior across every campaign. Today, each of those notifications runs as its own short-lived workflow execution on AWS Step Functions Express Workflows.
The underlying shape of this work isn’t unique to real estate. Many systems run the same kind of workflow at high volume: take an event, enrich it from several services, apply rules, assemble an output, and send it. This post shows how Zillow built one configuration-driven orchestration system to run that pattern at scale, and what teams across many domains can reuse from it.
Historically at Zillow a separate generator service produced each of these campaigns, and each service carried its own workflow, data models, and business rules. As the number of notification campaigns grew, so did duplicated engineering work, inconsistent behavior, and operational cost. Product teams needed to launch campaigns faster, reuse shared capabilities, and run consistent experiments without system-specific work.
To meet that need, the Zillow Comms Experience team, working with AWS, built two things. The first is the Campaign Orchestrator, which is a configuration-driven orchestration layer that runs each notification as a short-lived workflow execution on Step Functions Express Workflows. The second is the Universal Content Generator (UCG), a library of reusable, schema-driven content modules that those workflows call. Together they make campaign creation faster and more consistent, and they give AI-assisted tooling a declarative format to work with.
The challenge: why the original system needed replacing
The previous content generation model slowed product delivery. Zillow’s Comms Experience supported more than 20 email and push campaigns generated by more than 10 microservices. Each microservice owned its own workflow, models, business rules, and assembly logic.
Most campaigns followed the same pattern: receive a trigger, hydrate data, apply rules, assemble content, and send the message. Each campaign service implemented that pattern separately, creating duplicate engineering work and inconsistent behavior. It also added operational overhead across releases, monitoring, logs, dashboards, and on-call support.
Each campaign was built as its own service because, when these systems were first built, scale was the main challenge. As Zillow added more products, the tradeoff changed. Similar features ended up implemented differently across campaigns, so every new capability had to be rebuilt and retested in each service. That made it hard to roll out features across products and slowed development. The push to centralize came from that cost: we needed to move faster and stay consistent across every customer experience. With one shared implementation, a feature could be built once and reused everywhere, while each campaign kept the flexibility to tailor its experience. Before evaluating workflow engines, we first had to extract shared logic into reusable modules and move campaign decisions into configuration.
The following diagram shows the original architecture, where each campaign generator carries its own copy of the workflow, data models, and business rules.
Figure 1: Original system
Competitive evaluation
We evaluated Temporal, Flowable, an in-house engine, and Step Functions Standard and Express Workflows against four criteria. Those criteria were reliability, total cost of ownership, development speed, and how well the service would scale across teams. The engine had to be managed, configuration-driven, and able to orchestrate both newer and older services. Pricing also had to fit our volume.
Temporal and Flowable would have added another infrastructure component to operate. That worked against two of our core goals: cutting the release, monitoring, and on-call overhead that the original system created, and getting pilot projects running quickly. Neither is available as a managed AWS service, so we would have had to run and scale them ourselves. Step Functions is serverless, so we had no servers or worker fleets to run, and a team could start a pilot without first setting up infrastructure. An in-house engine offered control but required custom lifecycle management, worker pools, queue integration, and monitoring. Step Functions met the core orchestration needs at roughly a quarter of the estimated build effort and a quarter of the ongoing maintenance effort. It was the clear choice for the minimum viable product (MVP).
Express mode compared with Standard mode
Our planning model assumed high-throughput, low-latency workflows. The MVP plan ramped from 14 million workflows per day to more than 100 million across all campaigns. At full scale that means several thousand executions per second at peak. Each workflow runs for only a few seconds, and a notification has to arrive while it’s still relevant. We evaluated both Step Functions execution modes, and for our use case Express Workflows were the better fit.
At least once, sufficient with idempotent modules.
Our workflows are high volume, short-lived, finish well within the five-minute Express limit, and are designed around idempotent module calls. We validated quota, latency, and operational behavior during the traffic ramp-up.
The architecture
Campaign Orchestrator is a configuration-driven workflow platform. Each message is input data combined with persisted campaign configuration. The configuration is relatively static for each workflow, while the input data stays flexible based on how the configured steps are assembled.
A shared orchestration layer reads queued campaign events, groups work where appropriate, and invokes the corresponding Step Functions Express Workflow for each campaign. Campaign metadata describes product constants, ownership, and Zillow environment features. Workflow configuration describes step topology, step-level configuration, mappings, branching, delay behavior, and send behavior.
The following JSON shows a simplified workflow input, combining the message payload with the platform, campaign, and configuration metadata that drive the workflow:
The following diagram shows the new architecture, where a single shared orchestration layer and one library of reusable modules serve every campaign. A message moves through the diagram from left to right. The ingress service queues it, and the router applies campaign controls and starts the workflow. Campaign Orchestrator runs the Step Functions steps, each step calls a UCG module, and the delivery service sends the result.
Figure 2: The new system
Router
Our campaigns need a set of controls applied before a workflow starts: queue polling, batching, idempotency checks, pause and resume behavior, replay coordination, speed control, and campaign routing decisions. Some of these controls are specific to how we order and throttle campaign sends, so they live outside Step Functions.
We centralized these controls in an in-house router service that reads from Amazon Simple Queue Service (Amazon SQS) and starts the right Step Functions workflow. Keeping them in one place gives us a single point to pause a campaign, replay a batch, or adjust send speed without changing any workflow definition.
Shared modules (UCG)
The Universal Content Generator is the modular content generation layer behind Campaign Orchestrator. Instead of each campaign owning a separate generator, UCG organizes shared capabilities into reusable modules. Before UCG, this logic was spread across more than 10 separate generators. Centralizing it in one service also smoothed its traffic. Some daily campaigns used to run for about four hours and leave their generator idle for the other 20. Now all campaigns share one fleet, so the load spreads across the day.
Modules handle capabilities such as property hydration (loading listing details such as price, photos, and address for each home in a message), hidden homes (listings a user has chosen to hide, which we filter out of notifications), common data (the subscriptions, saved homes, eligibility flags, and propensity scores every campaign loads for a recipient), recommendations, A/B testing, and content assembly. They are stateless and schema-driven.
Direct service invocation with HTTP Invoke
A key design choice was to call UCG directly through Step Functions HTTP Invoke. This fits the workload for two reasons. First, our content generation logic already ran as long-lived containerized services inside our private service environment, with network access, service discovery, and authentication established. Second, routing workflow steps to UCG added no new compute cost.
With Step Functions HTTP Invoke, we call UCG modules for data hydration, rule checks, and content assembly as they already run. Authentication runs through an Amazon EventBridge connection. Each HTTP Invoke task points to the connection with a ConnectionArn. The connection holds an API key, and UCG checks that key on every request. Amazon EventBridge keeps the key in AWS Secrets Manager and adds it to the request at call time. The workflow definition never contains the key, and neither does our application code. When the key rotates, we rotate it once in the connection and every workflow picks it up.
To avoid repeating the same HTTP Invoke settings in every workflow, we introduced component inheritance. Components are written in a slightly modified version of the Step Functions task definition we deploy through AWS CloudFormation. A base component holds the settings that many steps share, and other components extend it. The following base component, content_module_call, defines how every workflow step calls UCG services directly through HTTP Invoke: the resource, method, headers, and the ConnectionArn for the connection described earlier.
Business modules extend the shared HTTP component and supply only the module endpoint. Before deployment, our build script replaces each component with a standard Task state: it loads the component named in Extends, merges the step’s own fields on top, and writes the result into the Terraform we deploy. Workflow definitions stay focused on product intent rather than network plumbing:
Step Functions state machine definitions, JSONata expressions, and infrastructure definitions are powerful, but they are not the right interface for every campaign owner. We added a higher-level configuration layer so campaign owners can define their own workflows without having to understand Step Functions CloudFormation configuration. Each campaign config describes a workflow: which modules run, in what order, and how data moves between them. The system translates that config into the Step Functions definition and CloudFormation template that gets deployed. Campaigns don’t share one generic workflow that picks modules at runtime. Each campaign gets its own workflow, built from the same shared modules and components. As a next step, we are considering a generic workflow that assembles modules in real time from config. Each campaign would still run its own copy of that workflow, so ownership stays isolated per campaign.
Campaign owners specify the modules needed for an email template or push notification. Each module exposes input, output, and configuration schemas. Campaign owners define module outputs to satisfy the template input schema. Module inputs define what triggers need to provide.
With this structure, campaign owners onboard through a declarative process. They work with configuration instead of raw workflow code or JSONata expressions. They can also run controlled experiments and give AI tools a format they can inspect, generate, and modify with appropriate validation.
The following simplified A/B test config is adapted from a real Campaign Orchestrator config. It injects an A/B test module before email transformation and maps the experiment result into the next step without directly touching Step Functions or CloudFormation definition.
Because a campaign is declared as schema-validated configuration, the same contracts that protect human changes also apply to AI-assisted tooling. Our internal assistants already draft module selections and mappings from a product brief, and the output must pass the same schema checks, JSONata tests, and Step Functions validation before it can be deployed.
Batch mode optimization
Campaign Orchestrator supports batching, which improves overall throughput while reducing cost. Instead of launching one workflow per message, the router can group messages and invoke one workflow for the batch.
For example, processing 100 messages individually could produce 100 workflow executions and 400 HTTP requests to UCG services. With batching, the same messages can be processed in one workflow with four HTTP requests, assuming each step supports bulk input and output. That matters at our volume for two reasons. Express Workflows charge for each request and for run time. Batching cuts the number of requests, but each batch runs longer. A rule of thumb: a batch of 10 messages costs less than 10 separate runs as long as it takes no more than 10 times as long as one run. In the preceding four-step example, one message takes about 1.2 seconds, so a batch of 10 saves money if it finishes within 12 seconds. In practice, a batch runs only 10 to 20 percent longer than a single message, about 1.4 seconds instead of 12. That makes a batch of 10 about 90 percent cheaper than 10 separate runs. The batched payload stays under the 256 KiB limit, so memory is still billed at the 64 MB minimum. Fewer executions and HTTP requests also use less of the StartExecution rate, HTTP Invoke concurrency, and logging throughput we size for. That leaves headroom to send more notifications on the same quotas.
The batching model appears in the Step Functions definition and JSONata expressions. This simplified example shapes a batched payload into a bulk UCG request while preserving each tracking ID:
Batching works only if every step in the workflow can handle a batch rather than a single message. For UCG, that requirement is built into the module API. Each module’s schemas define its input, output, and config models, and the module API accepts those models as a batch keyed by tracking ID. A module that doesn’t follow that API won’t build. Our JSONata mappings and upstream and downstream service contracts already accepted bulk input internally, so adding batching didn’t require reworking them.
Batching also can’t cost us visibility into individual messages. Because each batch is keyed by tracking ID, as the preceding example shows, UCG returns a result from each module for each tracking ID. The router uses those per-message results to deliver, retry, or drop each message individually, so one failed message doesn’t fail the whole batch.
The following diagram shows how the router groups messages into a single batched workflow execution.
Figure 3: Batching mode
Scaling: Performance and organizational
At our target throughput, service quotas are part of the architecture. We reviewed Step Functions StartExecution rate limits, HTTP Invoke concurrency, and Amazon CloudWatch logging throughput before traffic ramped. HTTP Invoke concurrency needed attention first, because its default quota is lower than the rate at which Express Workflows can start. We sized the required concurrency from our capacity model and worked with AWS to raise the quota before each rollout phase, so throughput limits never gated the traffic ramp.
We planned the rollout in phases, from early traffic to more than 100 million daily executions. With this approach, we could validate cost, quotas, latency, and operations before full scale.
The architecture also supports organizational scaling. Product teams own campaign modules, steps, configuration, and the Step Functions cost tied to their traffic, so they can launch and change campaigns without waiting on the central team. Central teams own shared infrastructure such as the router service, Step Functions patterns, Amazon SQS integration, and deployment tooling, so one improvement reaches every campaign.
Shared code doesn’t mean shared failure. Every campaign’s Express state machine is generated from the same templates and modules, so isolation adds no duplicate code. Each campaign still runs its own state machine and its own Amazon SQS queue, and the router gives each queue its own polling threads, worker pool, and circuit breakers. When one campaign fails or backs up, only its own breaker trips, and we can pause its queue without touching the others. A traffic spike or downstream failure in one campaign doesn’t become a noisy neighbor for the rest.
Testing
Configuration-driven workflows require strong validation because much of the behavior lives in JSONata expressions and campaign configuration. We keep shared JSONata expressions in dedicated files and require unit tests for them. These tests are not offline string evaluations. The test runner builds a small Step Functions state and executes it through the Step Functions TestState API, validating expressions against the same runtime used by Step Functions.
For example, this shared user profile expression converts a batch of campaign messages into UCG module requests:
Every test case for the expressions we reference through @jsonata runs through the TestState API in continuous integration (CI), and a failing case blocks the deploy. With this approach, teams get reusable mappings and can reduce the risk of malformed payloads, runtime expression errors, or configuration changes that fail inside Step Functions.
Conclusion: Measured impact
The largest impact of the new architecture is product velocity. By replacing repeated custom engineering with reusable modules and configuration-driven workflows, Zillow shortened development cycles for new products and features, opened up greater self-service, and reduced cross-team dependencies. Teams now iterate through configuration, shared modules, and validated JSONata mappings instead of building or modifying a dedicated generator for each idea.
In the original system, testing a new variant or launching a campaign meant changing a dedicated generator service, and often several. Now a team edits a config, reuses modules other teams have already built, and validates the workflow before it reaches production.
The orchestration service also reduced workflow engine build and maintenance cost. Zillow’s internal engineering estimates put the build at 9 development weeks, down from 32 for a comparable in-house engine. Ongoing maintenance fell along the same lines, from roughly 8 hours per week to 2. We sized the system to scale from early traffic phases to more than 100 million workflows per day.
Most of what made this work can be reused by teams with high-volume, short-lived workflows: describe each message as input data plus configuration, keep modules stateless and tested, make every step accept batches, and plan service quotas before traffic ramps. Step Functions Express made those practices practical to run at Zillow’s scale.
Migrating from Apache Hive Metastore (HMS) to AWS Glue Data Catalog (GDC) is a priority for many organizations as they scale their data analytics operations. At enterprise scale, maintaining an efficient and reliable metadata management system becomes increasingly critical. Many enterprises started their big data journey with HMS, which has served as a reliable catalog service for storing table definitions and metadata. As cloud adoption has grown, so have requirements for fine-grained access control and for serverless, fully managed solutions. As a result, organizations are looking to modernize their data catalog infrastructure and are moving their metastores to GDC, a fully managed AWS metadata repository. With GDC, they gain native integration with various AWS analytics and AI services, along with centralized data management and governance.
In this post, we walk through how Intuit successfully migrated its extensive data catalog from HMS to GDC. This migration is part of Intuit’s journey to an open, secure lakehouse architecture for data and analytics. We explore the challenges Intuit faced and the solutions it implemented. We also cover the benefits that motivated the move: reduced operational overhead, improved data discovery, and enhanced integration with AWS analytics services. Whether you are considering a similar migration or exploring your options for metadata management, this real-world example provides practical insights into the migration process.
Migration considerations and prerequisites
Audit the HMS catalog and remove unused tables and views by deleting or flagging them to filter out during initial migration to GDC. This will make sure that after migration you have a clean catalog and will help with better migration performance.
Estimate the read and write API limits you will need in GDC based on the traffic in HMS. To do this, you can audit the internal HMS tables and get the P99 numbers for reads and writes to tables and partitions. These numbers will need to be translated to AWS Glue Data Catalog API limits and the necessary quota increase requests will need to be submitted. Load test with these quotas to confirm that they support your peak read and write rates without throttling, and implement retries to handle any throttling that does occur.
Make sure you have your AWS Glue quotas sized properly for your account and use case. You can work with AWS Support to increase these quotas based on the results of the load testing.
Data is stored in Amazon Simple Storage Service (Amazon S3) for table resources that are planned for migration. Only databases, tables, and partitions can be migrated. Other entities, such as column statistics, privileges, roles, functions, and transactions, were outside the scope of the migration.
Plan for table renames: In GDC table/database rename isn’t supported. In some cases, customers rename tables as part of their data pipelines to get atomic updates for tables that are non-partitioned and don’t use an open table format (OTF). For use cases where this pattern is required, we recommend writing to a new S3 location and then running the following ALTER TABLE command to change the S3 location.
ALTER TABLE table_identifier [ partition_spec ] SET LOCATION 'new_location'
Architecture
The following diagram shows the overall architecture of the solution across two consumer accounts (spoke accounts), and a central data governance account as part of a hub-and-spoke architecture.
Figure 1: Solution architecture spanning the source and consumer spoke accounts and the central data governance account
In the source spoke account, Hive Metastore manages the metadata for data stored in Amazon S3. This is the current state. In the central data governance account, an HMS and GDC sync process propagates this metadata into the central AWS Glue Data Catalog, which AWS Lake Formation governs. AWS CloudTrail records operations on the central catalog. The central catalog is shared across accounts with the consumer spoke account. There, Amazon Athena, Amazon Redshift, and Amazon EMR query the data through role-based access, using Lake Formation and a local AWS Glue Data Catalog. This migration strategy is explained in detail in the following sections.
Migration strategy
At Intuit, the central team manages the data catalog and offers it as a platform for the different teams to use. Because of the scale of Intuit’s data lake and the large number of teams using the data platform, Intuit had to come up with a phased strategy. With these tenets in mind, Intuit came up with the following approach:
One-time migration of all databases, tables, and partitions. During this phase all the objects were migrated from HMS to GDC. The migration will be point-in-time and any changes happening in HMS will not be captured by the initial migration.
Ongoing sync from HMS to GDC to capture all changes happening in HMS and apply them to GDC. This would make sure any team that is ready to migrate their pipelines to GDC can do so without any dependency on upstream and downstream processes.
Ongoing sync from GDC to HMS to capture any changes that happen in GDC and apply them back to HMS. Some of your pipelines might still point to HMS while the upstream pipelines whose tables they consume have already moved to GDC. This sync process replicates all changes back to HMS, so those pipelines aren’t impacted.
To make sure both catalogs remain in sync and to prevent drift, a parity tool runs hourly to compare all critical metadata values and verify consistency between the catalogs. For details, see the Parity tool section later in this post.
An ad hoc sync process was also built. If the parity tool identifies that the two catalogs are out of sync, this process provides a straightforward way to bring them back in sync.
To prevent a circular loop between the HMS-to-GDC sync (#2) and the GDC-to-HMS sync (#3), each table is assigned a single source of truth. The source of truth is recorded as a sourceCatalog flag (HMS or GDC) in an Amazon DynamoDB arbitration table. During the HMS-to-GDC incremental sync, only tables whose source of truth is HMS are picked up and synced to GDC. Conversely, the GDC-to-HMS sync checks the sourceCatalog flag to confirm the change genuinely originated in GDC and isn’t a cascading update that was originally synced from HMS. This arbitration model makes sure each table’s metadata flows in only one direction at any given time, eliminating the risk of circular updates between the two catalogs.
1. Initial full migration
The first step is to migrate all the databases, tables, and partitions from HMS to GDC. This will need to be planned over a weekend to make sure there is no impact on the workloads running on HMS. The duration of this initial migration will vary depending on the size of your data lake. After being customized to support batching and retries, the AWS Glue Hive metastore migration utility was used to migrate all the metadata (databases, tables, and partitions) from HMS to GDC.
This utility runs an AWS Glue extract, transform, and load (ETL) job that pulls the metadata from the Amazon Aurora MySQL tables that hold the HMS metadata. The job transforms the data and writes it to the AWS Glue Data Catalog.
The following diagram shows the one-time sync process.
Figure 2: One-time migration of metadata from Hive Metastore to AWS Glue Data Catalog
An AWS Lambda function starts the AWS Glue ETL job. The job settings, such as the number of workers and the database, table, and partition write factors, come from a cdk.json configuration file. The job reads databases, tables, and partitions from the HMS MySQL database over JDBC. It transforms them into DynamicFrames with batching and rate limiting, and writes them to the AWS Glue Data Catalog. Amazon CloudWatch captures job metrics and logs. The lower half of the diagram shows nine orchestration steps: stopping the incremental sync, cleaning up GDC, running full and delta syncs, and turning on the parity jobs.
Customization options
The utility should work as-is for most cases, but Intuit customized the script to speed up the one-time migration process while making sure that GDC didn’t throttle requests.
Loading behavior
Set catalog.overwriteIfExists to false during your runs.
This is a good approach for use cases with a large number of tables because it skips overwriting a table that already exists.
One way to control the rate and reduce the amount of data sent to GDC is to change the value of catalog.ratePerDPUSecond in the code. This parameter adjusts the rate at which changes are written to GDC, and you can configure it as shown in the preceding code sample. The following formula shows how RatePerSecond is calculated and how catalog.ratePerDPUSecond influences it.
With the defaults (catalog.ratePerDPUSecond = 10, DefaultExecutorsPerDPU = 2), each data processing unit (DPU) submits five calls/sec. At that rate, a 200-DPU job submits approximately 500 calls/sec (100 x 10 / 2) when the DataFrame is well partitioned. Lower catalog.ratePerDPUSecond or the DPU count until throttling stops. Internally, these writes call BatchCreatePartitions, which batches partition creation and keeps API volume down.
Handling API limits
In GDC, there are limits for each API call and if you exceed the limits you will be throttled. One approach to handling API limits is to batch the database, table, and partition loads and send the batched data during each batch.
The second step involved creating a two-way synchronization between HMS and GDC. This synchronization made sure that any changes made to tables in HMS were reflected in GDC, and vice versa. To maintain consistency, incremental data loads were necessary between the two systems. The process synced metadata changes by capturing updates in HMS and GDC and applying them to the other system. This kept both catalogs synchronized. A key rule was to designate one catalog as the definitive source of truth for each table to avoid conflicts. This was done using the DynamoDB arbitration table as described earlier.
HMS to GDC
The following diagram shows the ongoing incremental sync from HMS to GDC.
Figure 3: Ongoing incremental sync from Hive Metastore to AWS Glue Data Catalog
The ongoing incremental sync from HMS to GDC is powered by an event-driven architecture that propagates metadata changes in near real time. Catalog updates to the source HMS can affect databases, tables, table parameters, or partitions. A Debezium connector continuously monitors the underlying MySQL instance for any INSERT, UPDATE, or DELETE operations through Change Data Capture (CDC). This approach removes the need for polling or application-level hooks.
Captured changes are routed into dedicated Kafka topics based on the type of metadata object affected. HMS-HIVE-DBS receives database-level changes, HMS-HIVE-TBLS receives table-level changes, and HMS-HIVE-TABLE_PARAMS receives table parameter modifications. HMS-HIVE-PARTITIONS receives partition changes, and HMS-HIVE-SDS receives partition or table location change events. This separation allows each object type to be processed, scaled, and retried independently. For partitions specifically, a 10-second rolling window is applied per table. When the first partition event arrives for a given table, a 10-second timer begins, and all subsequent partition events for that table are collected. When the timer expires, all accumulated events are submitted as a single batch call to the SDK, which significantly reduces API throttling for tables with high partition churn.
Before any change is synced to GDC, the system performs a schema opt-out check against an Amazon DynamoDB table. This lookup determines whether the affected database or table has been explicitly excluded from synchronization, giving individual teams governance over what metadata flows into the central catalog. If the schema is opted out, the change is dropped and no sync occurs. If it isn’t opted out, the system proceeds to apply the metadata operation (create, update, or delete) to the central GDC through the AWS Glue SDK.
Sometimes additional metadata context is needed to fully resolve a change, for example, to construct a complete table definition when processing a partition update. In these cases, the system falls back to extracting metadata directly from HMS over a JDBC connection to the source Aurora MySQL database. This makes sure that GDC always receives complete and consistent metadata, even when the CDC event alone doesn’t carry all required fields.
The overall design achieves low-latency metadata propagation without placing read pressure on the source HMS. Together, the batching strategy, queue-based decoupling, and opt-out mechanism provide a scalable, governed, and throttle-resilient sync pipeline.
GDC to HMS
The following diagram shows the ongoing incremental sync from GDC to HMS.
Figure 4: Ongoing incremental sync from AWS Glue Data Catalog to Hive Metastore
The reverse sync from GDC to HMS follows an event-driven architecture. It captures metadata changes made in the AWS Glue Data Catalog and propagates them back to HMS to maintain bidirectional consistency.
When databases, tables, or partitions are added to or deleted from GDC, Amazon EventBridge detects the change through an EventBridge rule. This rule is configured to match specific change events (adding or deleting databases, tables, or partitions) and triggers an AWS Lambda function (handle-eventbridge-events) to begin processing the event.
The Lambda function publishes the raw events to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) topic called central-gdc-raw-events. A downstream Apache Flink consumer, the Streaming Pipeline for Out of Order Raw Events, reads from this topic and applies event ordering logic. Because events might arrive out of sequence, this pipeline uses a one-minute rolling window to buffer events by schema or table. It then sorts the buffered events by their event timestamp and re-publishes them in the correct order to a second Amazon MSK topic called central-gdc-ordered-events.
At this point, the flow splits into two parallel consumption paths.
The first path is consumed by another Apache Flink consumer, the gdc-to-hms-sync pipeline, which is responsible for determining whether a given schema or table is allowed to sync. It performs a lookup against an Amazon DynamoDB table to check an allow list. If the entity is permitted for synchronization, the pipeline proceeds to push the metadata change to HMS using Amazon Athena as the execution engine. If the entity isn’t on the allow list, the pipeline takes no action and the event is dropped.
The second consumption path is consumed by a Data Lake crawler which updates the Data Lake control plane metadata inventory database.
The content of each ordered event is used as a trigger to get the latest metadata from GDC. That metadata is then synced to HMS by using the Thrift SDK and a Thrift client running on an Amazon EMR cluster.
The overall design reflects changes made in GDC reliably and consistently back into HMS. The event ordering pipeline applies operations in the correct sequence, regardless of delivery order. The allowlist mechanism in DynamoDB provides governance, because teams control which schemas participate in the reverse sync. Amazon Athena handles the final push to HMS by using its native integration with both GDC and Hive-compatible data stores.
3. Parity tool
When doing a migration through a bidirectional sync approach, a mechanism to do a parity check between the two systems is important to track any drift in the two catalogs. A parity tool was built to make sure the two catalogs are always in sync and to catch any discrepancies.
The following diagram shows the four stages of the parity tool pipeline: data extraction, data storage, comparison, and results.
Figure 5: Four-stage parity tool pipeline that compares the two catalogs
The parity tool uses AWS Glue jobs and Spark processing to efficiently compare catalog metadata:
Data extraction:
Primary list: Reads from DynamoDB table to determine which databases and tables to compare.
HMS: Connects to HMS MySQL database to extract metadata for tables in the primary list.
GDC: Uses AWS Glue API to extract metadata for tables in the primary list.
Data storage:
S3 output: Extracted data from both catalogs is written to S3 in Iceberg table format.
Iceberg tables: External Iceberg tables are created, allowing for efficient querying and comparison using Spark.
Comparison engine:
Spark jobs analyzed the Iceberg tables to identify differences in:
Databases exist in both catalogs.
Tables exist in both databases.
Table structures including columns and data types.
Table locations and SerDe paths.
Partition information including values and S3 location.
View definitions.
Results and views:
Difference tables are created showing objects present in one catalog but not the other.
Aggregation views provide summary counts.
Status views show parity health and sync status.
History tables track changes over time.
4. Ad hoc migration
An ad hoc migration process was built to perform ad hoc migrations for specific databases, tables, or partitions. This makes sure that if there is a discrepancy identified by the parity tool, it can be mitigated without having to run a full sync process. The ad hoc migration is an enhancement to the utility used for one-time sync where it can take the database name, table name, and partition information as input. Depending on the input provided, it will sync the respective objects.
GDC table requirements
S3 location: The location for the table data must be in S3. Only databases with an S3 location, or databases with one or more tables with an S3 location, will be included in the migration.
S3 location name length: The S3 location name can be up to 701 characters.
Table type: Only the HMS table types MANAGED_TABLE, EXTERNAL_TABLE, and VIRTUAL_VIEW are being imported to GDC.
Non-blank column names: Every column must have a name.
Column name length: Column names can be up to 255 characters. HMS allows 256.
Column name characters: Column names must not include the following characters: ?, \n, and \\.
Column type name length: Column type names can be up to 131,072 characters (2^17).
Conclusion
Migrating metadata from HMS to GDC is a complex process, but it can enhance your data management capabilities. Intuit’s migration shows that moving from HMS to GDC requires careful planning and execution. It also shows that the benefits of a modern, cloud-native catalog service make the move a worthwhile investment for organizations that want to scale their data operations efficiently and securely. After migrating to GDC, Intuit is focusing on implementing strong access controls using row-level, column-level, and cell-level controls in AWS Lake Formation. Because Intuit is building complex solutions and applications, this level of fine-grained access control is critical. Getting its catalog migrated to GDC was an important step in this journey.
Operating one of the world’s largest data-streaming platforms, Confluent, the company founded by the original creators of Apache Kafka and now part of IBM, continuously modernizes its infrastructure to stay ahead of rapid data growth. Confluent’s data-streaming products, including its Apache Kafka, Connect, and Flink fleets, are available on the AWS Cloud, and its internal logging system runs on Amazon OpenSearch Service, ingesting hundreds of terabytes of logs per day to support operations across that fleet.
At that ingest volume, indexing work dominates the hot tier. The question Confluent’s engineering team set out to answer was not “can we run on cheaper hardware,” but “how much more ingest can we absorb per node, and how much headroom does that free up?” This post shows how a measure-first migration of the OpenSearch hot tier to the purpose-built OpenSearch optimized instance type, oi2, improved indexing performance and ingestion headroom first. oi2 costs more per node, but we needed far fewer of them. The lower cost came from that efficiency, not from a lower instance price.
Why instance choice matters for ingestion
Confluent’s hot tier ran on r6gd, a previous-generation, general-purpose Graviton2 instance with local NVMe added as a bolt-on. The team migrated to the current-generation OpenSearch Optimized Instance family (oi2), purpose-built for OpenSearch. On oi2, local NVMe is the primary storage tier with no separate Amazon Elastic Block Store (Amazon EBS) volume. Data is copied synchronously to Amazon Simple Storage Service (Amazon S3) for durability, and the storage and network path is integrated specifically for indexing and merge I/O. For an ingest-bound logging workload, that storage path is the lever. It’s what lets each node sustain a higher indexing rate at lower latency.
A domain with OpenSearch Optimized Instances uses local storage as the primary tier, with data copied synchronously to Amazon S3 as it arrives. This provides increased indexing throughput with high durability (11 nines). Within the family, OR1, OR2, and OM2 use Amazon EBS volumes (gp3 or io1) locally, whereas oi2 instances use local NVMe disks. These instances benefit indexing-heavy operational analytics workloads such as log analytics, observability, and security analytics.
OpenSearch supports two replication strategies: logical (document) and physical (segment) replication. With logical replication, data is indexed on all the copies independently, leading to redundant computation on the cluster. OpenSearch Optimized Instances use the physical replication model, where data is indexed only on the primary copy. Additional copies are created by copying the segments from the primary (durably persisted to Amazon S3). Because this frees up compute resources on replicas that would otherwise redundantly index data, and network overhead on the primary, the cluster can churn more throughput. When Optimized Instances are configured with replicas, the indexing rate might appear lower than it actually is (for example, showing a rate of 1,000 when the actual indexing rate is 2,000). This is because indexing is only performed on primary shards.
Reference architecture
The following diagram shows the OpenSearch multi-domain topology, split by priority (P0/P1) and volume, behind Cross-Cluster Search.
Figure 1: OpenSearch multi-domain topology, with writes going directly to the P0 and P1 domains and reads served through cross-cluster search
A measure-first approach
Each domain was modernized in two logical phases, so the efficiency of the new instance could be measured in production before capacity was removed:
Phase 1, a type swap at constant node count: an in-place Amazon OpenSearch Service blue/green re-provision at the same node count, to measure real production efficiency at fixed ingest. At equal nodes, oi2 ran at roughly one-third the CPU of r6gd for the same ingest, about 2.7x the headroom per node.
Phase 2, iterative rightsizing: nodes were removed in steps, holding at each step to confirm cluster health, until a guardrail became binding. That guardrail turned out to be JVM heap, not CPU, because heap pressure is driven by query patterns, and removing nodes concentrates the same shards onto fewer of them.
Spending the Phase 1 headroom this way let the fleet consolidate to roughly half the nodes. Each oi2 node carried about 1.9x the load of an r6gd node (168 ÷ 90), while indexing got faster, not slower.
Production results: Ingestion efficiency first
The following figures are production averages at the same ingest (7-day baseline on r6gd compared to a 24-hour window on oi2 at the final node counts). Because the log traffic is identical, the comparison reflects a real change per unit of work. We didn’t benchmark R8gd for this migration. Our evaluation focused on the OpenSearch optimized (oi2) family, which is built specifically for log-analytics ingestion and storage economics.
Figure 2: Total hot-tier fleet size, 168 r6gd nodes compared to 90 oi2 nodes, a 46% reduction
Figure 3: Node count per domain on r6gd compared to oi2, with reductions of 31 to 60 percent
Figure 4: Average indexing latency per domain on r6gd compared to oi2, roughly halved across all four domains
Figure 5: Write queue depth in queued operations per domain on r6gd compared to oi2, cleared to near zero
Domain (anonymized)
Nodes
Avg CPU
Indexing latency
Write queue (ops)
Domain A (high-volume)
30 → 12 (-60%)
49% → 43%
0.19 → 0.08 ms
17.6 → 0.2
Domain B (streaming logs)
36 → 18 (-50%)
60% → 40%
0.18 → 0.08 ms
20.6 → 0.3
Domain C (high-volume)
39 → 27 (-31%)
58% → 39%
0.19 → 0.09 ms
37.9 → 0.2
Domain D (low-volume)
63 → 33 (-48%)
43% → 56%
0.18 → 0.10 ms
8.4 → 1.0
Fleet
168 → 90 (-46%)
—
~halved
<1 everywhere
Indexing latency roughly halved everywhere: approximately 0.18–0.19 ms on r6gd to approximately 0.08–0.10 ms on oi2, reflecting oi2’s faster storage path.
Write backpressure cleared. Every r6gd domain carried a double-digit write queue (8–38 queued ops, the indexing-backpressure signal). On oi2, all four dropped below approximately 1. Faster storage keeps indexing current.
CPU fell even on far fewer nodes for three of four domains, the clearest sign of per-node efficiency (for example, Domain B: 60% → 40% on half the nodes).
Heap, not CPU, is the ceiling. oi2 has the same heap per node as r6gd, so concentrating shards onto fewer nodes raised average heap on every domain. This is what set the floor on rightsizing.
The honest outlier. Domain D was cut the hardest relative to its load. Its CPU rose (43% → 56%) and its write queue, although far better, is the only one not near zero. It’s the domain to watch through peak traffic before calling it settled.
Stability: zero write/primary-write rejections in the final state. All clusters healthy throughout.
In AWS internal benchmarks, oi2 instances deliver up to 9 percent higher indexing throughput than OR2 instances and up to 33 percent more than I8g instances. Each OpenSearch Optimized instance is provisioned with compute, third-generation AWS Nitro SSDs for caching, and remote managed storage on Amazon S3. The oi2 family is available in sizes from large through 24xlarge with up to 22.5 TB of storage.
To maximize indexing throughput from OpenSearch Optimized Instances, AWS recommends:
Use large bulk sizes to improve buffer utilization. The recommended size is 10 MB.
Use multiple clients to improve parallel processing performance.
Consider more primary shards to raise indexing throughput, but note that over-sharding every index drives up per-node shard density and lowers it.
Keep the index refresh interval at 10 seconds or higher (the default for Optimized Instances is 10 seconds).
Fewer nodes, lower bill — even at a higher per-node price
oi2 carries a higher per-node price than r6gd, so a like-for-like swap alone would have raised spend. The saving came entirely from needing fewer nodes: consolidating the hot tier by approximately 46 percent more than offset the premium, for an estimated approximately 18 percent lower hot-tier cost at on-demand pricing. Committing the final footprint to 1-year reserved instances is estimated to take the hot tier to roughly 47–51 percent below the original r6gd on-demand baseline.
Cost figures are approximate, list-derived percentages at on-demand pricing (reserved-instance figures are estimates pending a quoted rate). Storage (UltraWarm and snapshots) and dedicated-master tiers were unchanged and are excluded. The takeaway for teams modernizing OpenSearch: optimize efficiency per unit of work, not instance unit price.
Conclusion
With the measure-first approach in two phases, Confluent raised ingestion efficiency and halved indexing latency on its Amazon OpenSearch Service cluster. Before removing any capacity, let the real sizing signal (heap in this case) guide the optimization work. This approach is what improved the efficiency of the system and lowered the overall cost. The same measure-first approach applies to ingest-bound OpenSearch workloads evaluating purpose-built storage-optimized instances. To learn more, see the Amazon OpenSearch Service documentation on instance types and sizing domains.
Fleet analytics sounds straightforward until you have thousands of vehicles streaming dashcam footage, driver alerts, GPS pings, and speed warnings across 10 countries, all at the same time. At that scale, no team can manually triage every drowsiness alert or investigate every over-speeding event before it becomes a real incident. With over 120 enterprise customers relying on their fleet, Novus Hi-Tech needed a system that would act on the data, not only show it. With AI-powered automation, they achieved a 46 percent reduction in road-behavior violations and a 55 percent drop in drowsiness alerts per 1,000 km.
In this post, we walk you through how Novus Hi-Tech, in collaboration with the AWS Prototyping and AI Customer Engineering (PACE) team, designed and implemented an agentic AI solution called FleetGPT. We architected the multi-agent system using Strands Agents SDK and AWS managed AI services, turning IoT data into real-time safety interventions through natural language querying, automated investigation, and AI-powered voice calls to drivers.
For years, extracting value from fleet telemetry required significant manual effort. When a drowsiness alert triggered, operators had to validate video footage, assess severity across multiple signals, contact the driver, and log the outcome. Existing fixed dashboards showed the same views regardless of what teams actually needed to know.
At scale, this model breaks down because one can’t staff enough operators to catch every warning in real time, and manual analysis becomes the bottleneck. The cost of a missed warning could be a preventable accident.
Novus Hi-Tech needed a system that understood the difference between what a fleet manager needs to know, what a customer success analyst is looking for, and what a Command Center operator must act on immediately.
The bottleneck
The friction between question and answer wasn’t uniform. It created different bottlenecks depending on what teams were trying to accomplish.
Every warning that reached the Command Center demanded the same judgment calls. Operators cycled through this decision tree hundreds of times per shift.
On the other hand, fleet managers didn’t need individual event response, but pattern recognition: which drivers are trending toward accidents, which routes carry disproportionate risk, which fleets are drifting on safety compliance.
Both roles shared the same friction: the time between asking a question and getting an answer. Operators spent too long investigating individual events. Fleet managers couldn’t analyze trends fast enough. Neither could move from question to insight without switching tools or waiting on data teams.
Solution overview
FleetGPT replaces fixed dashboards with a natural language interface for dynamic querying, investigation, and insight generation. It surfaces video evidence, driver history, and policy in single interactions. Beyond analytics, FleetGPT automates real-time safety interventions. When a critical event occurs, such as repeated drowsiness, over-speeding, or an SOS trigger, the system initiates a two-way AI-powered voice call in the driver’s native language, with user approval. It tracks acknowledgment and escalates when necessary.
FleetGPT is built with two core capabilities.
Analyst: A conversational intelligence layer where operators and fleet managers query the fleet data, retrieve video evidence, and search policy documents through natural language.
Intervention engine: An agentic layer that monitors incoming events, evaluates severity, and executes driver interventions with human approval.
Analyst: Natural language intelligence
Novus Hi-Tech’s data landscape included separate systems for telemetry, video, and policy documents. FleetGPT unifies these through a single data layer accessed by an agentic conversational interface.
Vector embeddings stored in Aurora PostgreSQL with pgvector for semantic retrieval
Amazon Aurora PostgreSQL manages the structured analytical backbone. It stores per-vehicle daily aggregates covering distance, fuel, safety scores, event counts, and GPS statistics, plus live snapshots of current vehicle status. It’s the primary target for the Text-to-SQL pipeline. A YAML schema file with column aliases, descriptions, and worked examples is injected into every SQL generation prompt. This grounds the large language model (LLM) on the actual schema and reduces hallucination on column names and join paths.
Amazon DynamoDB handles the high-velocity warning event stream. The warning event table uses a composite sort key of warning_code + datetime, enabling efficient range queries by warning type and time window without full table scans. A Global Secondary Index on fleet_id supports fleet-scoped queries without touching data from other tenants. A separate device registry table maps vehicle IDs to country metadata which is the source of truth for language routing in audio alerts.
Amazon Bedrock Knowledge Bases, the fully managed RAG capability, indexes unstructured documents including SOPs, compliance policies, product documentation which are stored in Amazon Simple Storage Service (Amazon S3). The embeddings are generated using Amazon Titan Text Embeddings V2 for storage in Amazon Aurora PostgreSQL with pgvector. This gives operators and fleet managers a single interface for both data questions and policy questions, with no context switching.
Orchestration: Strands Agents
Figure 1: Solution architecture
The system uses a multi-agent architecture built with Strands Agents, where each agent has a distinct role and model assignment based on the complexity of its task.
At the top sits the Supervisor agent, running on Claude Sonnet 4.6 (for model availability by AWS Region, refer to Region availability by models), which handles intent decomposition and multi-step reasoning. It decides what kind of question the user is asking and routes it to the right sub-agent. The Supervisor uses a SummarizingConversationManager from Strands Agents, which preserves the last six messages verbatim while summarizing older turns. This keeps context window usage bounded without losing conversational continuity.
For structured data queries, the Supervisor delegates to a Text-to-SQL sub-agent (also Claude Sonnet 4.6). This agent follows a plan-and-execute approach: it first classifies the query type (vehicle data, driver behavior, or operational metrics), then extracts key entities and maps them to database tables and columns. From there, it generates a query plan outlining the relevant tables and operations, and finally produces and executes the SQL. If an error occurs, the agent retries with the error message, original plan, and failed query included in the prompt for self-correction.
Figure 2: Text-to-SQL sub-agent flow
When a query needs computation beyond SQL (correlation analysis, statistical profiling, trend detection), the Supervisor delegates to a Data Processing sub-agent running on Claude Haiku 3.0 (for model availability by AWS Region, refer to Region availability by models). Rather than pushing complex processing onto the database, this agent generates executable Python, runs it through a Python REPL tool, and returns the shaped results to the orchestrator. Claude Haiku 3.0, a smaller model than Claude Sonnet 4.6, helps keep the inference cost down for this tier of the pipeline.
Each agent has a focused tool surface and scoped system prompt, reducing hallucination and making failures straightforward to isolate.
The agent is hosted on AWS Fargate for Amazon Elastic Container Service (Amazon ECS), which provides a serverless container environment. An Application Load Balancer (ALB) serves as the entry point, routing incoming requests to the ECS-hosted application.
Video evidence retrieval
Video retrieval demonstrates the practical impact of this architecture. Earlier retrieving dashcam footage required operators to know vehicle IDs, navigate a separate system, and apply filters manually.
Operators now retrieve video using natural language, specifying fleet, vehicle, warning type, date range, speed, or city. The agent resolves these parameters into a DynamoDB query using the composite sort key, applies the remaining criteria as in-memory filters, and returns a paginated result set with vehicle ID, timestamp, GPS coordinates, and a streamable video link in a single conversation.
Multi-tenancy and conversation persistence
Multi-tenancy is enforced at the data layer. Every query is scoped to the authenticated user’s authorized fleet IDs, injected into the agent’s context at session initialization. This helps reduce the risk of cross-tenant data access, whether through natural language, prompt injection, or direct tool calls.
Conversation history is stored in DynamoDB with a composite key of user_id + conversation_id + timestamp, to support per-user time-ordered retrieval. At session start, the system also injects live operational context including today’s warning counts, the latest critical events and the currently open video. This gives the agent situational awareness along with the conversation history.
Intervention engine: Automated event response
The intervention agent acts on critical events. When warnings such as drowsiness, dangerous speeding, or SOS arrive, the system evaluates severity and queues interventions for user approval.
Real-time event push through Amazon DynamoDB Streams
ADAS (Advanced Driver Assistance Systems) edge devices send warning events to DynamoDB. Amazon DynamoDB Streams capture these events, which a background worker forwards to the notification API for delivery to the Command Center.
The worker uses exponential backoff on idle periods: if no new events are found, the poll interval doubles up to a maximum of five minutes, then resets to the base interval on the next event. A fallback polling job provides redundancy, scanning a configurable recent time window on a fixed schedule in case the stream worker misses an event.
Two-way AI voice calling
When a safety event needs direct driver contact, the system automatically initiates a fresh conversation session that is pre-configured with the driver’s language. The LLM system prompt, STT/TTS voice model, and language hint are all set at session start. You can refer to Sample Indic Language Voicebot for reference implementation.
The voice calling pipeline operates in real time:
Speech-to-Text: The driver’s voice is captured through the in-cabin microphone and transcribed by a high-accuracy multilingual STT (Speech-to-Text) model, with the language hint set at the beginning of the session for accuracy across regional fleets.
LLM Processing: Transcriptions are sent to an LLM on Amazon Bedrock that generates contextually appropriate responses in the driver’s native language.
Text-to-Speech and delivery: Responses are synthesized using a multilingual TTS (Text-to-Speech) model and streamed to the vehicle’s IVI (In-Vehicle Infotainment) head unit over WebSocket.
Interrupt handling: VAD (Voice Activity Detection) monitors for driver speech during system responses, immediately canceling active streams to allow natural conversation flow.
Key design decisions
Building FleetGPT required deliberate choices about frameworks, data stores, and agent architecture. The following sections explain the reasoning behind the decisions that shaped the system.
Why Strands Agents?
Strands Agents was chosen for fine-grained control over tool invocation, conversation lifecycle management, and per-session agent state within a Python-native environment. Capabilities such as summarizing conversation memory, multi-model routing, and caching intermediate tool outputs are easier to implement and tune directly at the SDK level than through higher-level abstraction layers.
DynamoDB
Amazon DynamoDB provides the low-latency reads and stream processing needed for real-time fleet monitoring. The composite sort key design deliberately matches agent query patterns to allow efficient filtering without table scans. A Global Secondary Index on fleet_id helps provide tenant isolation. Amazon DynamoDB Streams trigger the intervention pipeline so the system reacts to critical safety events within seconds.
Amazon Bedrock
Amazon Bedrock provides the foundation model infrastructure for FleetGPT, offering access to multiple models. Amazon Bedrock Knowledge Bases handles the complete RAG pipeline for policy and documentation retrieval, alleviating the need for custom RAG infrastructure while maintaining the security and access controls already established for structured data.
Sub-agent delegation for specialization without coupling
The three-tier data analysis chain exists because each step requires fundamentally different reasoning. Consolidating these responsibilities into a single agent would degrade performance across multiple dimensions.
A monolithic agent must balance competing concerns in its system prompt, reducing effectiveness for each task. It must select from a larger tool inventory, increasing decision complexity and error rates. And when failures occur, diagnosing the root cause becomes significantly harder.
Separating these concerns means each agent can be prompted, tested, and improved independently, with clear failure boundaries at each tier.
Atomic system prompts for maintainability and debugging
System prompts are structured as composable, tagged instruction blocks rather than a monolithic string. Each instruction is a discrete, auditable unit which is tagged by category, named, and independently editable. When two instruction blocks produce conflicting behavior, the tag and block name tell you exactly where to look, without having to reason about the prompt as a whole. This made iterating on specific behaviors fast and safe.
Results
FleetGPT has delivered measurable operational impact across Novus Hi-Tech’s customer base:
46 percent annual reductions in road-behavior violations.
Insights from data led to a 3–6 percent increase in fuel efficiency.
55 percent reduction in drowsiness alerts per 1,000 km.
These improvements stem from four key operational transformations:
Warning validation time dropped from minutes to seconds: Investigating a single warning previously meant navigating multiple dashboard screens, manually filtering video feeds, cross-referencing driver history in separate tools, and looking up policy documents. Now it’s a single conversational query that surfaces video evidence, driver history, and fleet context together.
Real-time alert delivery within seconds: The DynamoDB Streams based pipeline replaced a polling-based system with multi-minute latency. Command Center operators now receive critical warnings within seconds of an event being recorded by an edge device in the field.
Self-service analytics for fleet managers: Fleet managers generate driver performance reports, fleet health summaries, and trend analyses without engaging the data team. Questions that once took hours or days are now answered in conversational turns.
Improved driver response rates in multilingual fleets: Delivering audio alerts in each driver’s native language has measurably improved acknowledgment rates across regional fleet segments, where a single-language approach previously left a significant portion of drivers underserved.
Conclusion and next steps
FleetGPT demonstrates how agentic AI can transform operational workflows when applied to domain-specific problems. By combining natural language interfaces with automated intervention systems, Novus Hi-Tech moved from reactive dashboard monitoring to proactive, context-aware fleet management.
Looking ahead, Novus Hi-Tech is expanding FleetGPT’s capabilities in three directions:
Amazon Bedrock AgentCore: Host the developed agent on Amazon Bedrock AgentCore, a platform to build, connect, and optimize agents at scale, with any framework or model.
Predictive risk scoring: The dataset now carries enough behavioral history to surface vehicles trending toward incidents before they occur. The next capability will score drivers against their own baselines and flag deteriorating patterns proactively.
Embedded chart and visualization generation: Fleet managers think visually. Rather than returning tabular data, the agent will embed generated charts directly in responses for trend queries which will close the gap between insight and presentation without a separate business intelligence tool in the loop.
If you manage real-time operational data across distributed systems, FleetGPT offers a blueprint: start with the questions your teams ask most often, build agents that can answer them reliably, and then extend those agents to act on the answers.
For more information and relevant reads, see the following resources:
DeepL is a Language AI company that builds written and real-time AI voice translation products used by more than 200,000 business teams worldwide. Its infrastructure spans multiple AWS Regions across Europe, North America and Asia, with hybrid connectivity back to two European data centers.
Taking a single AWS Direct Connect link out of service for planned maintenance is a routine task, but in a multi-Region hybrid network it demands care. DeepL connects its AWS Regions to its data centers through Direct Connect and relies on the default closest-exit egress behavior to keep latency low. For maintenance, the team’s goal was to drain one link while every other Region continued using its local exit.
This post describes how DeepL does this with AWS Cloud WAN and a Direct Connect gateway attached natively to the core network. An AS_PATH prepend on the link being maintained moves only that Region’s traffic to another location, and the other Regions keep their local exit. It also covers the trade-offs, including inter-Region data transfer while a link is drained.
This post is for network architects and cloud platform teams who operate hybrid connectivity at scale, who are evaluating AWS Cloud WAN for global routing, or who are working through Direct Connect traffic engineering across Regions.
DeepL’s hybrid architecture
DeepL runs workloads in multiple AWS Regions, including three in Europe (eu-west-1 in Ireland, eu-central-1 in Frankfurt, and eu-north-1 in Stockholm), two in the United States (us-east-1 and us-west-2), and one in Tokyo (ap-northeast-1). Each Region has multiple virtual private clouds (VPCs) and accounts. On premises, two European data centers connect over a resilient Multiprotocol Label Switching (MPLS) network with dedicated fiber between the sites.
The connectivity design is built for geographic redundancy:
Three AWS Direct Connect locations (Dublin, Copenhagen, and Stockholm), each with a hosted 25 Gbps connection through AWS Direct Connect Partner Megaport.
An AWS Cloud WAN core network with a core network edge (CNE) in multiple Regions that connects the VPCs and accounts in that Region.
One global Direct Connect gateway, linked to all three Direct Connect locations and attached natively to the core network. Native Direct Connect gateway attachments for AWS Cloud WAN have been available since November 2024.
The same prefixes advertised from the on-premises routers in both data centers, so that the Direct Connect gateway learns them over all three Direct Connect locations (simplified here to a single /16).
The following diagram shows this architecture.
Figure 1: DeepL’s hybrid architecture with AWS Cloud WAN
In steady state, DeepL runs no additional traffic engineering. By default, egress traffic leaves AWS through the Direct Connect location closest to where it originated: traffic from eu-west-1 leaves through Dublin, traffic from eu-central-1 through Copenhagen, and traffic from eu-north-1 through Stockholm. This closest-exit behavior keeps latency low and avoids extra configuration.
Minimize network impact with single-link maintenance
DeepL wanted to take the router at one Direct Connect location out of service for a maintenance window. Traffic had to move off that single link while the other two locations kept serving their Regions as before. This is a common requirement for enterprises running multiple Direct Connect locations.
Where the egress decision is made
Before changing any Border Gateway Protocol (BGP) attribute, it helps to know which component makes the egress decision, because that determines which attributes influence it. With Direct Connect attached to an AWS Cloud WAN core network, path selection happens in two places:
The Direct Connect gateway.
Each core network edge.
Path selection on the Direct Connect gateway
For a prefix reachable through multiple Direct Connect locations, the Direct Connect gateway prefers the path with the highest BGP local preference. By default, AWS sets a medium local preference (community 7224:7200) on the Direct Connect locations associated with the Region where the traffic originates, and a lower value on other locations. Local preference is evaluated before AS_PATH. Setting a local preference community on a prefix applies one ranking to every Region the gateway serves, which suits designs that want the same preferred location everywhere.
The important detail is where local preference sits in the BGP best-path order. When a router has more than one route to the same destination, it walks an ordered list of tie-breakers and stops at the first one that produces a winner. On the AWS side, the first few steps are:
Longest prefix match.
Highest local preference (the closest-exit decision is made here).
Shortest AS_PATH.
Lowest MED.
Local preference is evaluated before AS_PATH. As the Direct Connect documentation states: “Local preference BGP community tags are evaluated before any AS_PATH attribute.” Because the default local preference already selects the Dublin location for eu-west-1 traffic, a longer AS_PATH on the Dublin path doesn’t change the gateway’s choice. The drain takes effect on the core network edge instead, as the next section shows.
Path selection on the core network edge
Each core network edge receives the on-premises path from the Direct Connect gateway with the AS_PATH preserved. Direct Connect BGP communities are only relevant to the Direct Connect gateway and don’t influence core network routing decisions. Each edge also learns the same prefix from its peer edges across the core network, and each of those paths is one AS hop longer because the peer edge adds its own autonomous system number (ASN). The core network edge evaluates AS_PATH length first, so by default each edge prefers the path through the Direct Connect gateway instead of the path from a peer edge. For the three European Regions in DeepL’s environment, that is the path through the Region’s local Direct Connect location. See Direct Connect gateway attachments in AWS Cloud WAN.
The following diagram shows how the eu-west-1 core network edge selects its exit in steady state.
Figure 2: Path selection on the eu-west-1 core network edge
This gives DeepL a per-Region lever. An on-premises AS_PATH prepend that makes one location’s path longer changes the decision only on the core network edge that uses that location.
Why DeepL doesn’t use local preference for the drain: By default, the Direct Connect gateway gives each Region its own preferred locations: the Direct Connect locations associated with that Region. That default is what gives each Region its closest exit, and it applies only while the prefix carries no local preference community. As soon as you tag a prefix, your ranking replaces the default and applies to every Region at once. DeepL advertises the same /16 from both data centers, so lowering the preference on the Dublin advertisement would change the exit for all Regions, not only eu-west-1. The Regions that aren’t being drained would lose their closest exit. A different ranking per Region would require more-specific prefixes per location, which is the per-link configuration DeepL wanted to avoid.
The maintenance drain in practice
To drain the Dublin link, DeepL prepends its prefixes on the Dublin virtual interface from its on-premises routers. This has two effects:
With at least two prepends, the path that the eu-west-1 edge receives from the Direct Connect gateway is longer than the paths it learns from the eu-central-1 and eu-north-1 edges. The eu-west-1 edge now prefers a peer path. When two peer edges offer identical routes, AWS Cloud WAN selects one of them. The eu-west-1 traffic then crosses the core network and leaves through either the Copenhagen or the Stockholm Direct Connect location.
The eu-central-1 and eu-north-1 edges are untouched. Their local path from the Direct Connect gateway is still the shortest, so closest exit is preserved everywhere except in the Region being drained.
The following diagram shows egress during a drain of the Dublin link.
Figure 3: Draining the Dublin Direct Connect link with an on-premises AS_PATH prepend
All BGP sessions stay up during the drain. The prepend makes the Dublin path less preferred, so traffic moves before the link is taken down. Because no routes are withdrawn, DeepL avoids the convergence gap that a route withdrawal causes. Of the three European edges, only the eu-west-1 edge changes its decision.
Draining the Dublin link, step by step
Validate each step in a non-production environment first.
Confirm steady state: each Region’s core network edge egresses through its local Direct Connect location.
Apply the on-premises AS_PATH prepend (at least two prepends, and DeepL uses five) to DeepL’s prefixes advertised on the Dublin Direct Connect virtual interface, so that the path the eu-west-1 edge receives from the Direct Connect gateway is longer than the paths it learns from its peer edges.
Lower the BGP local preference on the Dublin sessions on DeepL’s on-premises routers, so that traffic toward AWS also moves to the Copenhagen and Stockholm Direct Connect locations.
Verify that the eu-west-1 edge now selects a path learned from the eu-central-1 or eu-north-1 edge, and confirm that those two edges still egress locally.
Confirm that traffic in both directions has shifted off the Dublin link and is stable.
Perform the physical or router maintenance on the drained Dublin link.
Reverse the change: remove the prepend, restore the local preference on the Dublin sessions, and confirm the eu-west-1 edge returns to its local Dublin path.
Considerations
Plan for the following before you use this pattern:
Inter-Region data transfer: While the drain is in place, eu-west-1 traffic crosses Regions on the core network. Plan for inter-Region data transfer charges for the duration of the maintenance window.
Prepend count: Use at least two prepends. A single prepend only ties the path length with the peer paths, and on a tie AWS Cloud WAN prefers the route propagated from the Direct Connect gateway, so the drained location would still be used. DeepL uses five prepends for margin.
Fallback location: With default path selection, AWS Cloud WAN chooses between equal peer paths, so you don’t control whether Copenhagen or Stockholm takes the displaced traffic. Routing policies, covered in the next section, address this.
Traffic toward AWS: The prepend only steers traffic leaving AWS. Traffic from the data centers toward AWS is chosen by DeepL’s own routers. During a drain, DeepL lowers BGP local preference on its routers for routes learned over the Dublin sessions, so this traffic also moves off the drained link, and restores it afterward. This setting only affects DeepL’s own routers. It is separate from the Direct Connect local preference communities described earlier, which DeepL doesn’t use. Because the two directions are chosen independently, traffic can leave AWS through one location and return through another. If a stateful firewall sits in the path, traffic must be symmetric, so make sure both directions use the same fallback location.
Regions without a local Direct Connect location: Check egress for Regions that have no local Direct Connect location, such as the US and Tokyo Regions in DeepL’s case, before and during the drain, and confirm that none of them still uses the drained link.
What’s next for DeepL: AWS Cloud WAN routing policies
The maintenance drain uses the default path selection of AWS Cloud WAN and doesn’t need a routing policy. Going forward, DeepL plans to adopt routing policies.
AWS Cloud WAN routing policies are priority-ordered rules that give explicit control over route propagation and BGP path attributes inside the core network. Two use cases are on DeepL’s roadmap:
Deterministic maintenance failover: With default path selection, AWS Cloud WAN chooses which remaining location takes the displaced traffic. With a routing policy, DeepL can set an explicit preference, so a drained Region’s traffic lands on a location that DeepL chooses.
Route filtering and summarization: As DeepL adds locations, a routing policy can summarize routes in the core network instead of DeepL hand-crafting more-specific routes per link. This keeps the number of advertised routes manageable.
Conclusion
For multi-Region enterprises that rely on default closest-exit egress, it helps to identify where the egress decision is made before changing BGP attributes. With Direct Connect attached natively to AWS Cloud WAN, each core network edge makes that decision based on the preserved on-premises AS_PATH. DeepL uses this to drain a single Direct Connect link with an AS_PATH prepend while every other Region keeps its local exit. As a next step, DeepL plans to use AWS Cloud WAN routing policies to choose the fallback location and to summarize routes.
When your food-ordering platform doubles its brand count, dedicated clusters become your biggest cost problem, and every failed request during a traffic surge is a lost sale.
Here is how Cognizant and AWS Professional Services solved it.
Cognizant is a global services company that helps organizations modernize technology, reimagine processes, and transform customer experiences. Its OrderServ service is an omnichannel ordering solution for the food services industry that supports ordering across devices and integrates with point-of-sale, kitchen display, payment, loyalty, and other enterprise systems. Cognizant is an AWS Premier Tier Services Partner with multiple AWS Competencies and a member of the AWS Managed Service Provider (MSP) and AWS Well-Architected Partner Programs.
Since then, the service grew from serving a single quick-service restaurant (QSR) brand to powering multiple brands across markets. Each brand ran as a dedicated Amazon Elastic Container Service (Amazon ECS) cluster with 21 microservices. This provided hard isolation, but cost scaled linearly with every brand onboarded, and scaling speed could not keep up with promotional traffic surges that spike 5–10× within minutes.
In this post, we describe how AWS Professional Services partnered with Cognizant to transform OrderServ into a multi-tenant software as a service (SaaS) offering, achieving 47–64 percent compute cost reduction, scaling time reduced from 5–7 minutes to 30–60 seconds, and authentication costs cut by 80 percent.
The problem: Dedicated clusters don’t scale with brands
OrderServ 2.0 ran 21 microservices per brand on dedicated AWS Fargate clusters. For five brands, this meant:
105 ECS services (21 × 5), each with idle capacity during off-peak hours.
315 sidecar containers for observability, configuration, and log routing, duplicated per brand.
Linear cost growth, because onboarding a new brand required provisioning an entire cluster.
5-minute scaling gap, because large container images increased image-pull and task startup times on AWS Fargate, delaying the addition of capacity during promotional traffic surges.
In QSR, every failed request during a surge is a lost sale and users may switch to competitor services immediately. The service needed to serve over 10 brands cost-effectively while handling unpredictable traffic patterns: lunch rushes, promotional events, and festival surges.
Solution overview
We addressed these challenges through four architectural changes:
Shared ECS cluster with a tenancy library: Application-level isolation replaces per-brand infrastructure.
Crash observability pipeline: Zero-loss logging and 90-day forensics at $10/month per service.
Passkeys for multi-tenant authentication: Biometric login reduces recurring SMS costs.
Solution 1: Shared cluster with application-level isolation
As OrderServ scaled from one to five brands, the cost of replicating 21 microservices per tenant made the economics unsustainable. We needed to consolidate infrastructure while preserving the data isolation guarantees each brand required.
Why we moved away from dedicated clusters
The dedicated-cluster model provided strong isolation but no economy of scale. With the platform growing from five brands, onboarding a new brand needed to become a configuration change, not an infrastructure provisioning exercise.
Model
Pros
Cons
Dedicated cluster per brand (status quo)
Hard isolation, simple AWS Identity and Access Management (IAM)
Linear cost, idle capacity, slow onboarding
Shared cluster with opt-out
Aggregate scaling, config-only onboarding
Requires application-level isolation, wider IAM scope
We chose the shared cluster as the default, with the ability to place high-volume brands on dedicated clusters when needed.
Figure 1 illustrates this transformation, from five dedicated ECS clusters (105 services, 315 sidecar containers) to a single shared cluster with 21 services and an opt-out path for high-volume brands. The tenancy library handles tenant resolution, resource routing, and context propagation, while per-tenant data stores (Amazon DynamoDB, Amazon Aurora, Valkey) maintain strict data isolation.
Figure 1: Evolution from dedicated clusters per brand to a shared cluster model with opt-out for high-volume brands
The service uses AWS Key Management Service (AWS KMS) keys to encrypt every data store at rest, and the architecture implements Transport Layer Security (TLS) to protect all service-to-service and client-to-service communication. Amazon DynamoDB automatically encrypts tables by default. Customers enable encryption when creating Amazon Aurora Clusters and the Amazon Elastic File System (Amazon EFS) file system, and customers configure both at-rest and in-transit encryption for the Amazon ElastiCache for Valkey cluster.
The tenancy library as primary isolation
Most multi-tenant architectures enforce isolation at the infrastructure level: separate accounts, separate IAM roles, or separate compute. We took a different approach: a shared .NET Core library as the primary enforcement point for tenant isolation. IAM and resource policies are the backstop that contains the blast radius when the library has a defect.
Every request carries an X-Tenant-Id header injected by the Amazon API Gateway authorizer. The tenancy library:
Resolves tenant context per request using request-scoped storage (AsyncLocal<T>), never static or singleton state.
Routes all data access: Amazon DynamoDB table names, Amazon ElastiCache for Valkey key prefixes, Amazon Aurora schema selection, and S3 paths.
Refuses to construct resource IDs without a tenant prefix, so a missing tenant context fails closed instead of reading another tenant’s data.
Propagates tenant context on service-to-service calls and asynchronous messages (SQS/SNS attributes).
Enriches every log line and distributed trace with the tenant ID.
This design means the same service binary runs identically in a shared cluster or a dedicated cluster. The compute model becomes a deployment decision, not an architectural constraint.
Application-level isolation moves the isolation boundary into code, and code could potentially have defects. Because an Amazon ECS task role is granted per task rather than per request, a task in the shared cluster necessarily holds permissions spanning every brand it serves. To narrow that scope, the tenancy library acquires tenant-scoped credentials at run time: it calls sts:AssumeRole with the tenant ID as a session tag, and the role’s policies reference that tag so the credentials reach only that tenant’s DynamoDB tables, S3 prefixes, and Aurora schema. Amazon ElastiCache for Valkey enforces its own layer, with per-tenant role-based access control (RBAC) users restricted to the tenant’s key pattern, so the cache engine itself refuses a cross-tenant key access rather than trusting the library to have built the key correctly.
Impact
The following table compares key operational metrics (service count, sidecar overhead, onboarding time, and capacity utilization) before and after the migration to a shared cluster model.
Metric
Before (dedicated)
After (shared + library)
ECS services to deploy
21 × N brands
21 total
Sidecar containers
315 (for 5 brands)
63 total
Onboarding a new brand
Provision full cluster (days)
Configuration change (minutes)
Idle capacity
Per-brand (wasted)
Aggregate (efficient)
Solution 2: EC2 warm pools with Bottlerocket for sub-minute scaling
With all brands now sharing a single cluster, traffic spikes from any one brand could impact the others. We needed a scaling strategy that could absorb sudden surges in seconds, not minutes.
Why we moved away from AWS Fargate
AWS Fargate removes infrastructure management, but OrderServ required additional capacity in under a minute during unpredictable demand surges. New tasks took 5–7 minutes to become healthy, primarily because Fargate had to download and extract the workload’s large container image before starting the application. Task provisioning, application initialization and health checks added to the delay, but image retrieval was the largest contributor. During this interval, existing ECS tasks become saturated, latency increased and some orders started failing.
The solution: EC2 Auto Scaling groups with warm pools
The system pre-initializes and stops warm pool instances, and you pay only for Amazon Elastic Block Store (Amazon EBS) storage (~$3/month per instance).
When ECS needs capacity, the Auto Scaling group (ASG) starts a stopped instance (image pre-cached, ECS agent registered) in 30–60 seconds.
We set capacity headroom (target utilization at 80 percent), so that the first wave absorbs instantly.
Rather than relying on a single scaling mechanism, we implemented five complementary layers, each targeting a specific traffic pattern to remove gaps between detection and response.
Layer
Mechanism
Traffic pattern solved
Predictive
ECS predictive scaling (machine learning, 14-day history). Scheduled scaling for specific known events (New Year, Christmas) was already handled manually via ASG scheduled actions
Daily lunch/dinner peaks, scheduled scaling
Reactive
Target tracking on ALBRequestCountPerTarget (60s)
Unexpected moderate spikes
Headroom
EC2 ASG target capacity at 80%
First wave of any spike
Downstream
ECS Service Connect RequestCount metric
Bottleneck shifting
Throttling
API Gateway per-tenant rate limits via AWS Lambda authorizer
Extreme surges (noisy neighbor)
Figure 2 illustrates how the five scaling layers work together with the EC2 warm pool. Pre-initialized warm pool instances launch in 30–60 seconds versus 5–7 minutes for an AWS Fargate cold start, at a cost of approximately $3/month per stopped instance.
Figure 2: Five-layer scaling strategy
Cost and performance impact
In addition to improving scaling performance, the move from AWS Fargate to Amazon EC2 reduced the projected monthly cost of running 21 services in the Asia Pacific (Mumbai) AWS Region (ap-south-1). Two instruments do different jobs here: On-Demand Capacity Reservations is designed to make sure capacity is available in the Availability Zone when a surge activates the warm pool, and Compute Savings Plan supply the discount. The reservation carries no term commitment and can be resized or released as the fleet changes, so the following one-year and three-year terms apply to the Savings Plan alone.
Approach
Monthly cost (21 services)
versus AWS Fargate
AWS Fargate On-Demand (before)
~$1,568
Baseline
EC2 ASG with 1-year Compute Savings Plan and warm pool
~$832
~47%
EC2 ASG with 3-year Compute Savings Plan with warm pool
~$568
~64%
The reservation covers the steady-state fleet, while you stop warm pool instances, adding approximately $30 per month in Amazon EBS storage costs. Scaling time falls from 5–7 minutes to 30–60 seconds.
Solution 3: Crash observability pipeline
When containers crash in production, the support team needs three things: what happened, the root cause, and the container’s execution state at the time of failure. In the prior state, OrderServ used the awslogs driver to send container output to CloudWatch Logs. Although this captured normal application output, it did not provide durable task-stop metadata, cross-service request correlation or persistent crash artifacts.
Potential loss of final logs records during crash: When a task terminates abruptly, records still in the log driver’s delivery buffer might not reach Amazon CloudWatch Logs.
Short lived task metadata: Amazon ECS makes stopped-task information available through the API for a limited period of 1 hour, reducing the investigation window.
No cross-service correlation: Plain-text logs lacked trace IDs and consistent task, container, and service identifiers needed to follow a failed request across services.
No persistent crash artifacts: The ephemeral task storage of AWS Fargate disappeared when the task stopped, taking local crash dumps and diagnostic files with it.
The solution: FireLens sidecar + Amazon EventBridge persistence
Figure 3 shows the crash observability pipeline, where the application container emits structured JSON logs with X-Ray trace IDs to a FireLens (Fluent Bit) sidecar. The sidecar survives container termination and routes logs to CloudWatch Logs with Infrequent Access class and 30-day retention, as well as to Amazon Simple Storage Service (Amazon S3) with gzip partitioning and 365-day retention. Amazon EventBridge captures task-stop events with full metadata, while the AWS Distro for OpenTelemetry (ADOT) collector provides auto-instrumented traces to X-Ray and EFS persists crash dumps across availability zones, all at approximately $10/month per service.
Figure 3: Crash observability pipeline. FireLens operates at the container runtime level, surviving application container crashes. Amazon EventBridge persists task metadata for 90 days
FireLens (Fluent Bit) as a sidecar is the key architectural choice. ECS redirects the application container’s stdout at the container runtime level. If the app container receives an out-of-memory (OOM) kill, Fluent Bit still has the logs.
For hard crashes where application logs are not sufficient (stack overflow, native code fault), the .NET Core runtime automatically writes a mini dump to an Amazon EFS mount at /tmp/dumps/<container-id>. Because Amazon EFS writes are immediately durable and the mount survives container death, the process state (thread call stacks, heap objects, loaded modules) helps preserve diagnostic information after a SIGKILL. An AWS Lambda function copies dumps to S3 for analysis without VPC access. Cost: ~$0.02/month.
Amazon EventBridge to Amazon CloudWatch Logs persists the complete Amazon ECS task state change event with 90-day retention. No AWS Lambda function is required.
Every log line is structured JSON with the AWS X-Ray trace ID. The support workflow: search for an error, find the trace ID, open X-Ray, and see the full request flow across all 21 services.
We also use CloudWatch Logs Infrequent Access class with FireLens dual output (CloudWatch + S3), reducing observability costs by 62 percent per service.
Cost: approximately $10/month per service for the complete pipeline.
Solution 4: Passkeys for multi-tenant authentication
QSR mobile apps need instant login. Every second of friction is a lost order. The service previously relied on SMS one-time password (OTP) for every login, which at millions of monthly active users meant significant costs and user friction.
Passkeys with per-brand cryptographic isolation
We implemented passkeys (WebAuthn) using the native support in Amazon Cognito:
First-time registration: Phone number + OTP verifies identity, then the device registers a passkey bound to the Secure Enclave.
Every subsequent login: Face ID or fingerprint, which completes in about 2 seconds with no SMS cost.
New device or stale profile: Because carriers reassign phone numbers, possession of a number is treated as a claim rather than proof of identity. Registering a passkey on a new device repeats the OTP verification, and a profile whose last verification predates our revalidation window is re-verified before any registered credential is honoured.
Per-brand isolation: Each brand operates its own Cognito User Pool with a distinct Relying Party ID that is cryptographically isolated at the OS level.
A Post-Authentication Lambda (about 60 lines) maintains a customer authentication profile in DynamoDB, keyed by a hash of the brand/tenant id and the customer’s phone number. Because the brand ID is part of the key, the same customer registering with two brands produces two unrelated records, and the system cannot locate any record without the brand context. The profile stores only authentication state, such as which devices were registered and when each was last verified. It holds no order history, loyalty balance, or other brand-specific data. Passkey credentials are isolated by the same principle: because each brand uses a distinct Relying Party ID, the authentication flow prevents presenting a credential registered for one brand to another brand, and the device enforces that boundary. The implementation required about 95 lines of custom code to integrate with Amazon Cognito’s authentication logic.
Metric
Before
After
Cost per login
~$0.03 (SMS OTP)
$0 (passkey)
Login latency
15–30 seconds
~2 seconds
SMS cost reduction
—
80%+ at steady state
Phishing resistance
None
Cryptographic (device-bound)
Overall results
The architectural evolution delivered compounding savings:
Dimension
Before
After
Improvement
Compute cost
AWS Fargate On-Demand
EC2 + Warm pools + ODCR + Compute Savings Plan
47–64% reduction
Scaling speed
~ 5-7 minutes
30–60 seconds
5–10× faster
Observability cost
Standard CW Logs
IA + FireLens + S3
62% reduction
Authentication cost
SMS OTP every login
Passkeys
80%+ reduction
Tenant onboarding
Manual, multi-day
Configuration-driven
Days → minutes
Crash diagnosis
“Exit Code: 1”
Full trace + stack trace
Blind → full visibility
For a service serving over 5 brands, the combined annual savings exceed 60 percent of the previous infrastructure cost, while simultaneously improving scaling speed, operational visibility, and user experience.
Conclusion
In this post, we showed how Cognizant OrderServ evolved from a single tenant microservices service to a multi-tenant SaaS service by making four architectural changes: shared compute with a tenancy library, Amazon EC2 warm pools for sub-minute scaling, a crash observability pipeline, and passkeys for frictionless authentication. The architecture addresses key failure modes through tenant validation, capacity headroom, per-tenant throttling and dedicated-cluster for high-volume brands. These capabilities introduce trade-offs, including greater application-level isolation, EC2 capacity management and compute Savings Plan commitments.
The key insight is that multi-tenancy does not require infrastructure isolation for every tenant. A well-designed tenancy library with strict resource-routing conventions provides application-level isolation while sharing compute, making the isolation model a deployment decision rather than an architectural constraint.
If you operate a multi-brand or multi-tenant service on Amazon ECS and face similar challenges with cost scaling or surge handling, consider these patterns:
Evaluate whether your isolation requirements truly need per-tenant infrastructure, or whether application-level isolation with per-tenant data stores is sufficient.
For workloads with unpredictable surges, compare the total cost of AWS Fargate over-provisioning against EC2 warm pools with compute Savings Plan.
Use FireLens sidecars for log delivery in any environment where container crashes are possible.
When your security team has four engineers and your organization has over 100 digital product teams, threat modeling becomes a bottleneck fast. That was the challenge TUI faced. TUI operates across the travel and tourism industry with airlines, hotels, cruise ships, and local travel experiences. Our Platform & Engineering division needs security assessments to keep pace.
At TUI, each threat modeling session took 4–6 hours of manual work: reviewing architecture diagrams, mapping threats to internal standards, researching security issues, and documenting findings in Confluence. The team could complete only 3–4 sessions per month, leaving a constant backlog.
TUI needed threat modeling to become mandatory for every new service, not a luxury TUI reserved for the highest-priority projects. TUI built an AI-powered threat modeling system using Amazon Bedrock, collaborating with the AWS Generative AI Innovation Center during a 10-week proof of concept (PoC) to develop and validate the architecture. Amazon Bedrock is a fully managed service for building generative AI applications, and TUI used the Claude Sonnet 4.5 foundation model from Anthropic. TUI chose Amazon Bedrock for managed access to Claude Sonnet 4.5 without operating model infrastructure, its extended thinking support that the workflow uses for deeper analysis, and its integration with the AWS services already in TUI’s stack. TUI deployed the agentic workflow on Amazon Bedrock AgentCore runtime, part of Amazon Bedrock AgentCore, a platform to build, connect, and optimize agents at scale with any framework or model. AgentCore runtime hosts the agent in production without provisioning or scaling infrastructure. After the PoC, TUI took the system to production within 30 days.
In this post, we describe how TUI built an agentic AI workflow for threat modeling, the iteration process that shaped the architecture, and the results after deployment.
The challenge
TUI’s security engineering team followed a thorough but manual process: for each application, an engineer reviewed the architecture, identified threats using STRIDE methodology, mapped them to TUI Technology Standards, P&E-specific standards, and ISO 27001 controls, and documented findings in Confluence with Jira tickets.
With 100+ digital product teams and only 3–4 sessions possible per month, most teams waited weeks for their review. Security engineers also had varying levels of expertise across technology stacks, and there was no automated way to verify these standards were consistently applied to every assessment.
Solution overview
The solution extends AWS Threat Designer with TUI-specific capabilities through a serverless architecture deployed in the eu-central-1 (Frankfurt) AWS Region. Model availability varies by Region. For model availability by Region, refer to Supported models by AWS Region in Amazon Bedrock. Together, these services replace the manual review process with an automated workflow that applies TUI Technology Standards and P&E-specific standards consistently. The system uses the following key services:
Amazon Bedrock for threat analysis and generation using Claude Sonnet 4.5 from Anthropic, with configurable extended thinking budgets.
Amazon Bedrock AgentCore runtime for hosting the agentic workflow as a managed, serverless runtime. It runs the containerized LangGraph agent without provisioning or scaling infrastructure, supports long-running sessions that exceed typical function timeouts, and provides per-session isolation for concurrent threat models.
AWS Lambda for serverless backend compute with LangGraph workflow orchestration.
Amazon DynamoDB for workflow state management with resume capability.
Figure 1: TUI Threat Designer system architecture. Users authenticate through Amazon Cognito and interact with the React front end hosted on AWS Amplify. Requests flow through Amazon API Gateway to AWS Lambda, which orchestrates the LangGraph workflow through Amazon Bedrock AgentCore. The agent uses Amazon Bedrock (Claude Sonnet 4.5 from Anthropic) for threat analysis, with Amazon DynamoDB for state management and Amazon S3 for architecture diagram storage and caching.
The core is a LangGraph-based agentic workflow that processes architecture diagrams through several specialized nodes. Engineers upload one or more diagrams (for example, a high-level architecture alongside a detailed network topology), which the workflow converts to base64 to identify components and data flows. It then loads relevant security standards and generates threats with iterative refinement. The workflow runs gap analysis, optionally compares against a subject matter expert (SME) assessment, and assembles the final threat model with export options (PDF, JSON, or Confluence).
The following screenshot shows the submission wizard. Engineers provide a title, upload architecture diagrams, add optional context and assumptions, and select a reasoning depth based on architecture complexity. The entire setup takes approximately two minutes.
Figure 2: The submission wizard guides engineers through a six-step process. The iterations slider controls the reasoning budget, from None for quick scans to High for complex architectures with 20 or more components.
Once submitted, the system processes the architecture through each workflow node with real-time progress tracking. Engineers can monitor which phase is active and return to review results when processing completes.
Figure 3: Real-time progress tracking shows the current workflow phase. The Thinking indicator on the Threats node reflects the extended thinking capability of Claude analyzing the architecture against TUI security standards.
The iteration journey: from brute force to intelligent selection
TUI’s team didn’t arrive at the final design on day one. They iterated through several approaches, and each failure pointed toward the next improvement.
Attempt 1: Load everything into the prompt. The first approach loaded all 192 TUI security standards (338 KB) directly into the foundation model context. This failed immediately. Some individual standard documents run 20+ pages, and the combined content exceeded token limits before the foundation model could begin threat analysis.
Even with a subset of standards, the foundation model struggled to follow structured instructions. When asked to recommend only TUI-approved tools for mitigations, it would ignore the approved tool list and suggest generic alternatives. Too much contradictory information from different standards confused the model.
Attempt 2: Metadata-driven selection. The breakthrough came from treating the problem as a search and selection challenge rather than a prompt-loading exercise. Instead of loading all standards, the team pre-generated lightweight metadata for each document: keywords, component types, STRIDE categories, and a relevance score.
At runtime, the foundation model reviews this metadata (about 60 KB) and selects only the 16 most relevant standards for the specific architecture being analyzed. This reduced context from 338 KB to 21 KB, a 94% reduction, while maintaining coverage. The reduction is calculated from the metadata approach versus loading all standards directly.
The metadata approach fits the structure of TUI’s knowledge base: some documents are always mandatory (security guidelines, approved tools), while others apply only to certain architectures. The team also evaluated retrieval-augmented generation (RAG), but with a bounded corpus of 192 standards, some mandatory regardless of the query, metadata-driven selection proved more predictable and easier to debug. RAG may complement it as the knowledge base grows.
Agentic threat generation: a self-correcting workflow
The threat generation node is where the agentic behavior matters most. Rather than generating threats in a single pass, the system uses a Reason and Act pattern with a LangGraph subgraph. The agent has four tools at its disposal: adding threats, deleting threats, reading the current threat catalog, and running gap analysis.
The agent autonomously decides which tools to call and in what order. It generates an initial set of threats using STRIDE methodology, then reviews its own output against the loaded TUI standards. Each threat includes a title, description, affected component, and threat vector. It also assigns likelihood and impact scores using TUI’s risk matrix. Threats include recommended mitigations with TUI-approved tools and mapped ISO 27001 controls.
A tool budget system helps prevent the agent from generating indefinitely. After three threat-generation calls, the system forces a gap analysis. The agent must step back and assess what’s missing before generating more. This mimics how human security experts work: generate, review, identify gaps, fill them.
A validation node checks three conditions before the workflow can proceed: the threat catalog isn’t empty, all six STRIDE categories are covered, and gap analysis has been performed at least once. If a check fails, the agent receives specific feedback and loops back.
Based on TUI’s production data, the combination of iterative generation and gap analysis typically produces 40–60 threats per architecture, compared to the 30–40 that manual sessions identified. It also supports configurable extended thinking budgets, from 24K reasoning tokens for standard architectures up to 64K for complex systems.
Web search for current threat intelligence
Security threats evolve regularly. A threat model generated today needs to account for issues disclosed last week. The workflow integrates web search to fill gaps where TUI’s internal standards don’t cover specific technologies.
For every technology identified in the architecture (Keycloak, Kong, Redis, and so on), the system generates two search queries: one for known issues and one for hardening best practices. These queries target authoritative sources such as OWASP, NIST, and CWE databases. Before making an API call, it checks an Amazon S3-based cache with a 7-day time-to-live (TTL). Only technology component names are used for external searches. Architecture details and customer data are not included in queries.
The cache key uses a hash of the sorted component names, deliberately excluding foundation model-generated descriptions. Those descriptions vary slightly between runs even for the same diagram, which would reduce cache effectiveness.
Based on TUI’s monitoring data, the cache achieves a 70–80% hit rate because many TUI applications share core technologies. A cache hit returns results in under 100 milliseconds, compared to 2–3 seconds for a live search. TUI’s team evaluated multiple search providers during the PoC and designed the system with a pluggable provider architecture, allowing provider switching as capabilities evolve.
SME comparison: human-in-the-loop validation
TUI’s security engineers don’t just use the system. They validate it. The workflow includes an optional node where engineers upload their own manually created threat assessment as a PDF. The workflow extracts threats using Claude, normalizes risk ratings to a standard scale (LOW, MEDIUM, HIGH, CRITICAL), and matches them against the AI-generated threats using semantic similarity.
When the AI and the SME disagree on a threat’s severity, the system flags the discrepancy with both ratings and the SME’s rationale. For example, the AI might rate a credential stuffing event (automated login attempts using unintended disclosure of credential databases) as HIGH while the SME rates it MEDIUM. Over time, these comparisons calibrate the system’s risk scoring and surface areas where the AI consistently over- or under-estimates risk.
The following screenshot shows an SME Comparison Alert for a credential stuffing threat. The system matched the AI-generated threat with a similar SME threat, compared both ratings (AI: High, SME: HIGH), and provided the SME’s rationale alongside a recommendation.
Figure 4: An SME Comparison Alert for a credential stuffing threat. The system displays both the AI and SME ratings, the matched SME threat, the expert’s rationale, and a recommendation. In this case, ratings are consistent. When they disagree, the alert highlights the discrepancy for human review.
Path to production: 30 days from handover to live
After the PoC handover, TUI’s team took the system from prototype to production-ready deployment in 30 days. The following results reflect the system’s performance in production.
Results
Metric
Before
After
Time per assessment
4–6 hours
Up to 70% reduction*
Sessions per month
3–4
10–12 (300% increase)*
Standards applied
Varies by engineer
100% consistent
Threats identified
30–40
40–60 per architecture
Mandatory for all teams
No (backlog too large)
Yes (feasible at scale)
*Based on TUI’s internal measurements comparing pre- and post-deployment performance.
The solution processes each architecture in the eu-central-1 Region, with data encrypted at rest using AWS Key Management Service (AWS KMS) and in transit with TLS. Architecture diagrams and threat models are processed within the AWS infrastructure, helping TUI meet its data residency and security requirements.
The following screenshot shows the threat catalog, a card view of completed threat models. Each card displays the original architecture diagram, an AI-generated description, completion status, and threat counts by severity (red for high, yellow for medium, green for low).
Figure 5: The threat catalog provides an overview of completed threat models. Each card shows the architecture diagram, an AI-generated summary, and threat counts grouped by severity.
Engineers can select a threat model to view a dashboard with four analytical views: threats by likelihood, threats by STRIDE category, threats by target asset, and threat sources.
Figure 6: The insights dashboard for a completed threat model. This example shows 40 identified threats (6 high, 24 medium, and 10 low) distributed across all six STRIDE categories and mapped to specific architecture components.
“In the first four weeks after launch, 64 users registered and 19 unique creators produced 34 threat models with Threat Designer. What previously took one to two weeks per assessment is now available on demand. As of October 2026, adoption has grown to 255 registered users, 86 threat models, and 43 active creators, demonstrating that teams are embracing self-service security as part of their development workflow.”
— Marvin Jordan, Head of Technology for Security Platform and Practices, TUI
Conclusion
TUI’s experience shows that agentic AI workflows can address a real operational challenge in enterprise security: making thorough threat modeling fast enough to be mandatory. The combination of metadata-driven context selection, self-correcting threat generation, and intelligent caching allowed a four-person security team to support over 100 digital product teams. TUI achieved consistent, standards-aligned assessments at scale.
Looking ahead, TUI plans to expand the system with automated Jira ticket creation for mitigation tracking and integration with CI/CD pipelines for pre-deployment security checks.
This post is co-written with Tomislav Lozancic, Hrvoje Lukavski from BMW Group, and Hugo Cardoso from CTW.
BMW Connected Company, a division within BMW Group, develops and operates premium digital services for BMW’s connected vehicle fleet of more than 24.5 million vehicles worldwide. Critical TechWorks (CTW), established in September 2018, focuses exclusively on developing software for BMW Group’s future connected vehicle fleet.
In 2024, BMW Connected Company began migrating its Connected Vehicle platform, known internally as Orbit, from x86 to Arm-based compute as part of a broader modernization strategy to advance BMW Group’s economic and environmental goals.
In this post, we share the methodology behind the migration, tooling and patterns that helped application teams move to AWS Graviton at their own pace, without service disruption.
Laying the groundwork
Before applications could adopt a new processor architecture, the platform needed a more flexible provisioning layer. The team adopted Karpenter, replacing fixed Managed Node Groups with dynamic, policy-driven node pools that could provision the right instance type automatically. You can read more about this migration in Transforming the BMW Connected Vehicle Backend with Karpenter.
With the compute foundation in place, the next challenge was supporting multi-architecture builds. Building, testing, and deploying the same application for two architectures without slowing teams down required extending the continuous integration and continuous delivery (CI/CD) platform. Build runners needed to target both x86 and Arm while producing dual build pipelines, as described in the following section.
To surface potential issues early and minimize disruption, the team first validated Graviton on a set of self-contained services. Dedicated Graviton runners operated alongside the existing x86 fleet during this phase. The price-performance advantage of Graviton was confirmed immediately, with lower cost per build minute and faster build times, justifying the business case for wider adoption.
Building on these initial results, the team designed the wider platform rollout around two complementary tracks.
Dual build pipelines: Building and shipping both CPU architectures in parallel, giving applications a non-disruptive path to transition independently.
Container hosting: Extending support into the centralized container platform, so applications could be hosted on Graviton.
The following figure shows the six-stage journey to adopt AWS Graviton. The stages are grouped into two phases: a build-foundation phase and a workload-migration phase.
Figure 1: AWS Graviton adoption journey across the Connected Vehicle platform
Supporting adoption
Getting teams onto Graviton depended less on policy than on removing friction. The following practices lowered the barrier to entry, beginning with the build pipeline.
1 – Multi-architecture builds
As outlined earlier, every container image needed to support both architectures before workloads could run on Arm-based instances. To achieve this, two complementary build approaches were used: emulated builds using Docker Buildx with QEMU, and native builds on Graviton-based runners.
Both approaches produce multi-arch images by publishing a manifest list (OCI image index) alongside the architecture-specific images. When a container runtime pulls a tagged image, it reads the manifest and automatically selects the correct variant for the node’s architecture. This means a single image tag serves both arm64 and amd64 nodes transparently.
2 – Mirroring base images
Public images are mirrored into a private Amazon Elastic Container Registry (Amazon ECR) to achieve availability, immutability, and CVE compliance. To preserve multi-arch support during mirroring, the team uses Google’s Crane. Crane transfers images directly between registries and filters the manifest to only the required platforms, which avoids wasted storage from unused architectures.
Besides public images, custom application workloads also needed support for both architectures. Most Dockerfiles required no changes, because their base images and dependencies already supported multiple architectures. In some cases, an alternative or dependency with Arm support needed to be found. For the builds, two approaches were considered:
Native build per architecture: Each architecture is built and pushed separately on a runner with the matching architecture, followed by a final job that creates and pushes the image index. In GitHub Actions, this means one runner per architecture plus one index-creation step. This approach is more reliable but requires a dedicated runner for each target architecture.
Emulated builds from a single machine: Using Docker Buildx with QEMU, all architectures can be built and pushed from a single x86 or Arm runner. This streamlines the pipeline but introduces emulation overhead, often making builds significantly slower for compute-intensive workloads.
The team opted to support both approaches. For platform-scale adoption, Graviton runners were preferred because they ran arm64 builds natively. This avoided the QEMU emulation overhead and surfaced architecture-specific issues earlier in the pipeline. With GitHub Actions reusable workflows, teams can select the right fit for each use case. Dockerfiles use the QEMU path to avoid spinning up additional runners. Those with significant complexity, large dependency downloads, or long build times use native builds, where the overhead becomes problematic.
Graviton runner labels mirror the existing x86 labels, so adoption involves swapping x64 for arm64 in a single label.
3 – Defining Graviton NodePools
The following diagram shows the mixed-architecture Amazon Elastic Kubernetes Service (Amazon EKS) cluster, including how on-premises systems connect and how the Graviton and x86 node pools coexist.
Figure 2: Mixed-architecture Amazon EKS cluster with dedicated Graviton node pools and opt-in scheduling
Dedicated Graviton node pools let teams adopt without friction across each environment. The pools are shared and general-purpose by default, not tailored to individual workloads. This keeps the underlying infrastructure model consistent and predictable while still allowing teams to migrate on their own schedule. Karpenter’s automatic scaling foundation supports efficient resource allocation and rapid provisioning for both Arm and x86 workloads.
To avoid accidental scheduling, the Graviton node pools use taints. Workloads must explicitly opt in using a node selector and matching toleration. This supports controlled rollout and predictable behavior:
With this in place, only Arm-ready workloads are scheduled on Graviton nodes, while other workloads continue to run on amd64 nodes without disruption.
4 – Phased rollout
Before supporting broad adoption for application workloads, the team first validated the migration path by running core platform services (Karpenter, Prometheus, and operational tooling). This platform-first approach identified compatibility gaps early, refined node pool configuration, and established rollback patterns. Teams had a proven reference model before they were encouraged to opt in.
A key design principle was minimizing rollback risk by keeping both architectures viable simultaneously. Dual-arch images and a dedicated NodePool mean every application can run on both CPU architectures. If issues arise, workloads fall back to x86 without image rebuilds or pipeline changes.
Kubernetes node affinity rules prefer Arm without forcing it, so workloads naturally gravitate toward Graviton instances:
If a full rollback is needed, the GitOps-based ArgoCD deployment model makes recovery straightforward by reverting to the previous version in Git and letting ArgoCD reconcile the cluster state.
Results
The migration delivered approximately $600,000 in annualized infrastructure savings and measurable performance improvements. After moving the NGINX-based ingress controller from x86 to Graviton, key results included:
CPU consumption decreased by approximately 57 percent, while maintaining the same ingress profile.
Price-performance improved by around 40 percent, as lower CPU consumption per request increased throughput capacity per dollar spent.
Scaling efficiency improved at peak loads, with workloads requiring less compute capacity to handle equivalent traffic volumes.
Today, more than 65 percent of the platform runs on Graviton across production environments, a shift that supports BMW Group’s sustainability goals by reducing compute energy demand.
Lessons learned
Migrating a platform of this scale surfaced practical lessons that shaped the team’s approach and would benefit others considering a similar transition:
Opt-in scheduling: Use taints, selectors, and tolerations to make sure that only ready workloads migrate.
Multi-architecture images: One manifest-based tag for both architectures keeps releases straightforward and rollback instant.
Platform-first adoption: Validate on shared infrastructure first to reduce risk before teams opt in.
Optimization of emulated builds: This approach is useful for straightforward pipelines. Compute-heavy builds should use native or cross-compilation paths instead, which avoids unnecessary QEMU overhead and long build times.
Conclusion
BMW Group migrated its Connected Vehicle platform to AWS Graviton, achieving over $600,000 in annual cost savings and a 40 percent improvement in price-performance. The more than 130,000 daily builds and deployments that power more than 24.5 million connected vehicles continued without disruption.
The migration succeeded because of deliberate, incremental choices: taint-based node isolation, multi-arch container builds, and Karpenter’s ability to provision the right instance at the right time. Each layer reduced risk while keeping the rollout optional for individual teams. What started as a platform experiment is now the default compute path.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.