Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Booking.com Engineering 7 min read Case study mediumAdept

Under the hood of Booking.com’s search engine

Booking.com’s search engine generates personalised hotel offers at request time instead of precomputing and indexing every possible room/date/price combination, which would be combinatorially infeasible. A single request stitches per-night availability, evaluates 1,000+ declarative pricing rules in memory, ranks thousands of offers in stages, and handles group bookings as a constrained knapsack-like problem. The system runs as a custom scatter-gather database: coordinator nodes fan searches out to data nodes storing data in RocksDB, with no network calls on the hot path. The accepted tradeoffs are brief availability inconsistency for faster search, full coverage at the cost of query skew, and low latency with complex logic in exchange for running replication and cluster health themselves.

Related posts

  • How we selected the next vector database at Booking.com

    Booking.com Data Science mediumAdept

    Booking.com replaced its OpenSearch-backed internal Embedding Service with Weaviate after running its own production-shaped benchmark instead of trusting public comparisons. The evaluation used 100M all-MiniLM-L6-v2 embeddings built from Amazon Reviews 2023, with full and filtered approximate KNN plus a mixed workload including 20% writes, at 5 to 100 concurrent clients. Every system was tuned to about 0.99 recall and compared mainly on P99 latency. Dedicated vector databases gave lower tail latency and better scaling under concurrency, with roughly 40% lower compute and memory cost. Because clients already reached storage only through an internal service, most teams migrated with just a configuration change.

  • What today's software owes to Bronze Age clocks

    PlanetScale mediumAdept

    Leaky buckets, descended from Bronze Age water clocks, remain a cheap admission-control mechanism: a bucket stores only its last level and timestamp, so its current level can be computed lazily as max(0, level_then − drain_rate × elapsed). Shopify's GraphQL API shows the pattern in practice, charging an estimated query cost up front and refunding or charging the difference afterward. Postgres and MySQL lack built-in admission control, unlike Oracle Resource Manager and SQL Server Resource Governor, so PlanetScale's Database Traffic Control adds token-bucket resource budgets to Postgres. Each budget has a server-share refill rate, a burst limit in whole-server seconds, a per-query limit and a maximum concurrent workers setting, with costs estimated from query plans and history. PlanetScale recommends running a new budget in warning mode before switching it to blocking.

  • Building a Retrieval Pipeline with Turso and Voyage AI

    Turso mediumAdept

    Turso's SQLite-compatible engine with native vector columns, paired with Voyage AI embedding and reranking models, replaces a multi-service RAG stack with a single embeddable database for agent retrieval and memory. Documents are indexed with voyage-4-large and queried with voyage-4-lite in a shared embedding space. Candidates are retrieved via a DiskANN index (vector_top_k) or an exact vector_distance_cos scan, then reranked with instruction-following rerank-2.5. Matryoshka dimensions and int8/binary quantization map onto Turso's F32/F16/1-bit blob columns to cut storage and scan cost 4–32x. The main caveat: Turso's MVCC concurrent-write mode doesn't yet support the DiskANN index, so write-heavy agent memory should use exact scan under MVCC.

  • How Vinted Serves Personalised Search Autocomplete

    Vinted Engineering mediumAdept

    Vinted's autocomplete service runs on Vespa and serves 4,700 queries per second at 31 ms P99 over a pool of 125 million suggestions across 50+ country-language markets. More than 20% of search sessions now start from a suggestion, up from under 8%. Candidates come from product metadata combinations and search logs, scored twice a week by a heuristic built on Most Popular Completion. Switching from Vespa's native prefix queries to index-time edge-ngrams via Lucene Linguistics cut P99 matching latency from ~220 ms to ~25 ms, at the cost of more memory. A multiplexer token filter gives accent tolerance while preserving accent intent, a cascade of exact, edit-distance-1 and edit-distance-2 fuzzy tiers handles typos and supplies match-strength signal, and a LightGBM LambdaRank model with 63 features re-ranks results per keystroke for personalisation.

  • Building AI Search on Heroku

    Heroku Engineering mediumAdept

    A reference RAG architecture on Heroku pairs pgvector cosine-similarity search (top 20 chunks) with a cross-encoder reranker (Cohere Rerank 3.5, top 5), so answers come from documents that actually address the query rather than ones that are merely semantically close. Indexing crawls sites using a junk-content heuristic, splits text into 1000-character chunks with 200-character overlap at paragraph or sentence boundaries, and batch-inserts embeddings with Postgres unnest. Generation uses Claude 3.5 Sonnet, and Server-Sent Events stream pipeline progress and sources to the client. Reranking can be switched off when latency matters more than precision.

The quest for software engineering knowledge.

Look:
Layout: