Urgent.News

What's breaking now, across thousands of outlets.

Tech

Agoda Replaces 72-Shard SQL Server Price Cache with DragonflyDB

Agoda migrated its 1.5 TB hotel Price Cache from 72 SQL Server shards to DragonflyDB to handle growing read and write volumes. The migration used staged dual reads, parity validation, gradual traffic shifting, and decentralized failover detection. Agoda reports an approximately eightfold reduction in P99 read latency, with two DragonflyDB clusters providing high availability. By Leela Kumili

Agoda has migrated its hotel price cache from a 72-shard Microsoft SQL Server to DragonflyDB, a memory-based datastore, to handle increasing read and write volumes. The cache, containing 1.5 TB of volatile pricing data, now handles over 300,000 reads and 1.5 million writes per second. After the migration, Agoda observed an approximately eightfold improvement in P99 read latency, with DragonflyDB serving around 300,000 requests per second in 8 milliseconds.

Previously, the architecture necessitated application-level shard routing across 72 SQL Server shards, making scaling laborious due to predefined hardware increments and manual shard remapping. With the workload doubling in early 2024, the team found that scaling SQL Server was no longer a viable or cost-effective strategy. DragonflyDB's shared-nothing, multithreaded architecture, Redis compatibility, cluster-based scaling, and built-in key expiration proved to be a better fit for the Price Cache workload, which relies heavily on MGET and SET operations.

Agoda initially deployed a 1 TB DragonflyDB instance for hot data and later expanded it to hold the entire 1.5 TB dataset across three-shard-per-cluster design. The migration was incremental, with dual reads introduced to ensure data parity between SQL Server and DragonflyDB before fully migrating customer traffic. Agoda employed Prometheus metrics to compare supplier counts and price-data lengths, achieving over 99.9% parity.

The final architecture introduced two DragonflyDB clusters for high availability, with each application pod independently monitoring the clusters' cache-hit ratios. In case of failure, the system could detect and failover without manual intervention within two minutes.

Written by urgent.news from InfoQ's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at infoq.com →

More in Tech

More from Monday 14 September →