System design paper · 2010

Dapper

Sigelman, Barroso, Burrows, Stephenson, Plakal, Beaver, Jaspan and Shanbhag · Google technical report 2010

How Google followed one request through hundreds of services and recorded where its time went, cheaply enough to leave switched on everywhere.

One request across five services, A to E, drawn as a tree of timed pieces of work. Each piece carries its own number and its parent’s, which is enough to rebuild the tree later. The chain A, C, E accounts for most of the 100 ms. The times are illustrative.

You’ll learn to

  • Read the ids, parent ids and timestamps that join the pieces of one request into a tree.
  • Explain how Google followed requests through threads and network calls without asking application teams to change their code.
  • Work out how much data a sampling rate such as 1 in 1,024 produces, and why a second round of sampling happens before storage.
  • Compare today’s tracing tools, Zipkin, Jaeger, OpenTelemetry and W3C Trace Context, with Dapper’s design.

The idea in short

One click on a large website can start work in hundreds of different programs, written by different teams. When the page is slow, nobody can say which program is to blame. Dapper gives every request an identity number. Each program then writes down, for each piece of work it does, its own number, its parent’s number and when it started and finished.

Joined up afterwards, those notes form a tree that shows where the time went. Google kept this cheap in two ways. The code lives in a few shared libraries, so teams change nothing. And only about 1 request in 1,024 is recorded, which is still plenty: anything common enough to matter shows up thousands of times.

The problem

In 2010 Google published a report on Dapper, the system it used to find out where time goes when one request touches many services. The authors had run it in production for over two years.

Their main example is a web search. A front-end server receives the query. It may pass it to hundreds of query servers, each searching its own slice of the index. It may also ask other systems for adverts, spelling fixes, images, videos and news, then merge everything into one results page. Google called this “universal search”. Thousands of machines and many different services could work on a single query, and people notice delay.

An engineer who only sees the overall response time knows something is slow but not which service to blame. The authors give three reasons.

  • Services keep changing. New ones are added and old ones altered from week to week, so the engineer may not even know which services a request uses.
  • Nobody knows everything. Each service is built and run by a different team, and no engineer is an expert in all of them.
  • Services are shared. A machine or a storage system such as Bigtable, Google’s distributed table store (guide), may serve many clients at once, so a request can be slow because of someone else’s traffic.

The cure is to record what every service did for one request and join the records. That joined record is called a . Building the tool raised two needs. It must run everywhere, because even small unmonitored parts make it much less useful. And it must run all the time, because strange behaviour is often impossible to reproduce later.

Those needs became three goals:

  • Low overhead. Tracing must slow services down by a negligible amount. In some highly tuned services, even small costs are noticed and the owners would switch the tool off.
  • Transparency to applications. Programmers should not have to know the tracing system exists. A tool that depends on every developer adding code breaks whenever someone forgets or makes a mistake.
  • Scalability. It must cope with Google’s size for at least the next few years.

So the question the paper answers is: how can a company record where one request’s time went, across thousands of machines and many teams, so cheaply that nobody turns it off and so automatically that no team has to do any work?

The design choices

Every later decision follows from the three goals. There were four main choices.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan

About the paper

Dapper, a Large-Scale Distributed Systems Tracing Infrastructure by Sigelman, Barroso, Burrows, Stephenson, Plakal, Beaver, Jaspan and Shanbhag, Google technical report 2010.

Read the original paper

More System design papers

All papers