Amazon.com: A Modularity Case Study

We'll look at why Amazon.com broke apart their website using Service Oriented Architecture (SOA).

Scroll down...

Content

Resources

Comments

There is a high-level architectural pattern used by many top software companies today called Service-Oriented Architecture (SOA), which basically embodies the idea of modularity on a large scale. In it, each separate sub-section of the overall architecture is designed to be completely independent from every other and they communicate using specified interfaces called Application Programming Interfaces (APIs).

If you were building an application yourself, you'd probably include all the code to handle displaying the main page, deciding which products to display, handling user registrations and handling email logic all within one code base. With SOA, each of those would be broken out into separate applications that communicate with each other using interfaces.

Amazon's SOA

You saw in the video the example of SOA occurring at Amazon. To recap, that's where CEO Jeff Bezos sent a now-famous email mandating that:

1) All teams will henceforth expose their data and functionality through service interfaces.

2) Teams must communicate with each other through these interfaces.

3) There will be no other form of interprocess communication allowed: no direct linking, no direct reads of another team's data store, no shared-memory model, no back-doors whatsoever. The only communication allowed is via service interface calls over the network.

4) It doesn't matter what technology they use. HTTP, Corba, Pubsub, custom protocols -- doesn't matter. Bezos doesn't care.

5) All service interfaces, without exception, must be designed from the ground up to be externalizable. That is to say, the team must plan and design to be able to expose the interface to developers in the outside world. No exceptions.

6) Anyone who doesn't do this will be fired.

Source: Rip Rowan via G+

So what's different about Amazon and your apps? Scale, of course.

When a company gets a huge amount of traffic, it's just not feasible to keep everything under "one roof". Some parts of the code are being used constantly, while the others are just causing bloat. Separate programs are required just to hold things together and manage information flow.

The code base also becomes so large and interconnected that it is nearly impossible to fix or understand at once. Developers begin to feel like touching one part of the code is going to break something somewhere else purely because a sloppy developer made them depend on each other back in 1999. This isn't a hypothetical situation; it's present in every major code base.

Amazon decided to break theirs apart to make it more manageable. With a modular SOA architecture, if there's a problem in Sector 4, you at least know where to look first. Even better, because the services are only allowed to talk to each other using specified interfaces, you know that you won't break other things by mucking around in the implementation details of a particular module (as long as it doesn't change the interface).

For a good read about the Amazon SOA switch and a whole lot of commentary on the Google Plus platform's architecture, Read this blog post from Rip Rowan (which was quoted above and which originated with Steve Yegge). It started as a private post venting about Google's decision making but was accidentally made public. The people loved it for its frankness so it lives on.

Wrapping Up

So why bother talking about SOA at Amazon?

It's a great example of how modularity forms the root of good software engineering practice. Thinking about really complex applications like Amazon.com emphasizes key principles of good engineering that will guide your thinking even when you start at the beginning with a simple web application. We'll talk about those principles in the next lesson.

If you haven't heard enough about SOA, check out why Uber switched to SOA.



Sign up to track your progress for free

There are ( ) additional resources for this lesson. Check them out!

There are no additional resources for this lesson just yet!

Sorry, comments aren't active just yet!

Next Lesson: Characteristics of Good Systems