Yellow marks are automatic key passages. They aren’t personal saved highlights. Select a timestamp to follow along with the video.
Uber grew from about 200 engineers to roughly 2,000 in under two years, and its microservices architecture brought both benefits and hidden costs. The talk covers the many languages and repositories that accumulated as teams moved fast, the problems that followed from RPC and untyped JSON interfaces, and the difficulty of tracing fan-out latency across services. It ends with lessons the team wishes it had learned sooner, including building tracing, structured logging, and failure testing in from the start, using incentives rather than mandates for migrations, and making trade-offs deliberately.
Uber's Rapid Growth Across Cities
Uber has grown so quickly that the pace of change is easy to underestimate. Two short time-lapse videos make this clear, showing Beijing and Chengdu compared from the start of one year to the end of the same year. Within a single city, the growth is dramatic, and the same pattern appears in many cities around the world. Scaling at this speed forces constant adaptation. Some of the responses were not always right, but they produced a lot of learning along the way. Most internal statistics cannot be shared publicly, though a few public numbers can be mentioned.
Engineering Headcount and Looking Back
Uber now has roughly 2,000 engineers. About a year and a half ago, when the speaker joined, there were around 200. That amounts to 10x growth in about eighteen months. In such an accelerated environment, a year and a half feels like a very long time. Looking back, a useful question is what advice would have helped at the start.
Why Advice Is Hard to Accept
Advice is usually accepted only when a person is ready to hear it. Early on, most advice would probably have been dismissed with the assumption that this time would be different. Still, some lessons likely have to be learned the hard way, at least in part. Advice can still be valuable because it gives a reference point: when a lesson comes up later, it helps to remember that someone had warned about it.
The Impossible Service Count
The number of services is changing so rapidly that no reliable count exists. Teams build new services every week, and some services are retired, so the total running in production at any moment is hard to pin down. Metrics exist for many things, but an exact service count is not something people track closely. The service graph does not stop at a thousand, even though that figure was mentioned earlier, because there is no reliable way to track the total over time.
Microservices and Their Hidden Trade-offs
Microservices are an expected topic at a technology conference, and breaking up monoliths into smaller components is widely recommended. The word monolith sounds unappealing, though. At a certain scale, microservices carry their own downsides and surprising trade-offs that deserve closer examination.
Immutability and Deployed Services
Developers working with databases and programming languages often praise immutability. Append-only databases are valued because they are easier to reason about. Similar properties may apply to a microservices deployment. Changes are the moment when things are most likely to break. Uber is most reliable on weekends, when its engineers are not making changes, even though those are the busiest days. Every change carries the risk of breaking something. At some scale, a set of deployed microservices may be best left untouched. Uber appears to have reached that state whether or not it was planned, and this has been a surprising benefit.
Why the Microservice Approach Pays Off
It is worth asking why so much engineering effort goes into this architectural style. The approach is not accidental, because it brings clear advantages. Uber constantly adds people, and those people need to be quickly formed into teams that can reason about their own boundaries. Microservices let these teams form quickly and move and release independently, which is a significant benefit. Uber has also adopted an own-your-uptime model, in which teams run the code they write. Every service team is on call for the services it runs in production.
Choosing the Best Tool and Its Costs
People often say to use the best tool for the job, but 'best' has many meanings. It can mean best to write, best to run, best because a team knows it well, or best because the libraries are mature. Once examined, the phrase becomes less clear. A large microservices deployment is a distributed system, which is far harder to work with than a single monolithic program. Every interaction becomes a remote procedure call, and failure modes and odd behaviors appear that never existed in one codebase. Troubleshooting becomes harder as well. It is difficult to tell whether a service is failing because something further along the chain is broken, and it takes effort to ensure the right people are paged and the right corrective actions are taken.
Less Obvious Costs and Trade-offs
Many discussions cover the obvious costs of distributed systems, but some costs are less visible and more interesting. Every decision involves a trade-off, even when the trade-off goes unnoticed. Gaining the benefits of many microservices means giving something up. For example, building a new service instead of fixing something broken may seem like a feature, since it avoids touching old code that might break. Over time, however, constantly building around problems and never cleaning up the old ones becomes a real cost.
Trading Complexity for Politics
Another way to describe the trade-off is that complexity can be traded for politics. Writing a new service can avoid an awkward conversation with another team. Software is still written by people, so behind every source file are people who may need to be engaged. Building more software is an easy way to avoid those uncomfortable interactions. It also lets engineers keep their existing biases.
Language Preferences Across Teams
Engineers often have opinions about which programming language is better. If a team works in Node.js while an engineer prefers Python, that engineer might build new functionality in Python rather than contribute to the other codebase. This can reinforce personal preferences, but it may not serve the organization or the system as a whole. These effects are not obvious, and modularizing everything may introduce them without anyone intending it.
How Uber's Engineering Teams Developed
Concrete examples show how Uber's engineering teams and technology choices developed. In the early days, the entire mobile app was outsourced. Because the problem did not seem technical, an outside company wrote the first version of the Uber mobile app and its back end. When engineering was brought in-house, the dispatch system was written in Node.js. That team now writes all of its new work in Go.
Languages Across the Core Systems
The core services, which make up much of the rest of the system, were originally written in Python, and that team is now moving to Go. When maps was brought in-house, those teams used Python and Java. A whole data engineering group writes its work in Python and Java. Uber also built an in-house metrics system in Go. Looking across all of these systems, the variety of languages becomes noticeable, and it is easy to start noticing that the picture is growing complicated.
Many Languages Across Microservices
Microservices made it possible for teams to write services in different languages while still communicating with one another. Uber's mobile app backend began as code written by an outside company, but as engineering moved in-house, the stack grew into a mix of languages. The dispatch system was written in Node.js, and the team building it now writes all new code in Node.js. The core services, originally in Python, are moving to Go. Maps was brought in-house, and those teams use Python and Java. The data engineering group works mostly in Python and Java, and the in-house metrics system is written in Go. Seeing this variety, it looked like a strength: each team could choose a suitable language, and the services would still interoperate.
The Hidden Costs of Mixed Languages
The team had not fully counted the operating costs of this approach. Sharing code is harder when the codebases are in different languages, which is an obvious tradeoff. Moving people between teams is also harder. When engineers build up knowledge of one platform, much of it may not transfer directly to another, and while anyone can learn a new language or platform, every move carries a real switching cost.
Mixing languages can also fragment the engineering culture. Engineers start to identify as Node programmers, Go programmers, or Java programmers, and begin to dismiss the other camps. This tendency is natural, since people tend to organize into groups. Nothing in a polyglot microservices setup pushes back against it, so it becomes a real cost. The right way to address it is not yet clear.
Everything Becomes an RPC
In a microservices architecture, every interaction between services effectively becomes a remote procedure call, or RPC. This creates problems that do not appear in small systems. Teams communicate through these calls, so the way the calls are designed shapes how well the whole organization works.
Where HTTP Breaks Down at Scale
Many teams start by building their services on HTTP, and this path is common. At small scale, the flexibility of HTTP is appealing. At large scale, especially when many engineers join quickly, its weaknesses become clear. Questions arise about what a status code means, what headers should contain, what belongs in the query string, whether an endpoint is truly RESTful, and what a given HTTP method is supposed to signify. Features that seem elegant in browser programming turn into complicated and subtle interpretation problems across services.
What engineers really want is simple: call this function over there rather than here, and tell me what happened. Instead, they must work through the semantics of HTTP, which proves surprisingly expensive.
The Risks of Untyped JSON
JSON has similar appeal. It is easy to read, and you can look at it and see UTF characters and structure directly. Without types, however, it creates serious problems. The issues rarely appear immediately. Instead, the system accumulates a hidden risk that surfaces later. Someone changes something, and a few service hops downstream, another service depends on a subtle interpretation, such as the difference between an empty string, a null value, and a type coercion that behaves differently in one language than in another. The resulting failure can be large and take a long time to untangle.
Types on these interfaces would have prevented much of this. Approaches that look great at small scale or in browser programming become real costs at large scale, especially with large teams. RPCs are slower than a function call within a browser, and as more of the system moves to microservices, those costs add up.
Servers Are Not Browsers
In hindsight, the lesson is that servers are not browsers talking across a data center. When you control both sides of an interaction, it makes more sense to treat each call as a function call than as a web request that might be cached and fetched over the internet with all the extra browser behavior attached. Treating these interactions as function calls is better for everyone.
How Many Repositories Is the Right Number
Deciding how many repositories to use is a question the team did not expect to debate, since the answer seemed obvious. Many people disagree and favor many repositories, perhaps one per project or more, and this follows the broader industry trend of publishing many small modules. Many small modules are also friendly to open source, because it is easy to open-source one part of a system or swap pieces out.
A single repository has its own strengths. It makes cross-cutting changes easy. If you need to change something in two services at once, you can do it in one commit, and the code is easy to browse. Both approaches involve tradeoffs. Many repositories put stress on the build system and on navigation, and it becomes painful to confirm that a cross-cutting change was made correctly or that you have all the relevant code. A single repository becomes a problem once it grows large enough that you cannot build or even check out the software without elaborate tooling. Google's monorepo is a well-known example. Because it is so large, nobody checks out all of it. Instead, a virtual file system lets engineers work as if they have everything, while only the files they are actually using are present. A single repository can work, but it probably requires specialized tooling.
Uber's Repository Count
Uber's internal repository count gives a sense of the scale. A month before this was recorded, the internal repository held over 7,000 repos. Now it holds over 8,000. Some of these are personal projects that individual engineers created, and some teams keep their service configuration in separate repos from the service code. These configuration repos are still not the majority. Uber has moved far toward the many-repos end of the spectrum, and it seems unlikely that it will ever return to a single repository. That remains uncertain.
Operational Dependencies Between Teams
A large microservices deployment brings many operational problems, and downstream dependencies make things complicated. Teams may be blocked by one another. For example, a team may need to ship a fix into a service that another team owns, but that owning team may not be ready to release. This raises a question about whether other teams can release a service when its own tests pass, and whether automation is good enough to let teams release each other's software. At Uber, the answer depends on the situation. Sometimes it is yes, but usually it is no. Usually, a team waits for the other team to release, and the teams coordinate. This takes time and effort.
Losing the View of the Whole System
The main realization is that the microservices tradeoff goes too far if it is pursued without limit. Small teams move fast, release features quickly, and own their uptime, and all of that is valuable. Sometimes, however, you need to understand the entire service as one system working together, like one giant machine. After breaking the system into as many pieces as possible, it becomes hard to reassemble that understanding. In hindsight, the team should have spent more time keeping that context together and ensuring that the whole system could still be understood as one.
Performance Across Many Languages
Performance is a major concern in this kind of system, especially when teams communicate over RPCs, which are expensive. When multiple languages are involved, understanding performance becomes difficult, because the right approach depends on the language and its tools, and those tools vary widely. Allowing teams to write in many languages made performance analysis across them a real challenge.
Go offers useful profiling output, for example. Not every runtime provides something similar, however. Uber has been working to give all of its languages a common profiling format, namely flame graphs. Flame graphs now exist for Go and Node.js programs, and similar work is underway for Python. The team is fairly sure Java is nearly solved, though some aspects of Java performance are hard to capture. The goal is that when engineers move through the system and need to understand performance, the tools should not differ drastically from one service to the next. Otherwise, tracing a performance problem becomes much harder.
Standard Dashboards for Every Service
Engineers also want performance dashboards. If dashboards are not generated automatically, teams build their own, featuring whatever they consider important. As a result, when someone tries to trace a problem across services, one team's dashboard looks completely different from another's. The better approach, which Uber is now adopting, is to give every service a standard dashboard when it is created. The dashboard includes the same set of metrics that the organization agrees are useful for understanding a service. This happens without any extra work, so every new service gets its dashboards automatically. Engineers can browse any service and find a consistent layout.
The Debate Over Caring About Performance
Whether performance deserves attention at all is another debate. The familiar warning that premature optimization is the root of all evil has spawned a strange subculture in the industry. Some people are literally against optimization, arguing that it does not matter.
Developer velocity versus performance
Another major debate is whether performance matters at all. The old saying that premature optimization is the root of all evil has produced a strange subculture of people who oppose optimization outright. Their argument is that the service does not have much traffic, that teams should always optimize for developer velocity, and that buying computers is cheaper than hiring engineers. There is some truth to this. Engineers are expensive and getting more expensive, while computers keep getting cheaper.
Performance matters eventually
That argument has limits, because performance does not matter until it suddenly does. At some point, most services will have a real performance problem. If the organization has built a culture where performance never matters and the answer is always to add more machines, it may lack the infrastructure and habits needed to respond when a problem appears. In that case, making performance matter after the fact can be very difficult.
A default performance SLA for every service
A reasonable minimum is a performance-based service level agreement that applies automatically to every service when it is created, whether or not it is yet useful. The number does not need to be ideal. A value such as 20 seconds can serve as a starting point. What matters is that every service has a number. Teams can opt into more aggressive targets, but no one has to opt in to having a target at all. With a number in place, a team can always tighten it later, which creates a safety net and a knob to turn. Looking back, the key lesson is that a service does not need to be good from the start, but it needs to know where it stands, because that will matter eventually.
How fan-out drives latency
Fan-out is closely related to performance and causes many problems. Its effects are obvious once understood, but they are subtle for anyone who has not dealt with them before. The overall latency of a response is bounded by the slowest call in the chain. Consider a typical service that responds in one millisecond 99 percent of the time, which seems good. The remaining 1 percent of requests may take a full second. That seems tolerable, but users who hit that slow case are still affected. With large fan-out, the chance that a request touches a slow path rises quickly, so more and more users hit someone's slow case. At the 95th percentile, only a few fanned-out calls are needed before slow cases occur far more often.
Using tracing to find fan-out
The best way to address fan-out problems is distributed tracing. Tools such as Zipkin exist, and the OpenTracing project is a strong effort that the team is participating in. Smaller deployments can get by with logs. Attach a common ID to every request and include it in every log message. Without some way to follow a request's journey through the architecture, fan-out problems are very difficult to understand.
A slow dependency in the chain
Several examples from the team's production Zipkin deployment show why these problems are hard to track down. The first is straightforward. A request moves through the system, and at some point one service takes a long time. The services below it depend on it, so the cause is easy to locate without any tricks. Every so often, that component is simply too slow.
Unbatched lookups hidden by healthy metrics
A trickier case involves a huge fan-out to a single service. The top-level service took a long time to respond, but each individual call into the downstream service ran at roughly the same speed. That service was not especially fast, but its response times were consistent. When the owning team checked its graphs, they looked healthy and well-behaved, so the problem was not visible from that side. The real cause was unintentional fan-out. The top-level service fetched a list of IDs and then resolved them one at a time, issuing many concurrent RPCs through a sliding window of pending requests and firing off another as each one finished. This is needless work. A bulk resolve endpoint that accepts the whole list and returns all the results at once would solve it. The problem was only found because of tracing, since it is hidden within common metrics.
Fast calls that multiply
Another case involves fan-out where each request is extremely fast, but the number of requests runs into the many thousands. An ORM layer was involved. The service received an object that looked like a regular object, the kind one might loop over and modify. However, every time one of its properties changed, the ORM turned that change into a database request. A seemingly innocent traversal of a collection became 10,000 database requests. If the database team were asked how its system was doing, it would likely report that requests were being served quickly and that there was nothing to worry about. Yet the database was handling an enormous number of pointless, tiny operations. Tracing is needed to reveal fan-out of this kind.
Tracing overhead and sampling
A surprising side effect is that the overhead of tracing can change the results. Tracing takes a lot of work, so the recommended approach is to trace a statistically significant portion of requests rather than all of them, such as around 1 percent. This is the approach the team uses.
Cross-language context propagation
The most surprising finding was that implementing tracing requires cross-language context propagation, and that requirement blocks many other problems. Because the company uses many languages and frameworks, passing request context such as the user, their authentication status, or their region becomes very complicated without a shared place where that context can be carried and propagated. When a service receives a request and makes dependent requests based on it, the incoming context should be passed along even if the intermediate service does not understand every field. Those fields should still reach the services below. Adding this support earlier would have saved a great deal of time and effort. It did not seem important at the time, but it turned out to be essential.
Consistent structured logging
Logging is closely tied to tracing. With many languages and teams, and with half the engineering team having joined in the last six months, engineers tend to log in very different and incompatible ways. The answer is to provide structure. Mandates alone are tricky to enforce, so the better approach is to give engineers tools that are so obvious and easy to use that they would not do it any other way. Multiple languages make this harder.
Back pressure in logging
Logging can also make existing problems worse. When something goes wrong, services often start logging heavily, which creates a second problem of excessive logging that can cascade. Back pressure in the logs helps by dropping log messages when they cannot be written fast enough. This is being rolled out gradually across the various platforms. It should have been added sooner.
Accounting for log volume
More important still is accounting for all log messages. Logs are typically indexed by systems such as an ELK stack, Splunk, or a Hadoop-based pipeline so that people can search them and learn from them. When logging is free, some people log far more than others, often without malicious intent, simply because they assume logs cost nothing. Without a way to trace log volume back to a team that can be billed, the shared Elasticsearch cluster that indexes everything eventually runs into capacity problems and must prune data. Teams should receive that feedback early so they can slow down their logging.
The zap logging library
The team has open-sourced zap, a structured logging library for Go, and uses it for much of its new work. Its standout feature is speed. It makes zero allocations on every log call.
Load testing against production
Load tests are needed before changes reach production, but a test environment cannot be built as large as production. Realistic traffic that exercises the many problems lurking in the system also cannot be generated easily. For these reasons, the team has started running load tests against production itself.
Running Load Tests Against Production
Load tests are normally run before code reaches production, but a staging environment can never match production's size, and it cannot generate realistic traffic that exercises the problems hiding in the real system. For that reason, the team began running load tests directly against production, usually during off-peak hours. This approach causes strange problems. The biggest is that the test traffic inflates the metrics, so everyone assumes the system is receiving far more real traffic than it is. To prevent that, every test request must carry context that marks it as a test, so counters are not incremented and people do not mistake the load for a denial-of-service attack. That context has to be propagated through the entire system.
Keeping Systems Near Their Peaks
The team would prefer to load-test all services all the time, including when there is excess capacity. Latent bugs often appear only when traffic reaches its peak, so keeping systems near those peaks, just short of them, exposes these bugs earlier. The test load then backs off as real traffic ramps up. Doing this makes the test-traffic problem worse, though. Systems should have been designed from the start to recognize test traffic and account for it differently. Many of the ideas discussed in the talk on failure testing were relevant here. Failure testing, along the lines of Chaos Monkey, was already an idea the team strongly supported.
Resistance to Failure Testing
A surprising lesson from putting this into practice was that not everyone likes failure testing, and many people dislike it, especially when it is added after a service already exists. Developers who have built a service they are proud of may feel attacked when someone announces that their service will now be deliberately killed. Users will probably notice, and the disruption will be unpleasant. In hindsight, failure testing should have been built into the production process from the beginning, so that every service has to withstand random killing, slowdowns, and other disruption regardless of whether its owners want that. People are unlikely to opt in voluntarily, so the practice has to be mandatory from the start.
Migrations Are the Normal State
Another surprise concerned migrations. Conference talks from large companies usually showcase new technology that has just started working, but most engineers spend their time maintaining and migrating legacy systems. In practice, nearly everything is legacy, and much of the work involves migration. Storage teams, for example, are often engaged in a constant migration from one legacy system to another, slightly less legacy one. Someone is almost always migrating something somewhere. The old systems still have to keep working, and there is no longer a maintenance window in which to take a service down. A global business has no off-peak time, because it is always peak time somewhere. Abandoning old components as long as they keep working creates a problem. Eventually a cross-cutting change becomes necessary, and it is very expensive when the affected code has not been touched in months and people are afraid to change it.
Carrots Instead of Sticks
Forced migrations are a mistake. People naturally resist being told to adopt a new system, but the real difference lies between an organization requiring a change because it needs one and offering a new system that is so much better that adopting it becomes obvious. The team wishes it had placed greater priority on pure carrots and no sticks. Mandates are a bad idea, with two exceptions: security and compliance requirements, which are the two trump cards that can justify forcing people to act. Outside those cases, someone working on architecture or infrastructure should rely on carrots.
Build Versus Buy and Commoditization
Open source is popular, but the build-versus-buy trade-off is not settled, and people disagree about what to build internally and what to adopt from open source. Anything that looks like infrastructure, something that belongs to the platform rather than the product, eventually becomes an undifferentiated commodity. A cloud provider or another company will offer it as a service, and the platform work that a team spends its time on will eventually be done by someone else, more cheaply and more reliably. Keeping this perspective is healthy. However, it upsets many engineers, who become deeply invested in their infrastructure work. Hearing that a provider has released a service equivalent to an internal system can prompt people to rationalize why the private version is still better. This reaction is not obvious at first, and it is another reminder that people sit behind every tool.
Politics in Modular Systems
Breaking systems into small services can enable politics. The word is widely used, but many people are unclear about what it means. A colleague offers a useful definition: politics happens whenever a decision violates a particular principle, specifically when someone places their own interests above the team's, or the team's above the company's. In many environments, though, politics simply means things a person does not like, which is the most common usage. Taking the colleague's definition seriously is more useful. Rapid development, rapid hiring, and frequent releases create a temptation to violate this principle, because prioritizing what is best for the whole company is harder when value is measured in small, individual accomplishments.
Making Trade-offs Deliberately
Every choice involves a trade-off. The most important lesson from this process was the need to make these trade-offs intentionally. Decisions often happen without anyone explicitly making them, simply because momentum points in a direction. The goal is to recognize which trade-offs are being made, even when no one has formally chosen them.
Audience Question on Service Coupling
With time for only one question, an audience member asked how the team avoids coupling between services when it uses RPC and REST. The honest answer is that the team does not always avoid it. The team does its best and applies good engineering discipline, including failure testing to surface unexpected couplings. Duplication and coupling still occur. In particular, downstream availability is hard to manage. If a service several links down the chain goes offline, there is often no useful fallback to degrade to, so the coupling simply exists. Even so, the trade-off still matters. Teams can still move independently, release their components independently, and monitor and understand them independently, even when coupling is present.
Turn your watchlist into a reading routine
Bring your YouTube videos together, read summaries with key passages marked, and explore the full transcript. Save your own highlights with Pro.
Start with 5 free batteries. Each covers up to 30 minutes of a new summary.
New summaries depend on video availability and demand; processing may take time or require retry.