How Airbnb Works
On a booking site, you pick a city and dates, see the free rooms, and pay to book one. That is hard, because many people look at the same rooms at once, and a room for one night can be sold only once. The article behind this page designs a hotel booking system of the kind that Booking.com and Airbnb run, not the real Airbnb.Source 1সোর্স 1 This page covers its free part.
8 min read8 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 1 source1টি সোর্স · updated Oct 2026আপডেট: Oct 2026
Two clicks, one last roomদুই ক্লিক, শেষ একটা রুম
Two users book the last room at once. See a double sale, then switch on one transaction and see the second click fail.দুজন ব্যবহারকারী একসাথে শেষ রুমটা বুক করেন। প্রথমে দ্বিগুণ বিক্রি দেখুন, তারপর একটা ট্রানজ্যাকশন চালু করুন আর দেখুন দ্বিতীয় ক্লিক ব্যর্থ হয়।
You’ll learnআপনি শিখবেন
- Why two clicks can sell one room twiceদুই ক্লিকে কেন একটা রুম দুবার বিক্রি হয়
- What one ACID transaction doesএকটা ACID ট্রানজ্যাকশন কী করে
- Why the second click gets sold outদ্বিতীয় ক্লিক কেন বিক্রি শেষ পায়
- Why overbooking is a business choiceওভারবুকিং কেন ব্যবসার সিদ্ধান্ত
The problem in plain words
The article starts with the worst case. Two users click "Book" on the last free room in the same second. Both requests check the database, and both see a free room. The system then charges two cards for one room.Source 1সোর্স 1 The article says this is what happens by default if the design is wrong.Source 1সোর্স 1
So the system must do these things:Source 1সোর্স 1
- Let admins add hotels and room types, and set prices and the number of free rooms.
- Let users search by place, dates, number of guests, price, and features.
- Let users book, view, and cancel, with no double bookings.
- Take payments through a payment gateway and handle failures.
- Send confirmations for bookings, cancellations, and payments.
The quality goals are strict. Two users must never get the same room for the same dates.Source 1সোর্স 1 Search must answer in under 500 ms, and a booking must be confirmed in 2 to 3 seconds.Source 1সোর্স 1 The site must be up 99.9% of the time or more.Source 1সোর্স 1
The article uses Booking.com numbers to size the system. Booking Holdings reported more than 1.1 billion room nights in 2024.Source 1সোর্স 1 A room night is one room for one night. With 2 nights per booking, that is about 1.5 million bookings a day, or about 17 a second.Source 1সোর্স 1 But people look much more than they book. The article estimates about 1,000 reads a second against those 17 writes.Source 1সোর্স 1
সহজ English
The article starts with the worst case. Two users click "Book" on the last free room in the same second. Both requests check the database, and both see a free room. Then the system charges two cards for one room.Source 1সোর্স 1 The article says that this happens by default if the design is wrong.Source 1সোর্স 1
The system must do these jobs:Source 1সোর্স 1
- Admins add hotels and room types. They set the prices and the number of free rooms.
- Users search by place, dates, number of guests, price, and features.
- Users book, view, and cancel, with no double bookings.
- The system takes payments through a payment gateway and handles failures.
- The system sends confirmations for bookings, cancellations, and payments.
Two users must never get the same room for the same dates.Source 1সোর্স 1 Search must answer in under 500 ms. A booking must be confirmed in 2 to 3 seconds.Source 1সোর্স 1 The site must be up 99.9% of the time or more.Source 1সোর্স 1
With Booking.com numbers, the article estimates about 17 bookings (writes) a second, but about 1,000 reads a second.Source 1সোর্স 1
বাংলা ব্যাখ্যা
Article-টি সবচেয়ে খারাপ অবস্থা দিয়ে শুরু করে। দুজন user একই সেকেন্ডে শেষ খালি room-এ "Book" click করেন। দুটি request-ই database check করে, এবং দুটিই দেখে যে room খালি। তখন system একটি room-এর জন্য দুটি card charge করে।Source 1সোর্স 1 Article বলে, design ভুল হলে default হিসেবে এটাই ঘটে।Source 1সোর্স 1
তাই system-কে এই কাজগুলো করতে হবে:Source 1সোর্স 1
- Admin hotel ও room type যোগ করবেন, এবং price ও খালি room-এর সংখ্যা ঠিক করবেন।
- User জায়গা, তারিখ, অতিথির সংখ্যা, price ও feature দিয়ে search করবেন।
- User double booking ছাড়াই book, view ও cancel করবেন।
- System একটি payment gateway দিয়ে payment নেবে এবং failure সামলাবে।
- System booking, cancellation ও payment-এর confirmation পাঠাবে।
Quality-র লক্ষ্যগুলো কঠোর। একই তারিখে একই room কখনো দুজন user পাবেন না।Source 1সোর্স 1 Search-কে 500 ms-এর কম সময়ে উত্তর দিতে হবে, আর একটি booking 2 থেকে 3 সেকেন্ডে confirm হতে হবে।Source 1সোর্স 1 Site-কে 99.9% বা তার বেশি সময় চালু থাকতে হবে।Source 1সোর্স 1
System-এর আকার মাপতে article-টি Booking.com-এর সংখ্যা ব্যবহার করে। Booking Holdings 2024 সালে 1.1 billion-এর বেশি room night জানিয়েছে; একটি room night মানে এক রাতের জন্য একটি room।Source 1সোর্স 1 প্রতি booking-এ 2 রাত ধরলে, দিনে প্রায় 1.5 million booking হয়, অর্থাৎ সেকেন্ডে প্রায় 17টি।Source 1সোর্স 1 কিন্তু মানুষ book করার চেয়ে অনেক বেশি দেখে। Article-এর হিসাবে ওই 17টি write-এর বিপরীতে সেকেন্ডে প্রায় 1,000টি read হয়।Source 1সোর্স 1
The big picture
[Web / mobile app] --photos, scripts--> [CDN]
|
v
[API gateway: login, rate limit, routing]
|
+--> [Search service] ------> [Elasticsearch]
+--> [Hotel service] -------> [Redis cache] --> [PostgreSQL]
+--> [Rate service] (prices by date)
+--> [Reservation service] -> [PostgreSQL: bookings + free rooms, same database]
+--> [Payment service] -----> [Payment gateway]
+--> [Notification service] -> email, pushEvery request enters through one front door, the API gateway. It checks who you are, limits how fast one user can call, and sends the request to the right service.Source 1সোর্স 1 Each service owns one job, such as search, prices, or bookings.Source 1সোর্স 1 PostgreSQL holds the main data, Redis holds hot data, and Elasticsearch powers search.Source 1সোর্স 1 A CDN serves static files such as photos.Source 1সোর্স 1
সহজ English
In the diagram, every request enters through one front door, the API gateway. The gateway checks who you are. It limits how fast one user can call. Then it sends the request to the right service.Source 1সোর্স 1
Each service owns one job, such as search, prices, or bookings.Source 1সোর্স 1 The diagram shows six services: Search, Hotel, Rate, Reservation, Payment, and Notification.
PostgreSQL holds the main data. Redis holds hot data. Elasticsearch powers search.Source 1সোর্স 1 The Reservation service keeps the bookings and the free rooms in the same PostgreSQL database. The Payment service uses a payment gateway. The Notification service sends email and push messages.
A CDN serves static files, such as photos.Source 1সোর্স 1
বাংলা ব্যাখ্যা
Diagram-এ দেখা যায়, প্রতিটি request একটি সামনের দরজা দিয়ে ঢোকে, সেটি হলো API gateway। এটি যাচাই করে আপনি কে, একজন user কত দ্রুত call করতে পারবেন তা সীমিত করে, এবং request-টি সঠিক service-এ পাঠায়।Source 1সোর্স 1 প্রতিটি service একটি কাজের দায়িত্বে থাকে, যেমন search, price বা booking।Source 1সোর্স 1 Diagram-এ ছয়টি service আছে: Search, Hotel, Rate, Reservation, Payment এবং Notification।
PostgreSQL মূল data রাখে, Redis hot data রাখে, আর Elasticsearch search চালায়।Source 1সোর্স 1 Reservation service booking এবং খালি room-এর হিসাব একই PostgreSQL database-এ রাখে। Payment service একটি payment gateway ব্যবহার করে, আর Notification service email ও push পাঠায়।
Photo-র মতো static file একটি CDN থেকে আসে।Source 1সোর্স 1
The race for the last room
Think of the last concert ticket on a counter. Two people reach for it at the same moment. If the clerk does not watch, both pay, and one of them goes home angry.
A database has the same trap. Each request does two steps: first "is the room free?", then "book it". If two requests run the first step before either runs the second, both see a free room. This is a race condition: the result depends on the exact timing of the two requests.
The article requires strong consistency for the room stock: a room can never go to two users for the same nights.Source 1সোর্স 1 It names this the one goal that cannot be traded away.Source 1সোর্স 1 Strong consistency means every reader sees the latest booking at once. The tool it relies on is the ACID transaction of PostgreSQL.Source 1সোর্স 1
A transaction is a group of database steps that runs as one unit. ACID names four promises. Atomic: all steps happen, or none. Consistent: the rules of the data stay true. Isolated: transactions that run at the same time do not see each other's half-done work. Durable: a finished booking survives a crash. The article's exact locking method is in the paid part, so this page does not describe it.
The article also asks if the site may sell more rooms than it has. It notes that hotels often allow 5 to 10% overbooking.Source 1সোর্স 1 The article lists this as a question to settle before the design starts.Source 1সোর্স 1
সহজ English
A database can have a trap. Each request does two steps. First, it asks "Is the room free?" Then it books the room. If both requests do the first step before either does the second step, both see a free room. This is a race condition: the result depends on the exact timing of the two requests.
The article requires strong consistency for the room stock: a room can never go to two users for the same nights.Source 1সোর্স 1 It says that this is the one goal that cannot be traded away.Source 1সোর্স 1 Strong consistency means that every reader sees the latest booking at once. The article relies on the ACID transaction of PostgreSQL.Source 1সোর্স 1 A transaction is a group of database steps that runs as one unit: all steps happen, or none.
The article also asks if the site can sell more rooms than it has. It notes that hotels often allow 5 to 10% overbooking.Source 1সোর্স 1 It lists this as a question to settle before the design starts.Source 1সোর্স 1
বাংলা ব্যাখ্যা
কাউন্টারে থাকা শেষ concert ticket-টির কথা ভাবুন। দুজন মানুষ একই মুহূর্তে সেটির দিকে হাত বাড়ান। Clerk খেয়াল না করলে দুজনই টাকা দেন, আর একজন রাগ করে বাড়ি ফেরেন।
Database-এও একই ফাঁদ আছে। প্রতিটি request দুটি ধাপে কাজ করে: প্রথমে "room কি খালি?", তারপর "book করো"। কোনোটি দ্বিতীয় ধাপ চালানোর আগেই দুটি request প্রথম ধাপ চালালে, দুটিই খালি room দেখে। একে race condition বলে: ফলাফল নির্ভর করে দুটি request-এর সঠিক সময়ের ওপর।
Article-টি room stock-এর জন্য strong consistency চায়: একই রাতের জন্য একটি room কখনো দুজন user পাবেন না।Source 1সোর্স 1 Article বলে, এটিই একমাত্র লক্ষ্য যাতে কোনো ছাড় দেওয়া যায় না।Source 1সোর্স 1 Strong consistency মানে প্রত্যেক reader সঙ্গে সঙ্গে সর্বশেষ booking দেখেন। এর জন্য article-টি PostgreSQL-এর ACID transaction-এর ওপর ভরসা করে।Source 1সোর্স 1
Transaction হলো database-এর কয়েকটি ধাপের একটি দল, যা একটি একক হিসেবে চলে। ACID চারটি প্রতিশ্রুতির নাম: Atomic (সব ধাপ হয়, নয়তো কোনোটিই না), Consistent (data-র নিয়মগুলো ঠিক থাকে), Isolated (একসাথে চলা transaction-গুলো একে অপরের অর্ধেক কাজ দেখে না), আর Durable (শেষ হওয়া booking crash-এর পরও টিকে থাকে)। Article-এর সঠিক locking পদ্ধতি paid অংশে আছে, তাই এই পাতা সেটি বর্ণনা করে না।
Article আরও প্রশ্ন করে, site কি তার room-এর চেয়ে বেশি বিক্রি করতে পারবে? এটি উল্লেখ করে যে hotel-গুলো প্রায়ই 5 থেকে 10% overbooking অনুমতি দেয়।Source 1সোর্স 1 Article এটিকে design শুরুর আগে মীমাংসা করার একটি প্রশ্ন হিসেবে তালিকায় রাখে।Source 1সোর্স 1
One database for bookings and rooms
Think of a small shop where the till and the stock book sit on the same desk. When you sell an item, you write the sale and cross the item off the stock in one move. Nobody can sell it again in between.
The article splits the code into services, but it keeps bookings and free-room counts in the same database.Source 1সোর্স 1 Then one local ACID transaction can create the booking and lower the count together.Source 1সোর্স 1
The other option is two databases, one for bookings and one for room stock. Then the system needs a way to keep them in step.Source 1সোর্স 1
| Method | How it works | Cost |
|---|---|---|
| Two-phase commit (2PC) | A coordinator asks both databases to get ready, then tells both to commit, or both to cancel. | Slower, holds locks, and if the coordinator fails, the system can stall.Source 1সোর্স 1 |
| Saga | Each step runs alone. If a later step fails, "undo" steps reverse the earlier ones. | No long locks, but data is only eventually consistent, and failures are hard to handle.Source 1সোর্স 1 |
| One database (the article's choice) | One transaction covers both tables. | Simple and safe at this size.Source 1সোর্স 1 |
Eventually consistent means the copies agree only after a delay. For a booking, that delay can mean an angry guest.Source 1সোর্স 1 At about 17 writes a second, the article says the extra complexity is not worth it.Source 1সোর্স 1
সহজ English
The article splits the code into services, but it keeps the bookings and the free-room counts in the same database.Source 1সোর্স 1 Then one local ACID transaction can create the booking and lower the count together.Source 1সোর্স 1
The other option is two databases, one for bookings and one for room stock. Then the system needs a way to keep them in step:Source 1সোর্স 1
- Two-phase commit (2PC). A coordinator tells both databases to get ready, and then to commit, or to cancel. This is slower and holds locks. If the coordinator fails, the system can stall.Source 1সোর্স 1
- Saga. Each step runs alone. If a later step fails, "undo" steps reverse the earlier steps. There are no long locks, but the data is only eventually consistent, and failures are hard to handle.Source 1সোর্স 1
Eventually consistent means that the copies agree only after a delay.Source 1সোর্স 1 At about 17 writes a second, the article says that the extra complexity is not worth it.Source 1সোর্স 1
বাংলা ব্যাখ্যা
একটি ছোট দোকানের কথা ভাবুন, যেখানে টাকার বাক্স আর stock-এর খাতা একই টেবিলে থাকে। কিছু বিক্রি করলে আপনি একই সাথে বিক্রিটি লেখেন এবং stock থেকে জিনিসটি কেটে দেন। মাঝখানে কেউ সেটি আবার বিক্রি করতে পারে না।
Article-টি code-কে কয়েকটি service-এ ভাগ করে, কিন্তু booking এবং খালি room-এর সংখ্যা একই database-এ রাখে।Source 1সোর্স 1 ফলে একটি local ACID transaction একসাথে booking তৈরি করতে এবং সংখ্যাটি কমাতে পারে।Source 1সোর্স 1
অন্য উপায় হলো দুটি database: একটি booking-এর জন্য, আরেকটি room stock-এর জন্য। তখন দুটিকে মিলিয়ে রাখার একটি উপায় system-এর দরকার হয়:Source 1সোর্স 1
- Two-phase commit (2PC). একটি coordinator দুটি database-কে প্রস্তুত হতে বলে, তারপর দুটিকেই commit করতে, অথবা দুটিকেই cancel করতে বলে। এটি ধীর, lock ধরে রাখে, আর coordinator fail করলে system আটকে যেতে পারে।Source 1সোর্স 1
- Saga. প্রতিটি ধাপ আলাদাভাবে চলে। পরের কোনো ধাপ fail করলে "undo" ধাপগুলো আগের ধাপগুলো উল্টে দেয়। দীর্ঘ lock নেই, কিন্তু data শুধু eventually consistent, আর failure সামলানো কঠিন।Source 1সোর্স 1
- একটি database (article-এর পছন্দ). একটি transaction দুটি table-ই সামলায়। এই আকারে এটি সহজ ও নিরাপদ।Source 1সোর্স 1
Eventually consistent মানে copy-গুলো কিছু সময় পরে একমত হয়। Booking-এর ক্ষেত্রে এই দেরির মানে হতে পারে একজন রাগান্বিত অতিথি।Source 1সোর্স 1 সেকেন্ডে প্রায় 17টি write-এ article বলে, বাড়তি জটিলতার কোনো মূল্য নেই।Source 1সোর্স 1
Pressing "Book" twice
Think of a parcel with a tracking number. If the courier sees the same number two times, he knows it is one parcel, not two.
Users can click "Book" more than one time. So the request that creates a booking carries an idempotency key.Source 1সোর্স 1 Idempotent means that doing an action two times has the same effect as doing it one time. In the article, the app creates a booking ID before it sends the request. If the same ID arrives again, the server does not book a second time.Source 1সোর্স 1
সহজ English
Think of a parcel with a tracking number. If the courier sees the same number two times, he knows that it is one parcel, not two.
Users can click "Book" more than one time. So the request that creates a booking carries an idempotency key.Source 1সোর্স 1 Idempotent means that when you do an action two times, the effect is the same as when you do it one time. In the article, the app creates a booking ID before it sends the request. If the same ID comes again, the server does not book a second time.Source 1সোর্স 1
বাংলা ব্যাখ্যা
একটি tracking number-সহ parcel-এর কথা ভাবুন। Courier একই number দুবার দেখলে বোঝেন, এটি একটিই parcel, দুটি নয়।
User-রা "Book"-এ একাধিকবার click করতে পারেন। তাই যে request একটি booking তৈরি করে, সেটি একটি idempotency key বহন করে।Source 1সোর্স 1 Idempotent মানে একটি কাজ দুবার করলেও একবার করার মতোই ফল হয়। Article-এ app request পাঠানোর আগেই একটি booking ID তৈরি করে। একই ID আবার এলে server দ্বিতীয়বার book করে না।Source 1সোর্স 1
Many lookers, few bookers
Think of a museum. Thousands of people walk through and look. Only a few go to the gift shop till. You build wide halls for the lookers and one careful till for the buyers.
The numbers show the same shape. The article uses Similarweb data: about 516.5 million visits a month to booking.com.Source 1সোর্স 1 That is about 200 visits a second. At about 5 backend reads per visit, that is about 1,000 reads a second.Source 1সোর্স 1 The article calls the system strongly read-heavy. It says the design should make reads fast and keep writes correct.Source 1সোর্স 1
So each service scales on its own.Source 1সোর্স 1 Hotel data rarely changes, so it can be cached heavily.Source 1সোর্স 1 A cache is fast memory that keeps copies of data that people read often. The article's example: the Hotel Service might need 10 copies for search traffic, but the Reservation Service only 3.Source 1সোর্স 1
The data is large. The article estimates about 85,000 hotels and 4.3 million rooms.Source 1সোর্স 1 A table of free rooms by room type and date, 2 years ahead, has about 620 million rows, or about 62 GB.Source 1সোর্স 1 With indexes and the other tables, the total is 500 GB or more.Source 1সোর্স 1 An index is a lookup list that makes searches fast. At this size, the article says the system needs a plan for sharding and indexing.Source 1সোর্স 1 Sharding means splitting one big table over many database servers.
সহজ English
The article uses Similarweb data: about 516.5 million visits a month to booking.com.Source 1সোর্স 1 That is about 200 visits a second. At about 5 backend reads per visit, that is about 1,000 reads a second.Source 1সোর্স 1 The article says that the system is strongly read-heavy. The design should make reads fast and keep writes correct.Source 1সোর্স 1
So each service scales on its own.Source 1সোর্স 1 Hotel data rarely changes, so it can be cached heavily.Source 1সোর্স 1 A cache is fast memory that keeps copies of data that people read often. For example, the Hotel Service might need 10 copies for search traffic, but the Reservation Service only 3.Source 1সোর্স 1
The data is large: about 85,000 hotels and 4.3 million rooms.Source 1সোর্স 1 The table of free rooms by room type and date, 2 years ahead, has about 620 million rows, or about 62 GB.Source 1সোর্স 1 With indexes and the other tables, the total is 500 GB or more.Source 1সোর্স 1 So the system needs a plan for sharding and indexing.Source 1সোর্স 1 Sharding means that you split one big table over many database servers.
বাংলা ব্যাখ্যা
একটি museum-এর কথা ভাবুন। হাজার হাজার মানুষ ঘুরে ঘুরে দেখেন, কিন্তু খুব কম মানুষ gift shop-এ কেনাকাটা করেন। তাই দর্শকদের জন্য চওড়া hall বানানো হয়, আর ক্রেতাদের জন্য একটি সাবধানী কাউন্টার।
সংখ্যাগুলোও একই চেহারা দেখায়। Article-টি Similarweb-এর data ব্যবহার করে: booking.com-এ মাসে প্রায় 516.5 million visit।Source 1সোর্স 1 এটি সেকেন্ডে প্রায় 200 visit। প্রতি visit-এ প্রায় 5টি backend read ধরলে, সেকেন্ডে প্রায় 1,000টি read।Source 1সোর্স 1 Article system-টিকে strongly read-heavy বলে। এর মতে, design-এর উচিত read দ্রুত করা এবং write সঠিক রাখা।Source 1সোর্স 1
তাই প্রতিটি service আলাদাভাবে scale করে।Source 1সোর্স 1 Hotel data খুব কম বদলায়, তাই এটি বেশি করে cache করা যায়।Source 1সোর্স 1 Cache হলো দ্রুত memory, যা প্রায়ই পড়া data-র copy রাখে। Article-এর উদাহরণ: search traffic-এর জন্য Hotel Service-এর হয়তো 10টি copy লাগবে, কিন্তু Reservation Service-এর শুধু 3টি।Source 1সোর্স 1
Data-র পরিমাণ বড়: প্রায় 85,000 hotel এবং 4.3 million room।Source 1সোর্স 1 Room type ও তারিখ অনুযায়ী, 2 বছর আগাম, খালি room-এর table-এ প্রায় 620 million row থাকে, অর্থাৎ প্রায় 62 GB।Source 1সোর্স 1 Index ও অন্য table-গুলো মিলিয়ে মোট 500 GB বা তার বেশি।Source 1সোর্স 1 Index হলো একটি খোঁজার তালিকা, যা search দ্রুত করে। এই আকারে system-এর sharding ও indexing-এর একটি পরিকল্পনা দরকার।Source 1সোর্স 1 Sharding মানে একটি বড় table-কে অনেকগুলো database server-এ ভাগ করে রাখা।
Key words
| Word | Plain meaning |
|---|---|
| API gateway | The single front door that checks and routes every request |
| Race condition | A bug where the result depends on the exact timing of two actions |
| Transaction | A group of database steps that all happen, or none happen |
| ACID | Four promises of a safe transaction: atomic, consistent, isolated, durable |
| Strong consistency | Every reader sees the newest data at once |
| Eventual consistency | Copies of the data agree only after a delay |
| Idempotency key | An ID that lets the server spot a repeated request |
| Cache | Fast memory that keeps copies of data that is read often |
| Shard | One part of a big table, stored on its own database server |
| CDN | A network of servers near users that keeps copies of static files |
What a tester can learn
Tutorial advice
These test ideas are this tutorial's own advice, not claims from the sources.
- Send two booking requests for the last room at the same moment, from two users. Exactly one must succeed.
- Click "Book" many times fast, and resend the same request with the same idempotency key. Check for one booking and one charge.
- Make the payment fail, time out, or answer late. Check that the room is not lost and not sold twice.
- Test the date edges: check-in equals check-out, a stay across a month or year end, and time zones.
- Cancel a booking and check that the room becomes free again in search.
- Load-test search apart from booking. Check the 500 ms search goal while bookings still run.
সহজ English
These test ideas are this tutorial's own advice, not claims from the sources.
- Two users send a booking request for the last room at the same moment. Exactly one request must succeed.
- Click "Book" many times fast. Send the same request again with the same idempotency key. Check that there is one booking and one charge.
- Make the payment fail, time out, or answer late. Check that the room is not lost and not sold twice.
- Test the date edges: check-in equals check-out, a stay across a month end or a year end, and time zones.
- Cancel a booking. Check that the room becomes free again in search.
- Load-test search apart from booking. Check the 500 ms search goal while bookings still run.
বাংলা ব্যাখ্যা
এগুলো এই tutorial-এর নিজস্ব test-এর ধারণা, source-এর দাবি নয়।
- দুজন user থেকে একই মুহূর্তে শেষ room-এর জন্য দুটি booking request পাঠান। ঠিক একটি request-ই সফল হতে হবে।
- দ্রুত অনেকবার "Book"-এ click করুন, এবং একই idempotency key দিয়ে একই request আবার পাঠান। দেখুন একটিই booking এবং একটিই charge হয়েছে।
- Payment-কে fail করান, time out করান, বা দেরিতে উত্তর দেওয়ান। দেখুন room হারিয়ে যায়নি এবং দুবার বিক্রি হয়নি।
- তারিখের সীমাগুলো test করুন: check-in ও check-out একই দিন, মাস বা বছরের শেষ পার হওয়া থাকা, এবং time zone।
- একটি booking cancel করুন এবং দেখুন room-টি search-এ আবার খালি দেখায়।
- Booking থেকে আলাদা করে search-এর load test করুন। Booking চলার সময়ও search-এর 500 ms লক্ষ্য পূরণ হয় কি না দেখুন।