Work / Amazon

Case study · Amazon.com, through a consulting firm

A bookstore from a port in the wall

How a proof of concept turned a serial port and the book records behind it into a working online store: a catalog, a shopping cart and a database, built before the web had any of the tools that make that easy.

Short link: fredlackey.com/amazon
RS-232 in. SQL out.

Executive brief

The problem

Amazon.com wanted an online bookstore that could offer any book in the ISBN data. The requirements came down to this: here is an RS-232 port, and here is the data behind it. Work out how to reach it, and use it to build a bookstore.

What was built

A proof of concept that pulled ISBN records across the serial link, parsed and normalized them into a SQL database, and put a browsable catalog and a shopping cart on top. If a book was in the data, the store could sell it.

The outcome

Two architects each built a proof of concept, and both were selected and pulled into what came next. Mine was a small part, early, of something that became enormous.

1 of 2architects chosen to build a proof of concept
Bothproofs of concept selected and carried forward
RS-232serial feed of ISBN records, loaded into SQL
In the datameant for sale: no stock counts, no hand-picked titles

The situation

Back then, almost nobody had heard of Amazon. The requirements I was handed were short: here is an RS-232 port, and here is the data you can reach through it. Figure out how to get at it, and use it to build a bookstore. If a book exists in that data, sell it, and don’t worry about quantities. The store would carry any publication listed in the ISBN database, not just the titles someone had found time to enter.

The work came to me through a consulting firm. I was one of two architects and developers selected for the project, and each of us was asked to design and build a proof of concept.

Why it was harder than it sounds

Each stage between the source and the storefront had its own requirement.

  • The source sat behind a serial line. The ISBN records were reached over an RS-232 serial connection, so the first job was building a dependable pipeline to pull them across.
  • The records were not ready to use. What arrived had to be parsed and normalized before it was consistent enough to search, sort, and sell from.
  • A web store needs a database, not a feed. The data had to be structured relationally so a website could query it on demand.
  • The web had almost none of today’s tools. There was no XMLHttpRequest and no ASP.NET. A shopping cart that saved to a database was something you built from scratch.
  • A catalog that depends on typing does not scale. The point was a live, dynamic catalog. Any step that needed a person to key in records would defeat it.

The approach and the decisions behind it

Go to the source directly.
I established an RS-232 serial communication pipeline to retrieve ISBN records straight from the database, so the catalog was built from the ISBN records themselves.
Clean the data on the way in.
Every record was parsed and normalized for consistency before it was stored, so the website worked from one clean, uniform set of records.
Store it where the web can ask questions.
The normalized records were structured into a relational SQL database built for web-based querying: the shape a browsable, searchable storefront needs.
Let the data decide what’s for sale.
If a book was in the ISBN data, the store could offer it. Nobody had to choose titles or count stock, so the catalog stayed as current as the data itself.
Give it a storefront.
On top of the database I built the visual side: a catalog to browse and a shopping cart that saved each order to the database.
Write it down for the next stage.
I documented the design and operational details so the system could be carried forward and scaled beyond the proof of concept.

How it works

The proof of concept was a pipeline with one job: turn a stream of book records into a catalog a website could sell from.

How the catalog pipeline works Six stages from left to right. Book records leave the ISBN database over an RS-232 serial link. They are parsed into records, normalized for consistency, and stored in a relational SQL database. The online catalog queries that database so customers can browse and purchase. The stages from the serial link through the database run automatically, and any book in the data can be sold. ISBNdatabase RS-232serial link Parsethe records Normalizethe data SQLdatabase Onlinecatalog browse and buy automated end to end if it’s in the data, it’s for sale
Figure 1. From the ISBN database to a storefront, with the automated stages bracketed. Swipe the diagram sideways to see all of it.
  1. Retrieve. ISBN records come across the RS-232 serial connection from the database.
  2. Parse and normalize. Each record is broken into its parts and made consistent with every other record.
  3. Store. The cleaned records are written into a relational SQL database designed for web queries.
  4. Serve. The online store browses and sells from that database, and any book in the data can go into the shopping cart.

Outcome

In the end the choice was not one design or the other: both were selected, and the other architect’s work was pulled in alongside mine. I never learned how his was built, so I can only speak to my half. By today’s standards it was crude. At the time, almost nobody was doing it.

Two proofs of concept, both kept Two proofs of concept, mine and the other architect's, both selected. Arrows from each lead into the next stage of the project, which drew on both. My proof of conceptselected The other architect'sselected The next stagebuilt on both
Figure 2. Rather than pick a winner, the project kept both designs. Swipe the diagram sideways to see all of it.

My role

I was one of the two architects and developers on the project, engaged through a consulting firm rather than hired by Amazon directly. I designed and developed my proof of concept, from the port in the wall to a working storefront: the serial pipeline to the ISBN database, the parsing and normalization, the relational SQL structure, the catalog and the shopping cart. I documented the design and its operation so it could be carried forward. It was a very small part of what Amazon became, and I’m glad to have had it.

Next step

What this would mean for a similar organization

Many organizations still have a catalog, a price list, or a product database that depends on someone retyping data that already exists somewhere else. The principles here carry over regardless of the technology: go to the authoritative source, clean the data on the way in, store it in a shape the application can query, and remove every manual step that would keep it from staying current.

If your organization is wrestling with data like that, I am glad to compare notes on where it stands and what I would do next.

Start a conversation