Design Zillow
Zillow is a housing service that stores a page for every home, answers searches over homes and shows an estimated value for each one. The catalogue changes slowly, and one nightly pass can revalue every home.
The ask
A buyer searches homes by place, price, rooms and size. Each result opens a home page with photos and facts.
Every home page shows an estimated market value. The estimate exists even for homes that are not for sale.
Sellers and agents update listings. Sale records arrive from public sources on a slower rhythm.
Reads dominate by far. The write side is listings, photos and sale records arriving through the day.
Estimate the scale
The catalogue holds 100,000,000 homes. That is a stated figure for the service.
Searches run at 100,000,000 a day.
100,000,000 searches / 86,400 seconds = 1,157 searches per second.
The nightly estimate pass recomputes every home over one night. The night is counted as a full day of seconds for a safe rate.
100,000,000 homes / 86,400 seconds = 1,157 estimates per second, sustained.
Search load and batch load are the same order. The batch runs at night, when search load is lowest.
API and data
The search operation takes a place, a price range, room counts and filters. It returns matching homes in pages, with map positions.
The home operation takes a home. It returns facts, photos, sale history and the stored estimate.
A home record holds an address, coordinates, rooms, size, a lot size and a sale history. Facts change rarely and carry a source and a date.
A listing record holds a home, a price, a state and photos. The state moves from active to pending to sold or off market.
An estimate record holds a home, a value, a range and the date it was computed. The range admits that one number is never exact.
High-level design
A search index holds the fields searches filter on, plus coordinates. A geospatial index here means an index organised by place, so a map area returns its homes fast.
Home pages are read from a store keyed by the home. Popular pages also sit in a cache.
Photos live in blob storage and ride a content delivery network. A page carries photo links, not photo bytes.
An intake pipeline merges listing updates and sale records into home records. Conflicts keep the newer dated fact and log the loser.
The estimate engine is a named component with inputs and outputs. It reads home facts and nearby sales, and it writes estimate records.
Deep dive: the nightly estimate pass
The pass splits the catalogue by area. Each worker values the homes in its areas from local sales.
Nearby sales drive the value. A home is compared with similar homes sold near it in recent months.
New estimates land in a fresh set of records. The service switches to the new set only when the whole pass finishes.
A failed area keeps its old estimate for one more night. A half-new catalogue never shows.
A sharp value change gets a check before publishing. Data errors look exactly like sharp changes, and the check separates them.
Deep dive: map search
A user drags a map, and results must match the visible area. The search takes the area corners as its place input.
Dense areas hold far more homes than a page shows. The answer returns counts per cluster plus the first page of homes.
Filters apply inside the index query. Price and rooms narrow the set before any page is built.
Saved searches run as background jobs on new listings. A matching new listing triggers a notification to its savers.
When listing data conflicts
Two sources report different sizes for the same home. Both carry dates and source names.
The newer dated fact wins, and the older fact stays in history. An owner correction outranks both sources.
A wrong fact moves the estimate. The estimate history therefore records which facts it used.
Owners can claim a home page and fix facts. A claim is verified against sale records before edits open.
Evaluation and trade-offs
Stored estimates make reads cheap and pages fast. The price is a value that can be a day behind a sudden sale nearby.
A range beside the value states the uncertainty plainly. One exact-looking number would claim more than the data knows.
Slow data is the core advantage. Zillow scales because homes, facts and values all change far slower than searches arrive.
Search freshness matters for listings. A sold home must leave results fast, even while its estimate ages quietly.
Scale at a glance
| Measure | Figure |
|---|---|
| Homes stored | 100,000,000 |
| Searches a day | 100,000,000 |
| Searches per second | 1,157 |
| Estimates per second overnight | 1,157 |
Exercise
Why does the design recompute home estimates in a nightly batch instead of recomputing one estimate on every page view?