System design interview guide
Agoda System Design Interview: How Hotel Search Serves Live Supplier Prices From a Cache
Short answer
A good scenario to practise for an Agoda system design interview is hotel price search. We have no public source that Agoda asks it. The key idea: many prices come from suppliers who cap requests per second, so the cache is the main path, not a shortcut. A search reads Agoda's Price Cache, which held about 1.5 TB and served about 300,000 reads a second. A miss starts a fetch within the supplier's limit. Each price is written back with a TTL chosen for its kind of search. Spare supplier budget pre-fetches the prices most likely to be booked. In this design, a fetcher with one token bucket per supplier enforces the limit.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $35 elsewhere, once
Get System DesignYou own this course
219 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
Agoda offers over 6 million holiday properties. Many of their prices come from third-party suppliers. These suppliers do not push prices to Agoda, and each one caps how many requests Agoda may send per second. So Agoda keeps a Price Cache. Before its move to DragonflyDB, Agoda wrote, that cache held about 1.5 TB of prices. It served about 300,000 reads and close to 1.5 million writes a second.
Designing Agoda's hotel price search means showing a fresh price for each hotel in a search result, fast. Many prices belong to outside suppliers, such as wholesalers. Agoda must ask them over HTTP, one request per price, and each supplier allows only a limited number of queries per second, or QPS. Agoda's own paper says that limit is never enough to cover every search. So searches read a shared Price Cache first. A hit returns at once. A miss shows no price from that supplier yet and starts a fetch, and the answer is written back with a time-to-live, or TTL, after which it expires. Agoda's engineers built PriceAggregator to decide how long each price lives and which prices to fetch before anyone asks. The cache itself moved from 72 SQL Server shards to DragonflyDB, an in-memory store that speaks the Redis protocol.
Where it shows up
A common type of question for backend and platform roles at travel and e-commerce companies: design a read-heavy cache in front of slow, rate-limited partners. It is a sibling of the classic design a hotel booking system question, but on the search side. We have no public source that Agoda uses this exact question. This guide is built from Agoda's own engineering writing, so you can reason with real numbers.
Spec sheetAgoda
- 01Writes for every read
- ~5
- 02Keys looked up per second
- ~3 million
- 03Memory per shard
- ~500 GB
- 04Searches per second
- ~23,000 average
worked through below, with the maths
Agoda in its own numbers
Every figure below is quoted from Agoda's own engineering writing. Tap a source to check it.
6M+
holiday properties on Agoda's platform
Agoda press release, Apr 20261M+ / s
requests to the Price Delivery System, across five data centres
Agoda Engineering, 2020~300,000 / s
reads from the Price Cache, before the DragonflyDB move
Agoda Engineering, 2026~1.5M / s
writes to the Price Cache, close to five for every read
Agoda Engineering, 2026~8 ms
P99 read latency on DragonflyDB, eight times better than before
Agoda Engineering, 2026~1,000
TTL groups that replace billions of daily searches in SmartTTL
PriceAggregator paper, Agoda, 2020
Why this question is asked
Price search tests four things at once. Can you design a cache whose source of truth is someone else's slow API, with a hard request limit? Can you reason about a TTL as a trade-off between hit rate and price accuracy, not a number you pick by habit? Can you spend a fixed request budget on the searches most likely to become bookings? And can you keep a terabyte-scale in-memory store highly available and swap it without customers noticing? A candidate who draws one cache with a 15 minute TTL and calls it done has missed most of it.
What the interviewer asks
“How would you design hotel price search at Agoda? A traveller searches for two nights in Bangkok for two adults. Show a price for each hotel from Agoda's suppliers within a fraction of a second. Each supplier only lets you send a limited number of requests per second, and the search traffic is far larger than that limit.”
Ask these back before you draw
- 1.Do suppliers push price changes to us, or must we ask each time? (Agoda's 2020 paper says these suppliers do not synchronise prices; Agoda asks with one HTTP request per price.)
- 2.Is a slightly stale price acceptable on the search result if we check it again before booking? (In Agoda's booking flow, the price is confirmed as eligible to sell before the booking is confirmed.)
- 3.What makes two searches the same? In Agoda's paper, one itinerary is a hotel plus check-in, check-out, adults, children and rooms.
- 4.Is the supplier limit per supplier, and shared across our data centres?
- 5.Is the booking itself in scope? (Start with search. Room inventory and double booking are a separate design.)
This page is the free part.
The course goes deeper on the Agoda design
₹1,111 in India$35 everywhere elseonce, for the whole course
The System Design course covers the Agoda design across a run of lessons, not one page. These 4 alone are about 109 minutes of step-by-step reading, every one with a quiz.
- Cache-Aside Pattern
Cache-aside is said to degrade gracefully when the cache fails. Measured, unwrapped it answered 0.0 percent of requests, and wrapped it answered 13.0, which is exactly the database's capacity.
- Time To Live (TTL)
How to choose a cache TTL from your own traffic. A sweep of seven TTL values on skewed traffic shows the hit rate ceiling and the cost of staleness.
- Cache Warming
A cold instance in a warm fleet served its users at 8.14 ms while their neighbours got 3.69, and the fleet average moved by 0.68 ms. The largest fix was not a warming job.
- Refresh-Ahead Cache: How It Works, Measured on Redis
A refresh-ahead cache reloads hot entries before their TTL ends, so readers stop waiting. A Redis lab measures the factor, the cost and stale-while-revalidate.
all part of
System Design Masterclass
770 lessons · about 290 hours · 18 free to read
₹1,111in India, by UPI
$35everywhere else, by card or PayPal
It is really nice and good Please join the course
You own this course
Continue with Cache-Aside Patternpay once,
yours for life
Live from the course bench
Before you design Agoda, try the questions it rests on.
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
01Requirements
Requirements
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
Functional requirements
- A traveller searches by destination or hotel, dates and guests, and sees a price for each hotel
- Prices from third-party suppliers are fetched over their APIs and kept in a shared price cache
- On a cache miss, the search returns without that supplier's price and a fetch is started
- Each cached price expires after a TTL chosen for that kind of search
- Spare supplier budget is spent pre-fetching the prices most likely to be booked
- Before a booking is confirmed, the price is checked again with the hotel or supplier
Non-functional requirements
- Never send a supplier more requests per second than it allows; Agoda's paper says a breach could take a supplier offline
- Fast reads: Agoda's Price Cache had a P99 target under 50 ms, and measured about 8 ms on DragonflyDB
- A very high write rate: close to 1.5 million writes a second against about 300,000 reads
- High availability: losing one cache cluster must not leave travellers with no prices
- Prices may be minutes old on a search result, as long as the booking step checks them
- Several data centres share each supplier's limit, and their busy hours differ
02Scale estimates
Back-of-envelope scale estimates
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Writes for every read
~5
Agoda wrote that the Price Cache served about 300,000 reads and close to 1.5 million writes a second. 1,500,000 / 300,000 = 5. Its own load test modelled a 1:6 ratio. Writes win because every supplier answer is stored, including the ones fetched before anyone searched.
Keys looked up per second
~3 million
Agoda's load test assumed an average of 10 keys per MGET, a Redis command that reads many keys in one call. Assume each of the 300,000 reads a second is one such MGET. 300,000 x 10 is about 3 million keys a second. That is our assumption, not a published number.
Memory per shard
~500 GB
The price data needed about 1.5 TB, spread over three shards per cluster in Agoda's DragonflyDB design at that point. 1.5 TB / 3 is about 500 GB per shard. Agoda runs two clusters, A and B. Assume each holds a full copy, so prices use about 3 TB of memory in total.
Searches per second
~23,000 average
Agoda's 2020 paper says it has billions of user searches every day. Assume 2 billion. 2,000,000,000 / 86,400 seconds is about 23,000 searches a second on average, before any peak. That is our assumption.
One supplier's daily budget
8.64 million requests
Agoda's paper writes the daily budget as M = QPS x 86,400 seconds. Assume a supplier allows 100 requests a second. 100 x 86,400 = 8,640,000 requests a day. That is all we can ever ask this supplier, however many people search.
Itineraries kept always fresh
~2.16 million
To keep one itinerary in the cache all day, Agoda's paper fetches it 1,440 / TTL times, with the TTL in minutes. With a 6 hour TTL that is 4 fetches a day. 8,640,000 / 4 is about 2.16 million itineraries for this one supplier. Billions of searches cannot all fit, so the planner must choose.
03Architecture
High-level architecture
Draw the read path first. The traveller's app sends a search to the Price API. In this design the Price API turns the search into cache keys, one per hotel and set of search criteria, and reads them with MGET from the Price Cache. Agoda's Price Cache runs on DragonflyDB, an in-memory key-value store that speaks the Redis protocol. It has two clusters, A and B, for high availability. A hit returns the cached price at once. On a miss, the traveller sees no price from that supplier for now, and a fetch is started. In this design a fetcher service owns every supplier call. It holds a per-supplier, per-data-centre token bucket, a counter that refills at the allowed rate. The bucket is kept very small, because a full bucket can send a burst, and a burst must never go over the supplier's QPS. The supplier's answer goes to the Price Writer, which Agoda added in its DragonflyDB migration. In this design, before a price is written, a TTL service picks how long it lives, as in Agoda's 2020 PriceAggregator paper. The writer then sets the price with that TTL in both clusters. In the background, a pre-fetch planner, which Agoda calls SmartScheduler, spends any spare supplier budget on the itineraries most likely to be booked. Separately, the price calculation needs hotel metadata. In 2020 Agoda kept that in Couchbase clusters in each data centre, refreshed every 20 minutes through a Kafka queue.
In a real interview, sketch this on the whiteboard before diving into any single box.

04One request
What happens when a traveller searches for a hotel, step by step
The cache-first flow and the booking check are from Agoda's 2020 PriceAggregator paper. The Price API, Price Writer and the two clusters are from Agoda's 2026 DragonflyDB post. The fetcher and its token bucket are this design's choices, because Agoda has not published how it throttles each supplier.
- 1
The traveller searches
The app sends the destination or hotel, check-in, check-out, adults, children and rooms to the Price API. In Agoda's paper, the dates, adults, children and rooms are the search criteria.
- 2
Read the cache
In this design the Price API builds one key per hotel and search criteria and reads them with MGET from the Price Cache. Each pod reads from both clusters, A and B, and stops reading from a cluster whose hit ratio falls well behind the other.
- 3
Hit or miss
A hit returns the cached price at once. A miss returns the search without that supplier's price. In this design the Price API also puts the itinerary on a fetch queue, so the next traveller gets a hit.
- 4
Ask the supplier, within its limit
In this design the fetcher takes a token from the bucket for that supplier and data centre. If the bucket is empty, the fetch waits or is dropped. The supplier is never sent more than it allows.
- 5
Write with a TTL
The supplier's price goes to the Price Writer. In this design a TTL service, like SmartTTL in Agoda's paper, picks how long it should live, from the group its check-in date and availability fall into. The writer sets it in both clusters with that TTL, so expiry is automatic.
- 6
Check before booking
If the traveller clicks Book, Agoda confirms with the hotel that the price is still eligible to sell before it confirms the booking. A stale price on the search result is caught here, not charged.
05Components
Core components
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Price API
Takes a search and returns prices, reading the Price Cache by hotel, occupancy, check-in date and check-out date, as Agoda describes. It reads both cache clusters and decides on its own which one is healthy. During the migration it also read two stores at once to compare them.
Price Cache (DragonflyDB, clusters A and B)
The shared in-memory store of supplier prices. Agoda moved it from 72 SQL Server shards to DragonflyDB, which speaks the Redis protocol and can run in Redis Cluster mode. Each cluster has three shards. Two clusters give high availability and let one be patched while the other serves.
Price Writer
Writes prices into the cache with SET and a TTL. Agoda introduced it, with a gRPC gateway in front of the data layer, during the DragonflyDB migration. gRPC is a fast way for services to call each other. In this design it writes every supplier answer to both clusters.
TTL service (SmartTTL)
From Agoda's PriceAggregator paper. It learns how long prices usually stay unchanged, groups searches by check-in date and whether the hotel is sold out, and gives each group the TTL that maximises expected bookings. About 1,000 groups replace billions of searches.
Pre-fetch planner (SmartScheduler)
Also from the paper. Instead of only fetching on a miss, it sends a constant rate of requests to each supplier. It chooses the itineraries with the highest expected bookings per request, and spreads them evenly so each is fetched again just before it expires.
Supplier fetcher (in this design)
One place that talks to suppliers, so the limit is enforced in one place. It holds a token bucket per supplier per data centre, takes work from both the miss queue and the planner, and retries only within a small retry budget. The bucket is kept small so a burst cannot break the limit. Agoda has not published this service; it is our choice.
Hotel metadata cache (Couchbase, 2020)
The data needed to calculate a price. In 2020 Agoda moved it from a small in-process cache with a 50% hit ratio to Couchbase clusters in each data centre. A scheduled producer put property IDs on Kafka every 20 minutes, and builders refilled the whole set, so the cache never started cold.
06Data model
Data model
Pick the right store per table. Justify each choice with the access pattern, not by reflex.
price_cache (DragonflyDB)key = hotel + check-in + check-out + adults + children + roomsvalue = price data per supplierTTL set on writeIn this design: one key per hotel and search criteria, read with MGET and written with SET. Agoda's parity check compared, for each search, the number of suppliers returned and the length of each supplier's price data. With DragonflyDB the TTL removes stale prices, which retired a cleanup job Agoda ran on SQL Server. In Redis Cluster mode one MGET can only read keys in the same hash slot, so the client splits a search's MGET by shard, or the keys share a hash tag.
ttl_groupcheck-in dateprice availability (sold out or not)ttl_minutesupdated_atFrom Agoda's paper: searches with the same check-in and availability have similar price lifetimes, so they share one TTL. About 1,000 rows, small enough for any in-memory map. In this design it is rebuilt daily from fetch history.
supplier_budgetsupplier_iddata_centreqps_allowedqps_used_by_missesqps_used_by_prefetchIn this design: the token bucket settings per supplier and data centre. The sum over data centres must stay under the supplier's limit. Agoda's paper keeps each data centre at a constant rate and fills the gap left by misses with pre-fetches.
prefetch_planitinerary (hotel + search criteria)supplier_idttl_minutesfetches_per_day = 1,440 / TTLexpected_bookings_per_requestnext_send_secondIn this design: the output of the planner. Itineraries are ranked by expected bookings per request, and the top ones that fit the daily budget are spread evenly over each TTL window, as Agoda's paper describes.
07Deep dives
Deep dives
These are the conversations the interviewer is steering you toward. Practice each one until you can talk through it without notes.
Why the cache exists: the supplier's request limit
Agoda's 2020 paper by its own engineers starts here. Many prices come from third-party suppliers, such as wholesalers and retailers. These suppliers do not send price changes to Agoda. To get a price, Agoda must make one HTTP request to the supplier. And each supplier allows only a limited number of queries per second. Agoda's search traffic is far larger than that, so forwarding every search is impossible. The answer is a cache that stores each price for a while. A hit is served from the cache. A miss means the traveller does not see that supplier's price this time, and a fetch is sent so the next traveller gets a hit. Agoda points out a ceiling with this passive design. A hit only happens if the same search came earlier and its price has not expired. If more than 20% of searches are new, the hit rate can never pass 80%, however long the TTL. Breaking that ceiling needs fetching before anyone asks, which comes later.
SmartTTL: how long should a price live?
A TTL does three things at once, in Agoda's words. A longer TTL raises the cache hit rate. It saves supplier requests for other searches. But it lowers price accuracy, because the supplier may have changed the price. Agoda wrote that most travel agencies pick a small TTL of 15 to 30 minutes, and that this is not optimal. Its SmartTTL service works in three steps. First, measure how long prices stay unchanged. If a fetch at 13:00 and another at 13:31 show a new price, that price lasted 31 minutes. Second, group searches. With billions of searches a day, one TTL per search is too many. Agoda found that check-in date and price availability matter most, so searches with the same two values share a group. That leaves about 1,000 groups. Third, for each group, try many TTLs and keep the one that maximises expected bookings: the hit rate times the chance the price is still right. Agoda's example: if 80% of repeat searches come within 120 minutes, a 120 minute TTL gives about an 80% hit rate. In a 14 day test on one supplier, SmartTTL beat a fixed TTL by 2 to 4% on cache hits and about 2% on bookings. The listing below shows the choice for one group.
def hit_rate(gaps, ttl):
# share of repeat searches that come back before the price expires
return sum(g <= ttl for g in gaps) / len(gaps)
def accuracy(lifetimes, ttl):
# share of the cached time the price was still right
return sum(min(1, life / ttl) for life in lifetimes) / len(lifetimes)
def best_ttl(gaps, lifetimes, candidates=range(15, 721, 15)):
# minutes; keep the TTL with the most expected bookings
return max(candidates, key=lambda t: hit_rate(gaps, t) * accuracy(lifetimes, t))From waiting for misses to spending the budget on purpose
Fetching only on a miss wastes budget in two ways, Agoda's paper explains. Agoda has several data centres, and each sends its own requests to a supplier. In Agoda's example, one data centre peaks at about 50% of the supplier's limit around 18:00 and another around 04:00. Split the limit evenly and you waste it; give each more than half and their peaks could add up past the limit. Agoda warns that breaching it could take a supplier offline. Within one data centre, quiet hours waste budget too: in one example, under 40% was used around 08:00. Agoda's fix is the aggressive model. Each data centre sends a constant rate to each supplier. Whatever misses do not use, pre-fetches fill. A first approach pre-fetched from an LRU list of recent searches, those closest to expiry first. LRU, least recently used, keeps recent items and drops old ones. But a popular hotel with uncompetitive prices is a waste of budget. So SmartScheduler ranks itineraries by expected bookings per request. An itinerary with TTL T needs 1,440 / T fetches a day to stay fresh. The daily budget is the rate times 86,400 seconds. The planner keeps the most valuable itineraries that fit and spreads them evenly. In Agoda's example, 43,200 itineraries with a 6 hour TTL need 2 requests a second. Agoda reported that SmartScheduler beat its baselines by 10% to 30%.
The cache store: from 72 SQL Server shards to DragonflyDB
For years Agoda's Price Cache ran on Microsoft SQL Server, split into 72 shards with routing in the application. Agoda wrote that scaling was rigid. It could not add one server; it had to step from 6 to 12 or 12 to 18 servers, with the database team remapping shards by hand. After doubling hardware in early 2024, it was near the limits again within a year. At that point the cache served about 300,000 reads and close to 1.5 million writes a second, needed P99 under 50 ms, and held about 1.5 TB. Agoda chose DragonflyDB for four reasons. It is multi-threaded, with each thread owning a slice of the data. It speaks the Redis protocol, which fit a workload of mostly MGET and SET, and it scales in Redis Cluster mode by adding nodes. It has built-in expiry, so a separate cleanup job could go. And other Agoda teams already ran it. Agoda started with a single 1 TB instance for hot data only: itineraries with a length of stay of one to four days. That data grew to about 900 GB, hit its 90% memory-safety threshold and began evicting prices. So Agoda moved to three shards per cluster and stored the full 1.5 TB. Writes ran at about 1.6 million a second at about 10 ms P99. Reads ran at about 300,000 a second at about 8 ms P99.
Two clusters and failover by hit ratio
Agoda's DragonflyDB setup has two clusters, A and B. That lets one cluster be patched while the other serves. At first this was manual. Stop reads to B. Stop B, patch it, start it. Writes resume and refill it, but reads stay off, because an empty cache would give travellers no prices. In Agoda's example, B took about three hours to catch up with A's hit ratio, almost half a working day of watching. And an unplanned outage had no automatic failover at all. So Agoda taught each application pod to decide for itself. Every five seconds, a pod compares the hit ratios of A and B over the last five minutes. It tests whether the gap is too large to be normal noise. If one cluster is at least 10 percentage points behind and the gap is statistically real, the pod stops reading from it. It reads from it again when the gap is back within 3 points. Pods do not share their view, and there is no leader. In a test, about 40 pods in one data centre all failed over within about two minutes, with no one touching anything. Agoda is still tuning the thresholds. It is also looking at restoring an empty cluster from a snapshot of the healthy one instead of warming it slowly.
The second cache: hotel metadata for price calculation
A price also needs data about the hotel to calculate it. Agoda wrote about this in 2020. Its Price Delivery System served hotel room prices to web, mobile and affiliate APIs, over a million requests a second in five data centres. P99 response time was 460 ms, and 110 ms of that was fetching metadata. Each instance kept its own in-memory cache, with LRU eviction, and only about 50% of lookups hit. Affiliates sent very varied searches, which evicted entries fast. Cold starts sent waves of misses to the database, a cache stampede. Agoda moved to a distributed cache: Couchbase clusters in each data centre, because cross-data-centre reads are slow. The full metadata was only about 5 GB, so Agoda kept all of it hot. A scheduled producer puts every property ID on a Kafka queue every 20 minutes. Builder workers read the queue, compute the metadata and write it to Couchbase. The queue also limits how hard they hit the database. Agoda chose a full refresh over tracking changes, because change tracking across many tables would have been a large project. Metadata reads fell to about 15 ms at P99, and the whole response improved by about 20%. Agoda named the limit: as hotels grow, a full sync will run past the freshness requirement.
Common mistakes candidates make
Mistake one: calling the supplier on every search. Agoda's paper says the suppliers' request limits are never enough to cover all searches. Say the cache is the main path, not an optimisation. Mistake two: one TTL for everything, usually 15 to 30 minutes. Explain the trade-off between hit rate and price accuracy, and group searches as Agoda does by check-in date and availability. Mistake three: fetching only on a miss. Show the hit-rate ceiling for new searches, and spend spare budget on pre-fetches ranked by expected bookings. Mistake four: giving every data centre its own copy of the full supplier limit. Their peaks can add up past it. Mistake five: treating a cached price as final. The price must be checked with the hotel before the booking is confirmed. Mistake six: sending reads to a freshly restarted cluster. An empty cache returns no prices, so warm it first. Mistake seven: inventing Agoda's numbers. Agoda has not published its supplier limits, its TTL values or its hit rates. Say that, and state your own assumption.
08Trade-offs
Trade-offs to discuss
Every senior interviewer expects you to surface at least 3 of these. Pick the decisions, state the alternatives, and justify your choice.
Long TTL vs short TTL
A longer TTL means more cache hits and fewer supplier requests. A shorter TTL means fewer stale prices, and fewer failed bookings when the price is checked. Agoda tunes the TTL per group of searches to maximise expected bookings, instead of one value for all.
Fetch on a miss vs pre-fetch on purpose
Fetching only on a miss is simple and never wastes a request on a search nobody made. But it cannot hit on a new search, and it leaves quiet-hour budget unused. Pre-fetching at a constant rate uses the whole budget and can raise hits. The cost is a planner to build, and some requests spent on searches that never come.
Show no price on a miss vs make the traveller wait
Waiting for the supplier would make the slowest supplier set the speed of the whole result. In Agoda's paper, a miss means the traveller does not see that supplier's price this time. The cost is a missing price, and possibly a lost booking, which is why the hit rate matters so much.
Sharded SQL database vs in-memory store with built-in expiry
SQL Server is durable storage, but for Agoda scaling meant manual reshards in fixed steps and a custom cleanup job. DragonflyDB keeps everything in memory, scales by adding nodes and expires keys itself. The cost is that an empty cluster must be warmed before it can serve. That is acceptable because the other cluster keeps serving while ongoing writes refill the empty one.
Per-instance cache vs shared distributed cache
A cache inside each instance is the fastest to read but small, and starts empty after every deploy. In 2020 Agoda's per-instance metadata cache hit only about 50%. A shared Couchbase cluster per data centre is a network hop away but holds the whole set. Agoda kept it hot with a full refresh every 20 minutes.
A leader decides failover vs every pod decides alone
A leader gives one consistent decision, but it is one more thing that can fail. Agoda chose shared-nothing: each pod tests the hit ratios it sees. The cost is that pods may decide at slightly different moments; in Agoda's test about 40 pods converged within about two minutes.
Free PDF · 18 pages
Get the free System Design Interview Cheat Sheet
The interview in seven stages, the numbers worth knowing by heart, and twelve classic systems on one page each, every line linked to the lesson it comes from.
09Follow-ups
Follow-up questions to expect
After the main design, the interviewer usually picks one part and asks more. Here is what to say.
A traveller clicks Book on a cached price that has since changed. What happens?
In Agoda's booking flow, the price is confirmed with the hotel as eligible to sell before the booking is confirmed. In this design, if it changed, show the new price and ask again. Holding the room and stopping double booking is a separate problem. Our hotel reservation guide at /interview/design-hotel-reservation covers it.
One of the two cache clusters fails during the evening peak. Walk me through it.
Its hit ratio falls behind the other cluster's. Every five seconds each Price API pod compares the two over the last five minutes. Once the gap is at least 10 points and statistically real, the pod stops reading from it. Agoda measured about two minutes for 40 pods. Reads return when the gap is within 3 points again.
A supplier slows down and the fetcher starts retrying. What can go wrong?
A retry storm. In Agoda's example, ten services that each retry once can turn 100 requests a second into 51,200 at the bottom. Agoda caps retries with retry budgets in Envoy, its service mesh proxy. A 5% budget held that example to 156 a second. In this design retries also spend the supplier's token bucket.
How would you replace the cache store without travellers noticing?
Do what Agoda did. Write to both stores. Read from both, serve from the old one, and compare in the background. Agoda compared supplier counts and price data length and saw over 99.9% agreement. Then move readers over with an A/B experiment while watching bookings, and retire the old store.
You add a new data centre. How do you split each supplier's limit?
The total across data centres must stay under the supplier's limit. Agoda's paper notes that each data centre peaks at different hours, so an even split wastes budget. Give each data centre a constant rate and fill unused budget with pre-fetches. In this design, a central budget table sets each rate and can be changed without a deploy.
10In production
How Agoda actually does it
Every fact about Agoda on this page comes from Agoda's own writing. The estimates and anything marked 'in this design' or 'assume' are ours. The supplier request limits, the cache-first flow, SmartTTL, the pre-fetch planner and the booking check are from PriceAggregator, a 2020 paper by five Agoda engineers. Its experiments ran in 2019. The Price Cache numbers, the 72-shard SQL Server setup, the DragonflyDB migration and the hit-ratio failover are from Agoda Engineering's August 2026 post. The Price Delivery System, the metadata cache in Couchbase and the 20 minute refresh are from Agoda Engineering's 2020 post. Retry budgets in Envoy are from the 2024 post on retry storms. The property count is from Agoda's April 2026 press release. Agoda has not published its supplier limits, its TTL values, its hit rates, the number of suppliers, or how it throttles supplier calls today.
Sources
- Agoda Engineering: How Agoda scaled its Price Cache with DragonflyDB (2026)
- PriceAggregator: an intelligent system for hotel price fetching, Agoda (arXiv, 2020)
- Agoda Engineering: Improving performance using distributed cache with Couchbase (2020)
- Agoda Engineering: How Agoda solved retry storms to boost system reliability (2024)
- Agoda: Agoda opens new office at One Bangkok (press release, 2026)
Lessons to study before this interview
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
Cache-Aside Pattern
foundation / caching strategies
Time To Live (TTL)
foundation / caching strategies
Cache Warming
foundation / caching strategies
Refresh-Ahead Cache
foundation / caching strategies
Cache Stampede Prevention
foundation / caching strategies
Cache Eviction Policies
foundation / caching strategies
Rate Limiting
intermediate / api design protocols
Token Bucket Algorithm
intermediate / api design protocols
In-Memory Databases
intermediate / database types storage
Active-Active Failover
advanced / reliability resilience
Capstone: Design a Rate Limiter
capstone / capstone
System design interviews at companies in the US, UK, Canada and Singapore
41 walkthroughs of real systems at well-known companies, each built from that company's own engineering blog, talks or filings, with the numbers cited.
Banking, payments and trading
Commerce and delivery
- Shopify system design (Canada)
- DoorDash system design
- Amazon system design
- Airbnb system design
- Agoda system design (this page) (Singapore)
- Uber Eats system design
Rides and maps
- Grab system design (Singapore)
- Uber system design
Feeds, social and messaging
Streaming and media
AI labs and big tech
Developer and collaboration tools
11FAQ
Frequently asked questions
Go deeper
This guide is built on these 6 lessons. Each one teaches one piece of the Agoda design above, step by step.
- Cache-Aside PatternSystem Design · caching strategies · 25 min
- Time To Live (TTL)System Design · caching strategies · 24 minFree
- Cache WarmingSystem Design · caching strategies · 25 min
- Refresh-Ahead Cache: How It Works, Measured on RedisSystem Design · caching strategies · 35 min
- Cache Stampede PreventionSystem Design · caching strategies · 25 min
- Cache Eviction PoliciesSystem Design · caching strategies · 24 minFree
Practice with 770 system design lessons
Lifetime access for ₹1,111 in India or $35 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Get all 200 questions in the System Design and Distributed Systems pack
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Pay by UPI, cards or netbanking through Razorpay. Pay by card or PayPal, in US dollars. Download at once from My packs.
NEWSystem Design Hands-On
Included in the System Design course: real systems, built live
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.


