VOOZH about

URL: https://thenewstack.io/how-airbnb-and-twitter-cut-back-on-microservice-complexities/

⇱ How Airbnb and Twitter Cut Back on Microservice Complexities - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-08-04 13:45:22
How Airbnb and Twitter Cut Back on Microservice Complexities
news,
API Management / Microservices

How Airbnb and Twitter Cut Back on Microservice Complexities

Two recently-posted talks from Airbnb and Twitter show large Web scale companies are battling an encroaching complexity in their respective microservices-based architectures. Both establish robust data layers, and streamline functionalities into a simplified core set of services in hopes of improving developer productivity.
Aug 4th, 2021 1:45pm by Joab Jackson
👁 Featued image for: How Airbnb and Twitter Cut Back on Microservice Complexities

Two recently-posted talks from Airbnb and Twitter show how these web-scale companies are battling encroaching complexity in their respective microservices-based architectures. Both established robust data layers built on GraphQL, and streamlined core functionalities into a simplified set of services to make it easier for developers to build out new features at the edges.

Last decade, Airbnb moved to a service-oriented architecture (SOA) to rid monolithic complexities, only to find this microservices-based approach led to its own tangle of complications. The company currently has 2,000 services, managed by 500 engineers. The dependency graph, which is to say the overall system design, was “hard to reason about,” said Jessica Tai, Airbnb tech lead manager and core services infrastructure engineer, in an InfoQ Qcon talk posted earlier last month.

Such complexity made it hard to debug services. It took longer to develop features, thanks to a growing number of changes that had to be made at integration points. Services started to duplicate functionality, and data was getting fragmented.

In response, the lodging giant created what its engineers call SOA v2. In v2, services are grouped into either internal services or presentation services. Between them is a data aggregator, a new set of APIs that would relieve the need for presentation services to duplicate data services, using GraphQL.

For instance, the mobile app would have to fetch data about an Airbnb listing and the users themselves from different sources. This resulted in different parts of the app or website duplicating a lot of querying logic.

Using GraphQL, Airbnb’s “data aggregator” relies on a set of universal resolvers that know from where to fetch the data. It’s also a good place to embed some lightweight business logic as well. The data aggregator can also batch multiple queries into a single call to the underlying service, improving scalability.

👁 Image

Further reducing complexity, the underlying data services are clumped into “service blocks,” handling different core entities, such as “user” and “home,” all unbeknownst to the developer.

Within the data aggregator, each block provides “cohesive business logic around that entity,” Tai said. “Everything beneath the service is considered a black box to the client, and this helps to simplify the developer experience.”

While this approach introduces an additional network hop, it gives the engineers the chance to optimize for query patterns.

Incidentally, another social networking giant, Twitter, went through a similar refactoring process.

The social media giant has just rolled out a set of public APIs, as well as a multitenant microservice to cut down the sprawl of other microservices, said Steve Cosenza, Twitter Senior staff Engineer, in another QCon talk.

Originally, Twitter ran their public APIs through a single Ruby-on-Rails application (“Monorail”), which had grown into one of the largest Rails codebases in the world. And so it was increasingly difficult to update. By 2014, Twitter went the route of microservices, migrating the API service to a set of 14 microservices, running on an internal Java Virtual Machine (JVM)-based framework (“Maccaws”).

This first microservices approach worked well … for a while.

“While the microservices approach enabled increased development speeds at first it also resulted in a scattered and disjointed Twitter API,” Cosenza said. Independent teams designed and built endpoints for their specific use cases with little coordination. This led to fragmentation and, inevitably, a slowing of developer productivity.

Over time, Twitter started building out a set of internal APIs, also based on GraphQL, to help its own developers move more quickly. In 2020, this internal architecture was then pressed into use for what would be version 2 of the Twitter public API.

The public API platform was designed to scale to a large number of endpoints, which could all be rolled out as new services are introduced. The idea is to have developers worry about querying and mutating only the data they need, without setting up and running an HTTP API service for each new functionality.

The idea was to minimize any specific endpoint business logic within the core HTTP service, “otherwise the system would quickly become yet another unmaintainable monolith,” Cosenza said.

Core and common API logic would be handled by a dedicated infrastructure team. To developers, this core service offered a “powerful data access layer that emphasized declarative queries over imperative code.”

“Twitter clients query for data and render UIs while the public Twitter APIs query for data and render JSON,” he said.

👁 Image

The two core data components are “resource fields,” which bits of atomic data such as Tweets or users, and “selections,” which are ways to find and aggregate resource fields (“tweet lookup by ID”).

So where can developers add in their own endpoint-specific business logic? By default, they are given the option of using the domain-specific language for Twitter’s internal data cataloging system, Strato. For those cases where imperative code is needed, the developers can build a Scala microservice that is then exposed in a Strato column.

“In either case since the platform provides the common HTTP needs for API endpoints so new APIs can be released without spinning up a new HTTP service,” Cosenza said.

TRENDING STORIES
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in Twitter.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.