Read a sample: 1. Start With the Workload
A small online shop has a problem that sounds simple: it needs somewhere to put its data.
The shop keeps customer details, accepts orders, remembers shopping carts, and reviews sales at the end of each month. A new cloud learner might hear all of that and ask, “Which AWS database should the shop use?”
A better first question is: What does the shop need to do with the data?
The answer may differ for each part of the business. An order system must keep related details consistent as purchases move through checkout. A shopping cart must be retrieved when a particular shopper returns. A sales report may need to compare many months of purchases across products and regions. All three involve data, but they are not necessarily the same workload.
A workload is a unit of work that a system performs to meet a need. For this book, you can think of it as a combination of data, the operations performed on that data, and the requirements surrounding those operations. A workload might be “retrieve a shopper’s current cart,” “record an order and its line items,” or “analyze product sales over the past two years.”
The distinction matters because a service that fits one of those jobs well may be a less natural fit for another. You do not need to become a database administrator to recognize the difference. You need to notice the clues that describe the work.
This chapter introduces a practical framework for doing just that. We will use three AWS services as representative choices:
- Amazon RDS helps customers set up, operate, and scale relational databases in AWS.
- Amazon DynamoDB is a managed NoSQL database service that supports key-value and document data models.
- Amazon Redshift is a managed data warehouse service designed for analytics.
Those descriptions are starting points, not complete decision rules. As we explore each workload, keep one question in mind: What must happen to the data, and what makes that task difficult?
The word database can make different needs sound more alike than they are. Imagine three requests from the online shop.
The checkout team says, “When someone places an order, we need to record the customer, the products, the quantities, and the payment status. These details belong together.”
The application team says, “When a shopper opens the app, find that shopper’s current cart using its identifier. We expect traffic to rise sharply during promotions.”
The sales team says, “Show us how product categories performed over time, and compare results across regions.”
Each request involves storing and retrieving information. Yet the important features differ.
The checkout request emphasizes connected records and the need to keep related changes consistent. A relational database is a natural candidate, making Amazon RDS worth considering.
The cart request emphasizes a known lookup, using an identifier to retrieve the relevant item. DynamoDB is a natural candidate for that access pattern.
The sales request emphasizes analysis across historical data. Amazon Redshift is a natural candidate for that analytical workload.
These mappings describe likely workload fit, not mutually exclusive capabilities. Relational databases can perform key-based lookups; DynamoDB can represent related information and supports transactions. Operational databases can also run reports. A real shopping cart might have complicated relationships that lead a team toward a relational design, while a modest reporting need might be served by an existing database. Identify the strongest clue, then check whether the rest of the requirements support it.
You can make an initial comparison by asking four questions:
1. Relationships: How closely are the pieces of data connected?
2. Access patterns: How will the application find and use the data?
3. Transactions: Which changes need to succeed or fail together?
4. Analysis: Is the main task serving individual operations or discovering patterns across data?
These questions overlap. That is useful: a strong choice usually fits several clues rather than just one.
A customer can place many orders. Each order can contain several products. A payment may be associated with an order. These connections are part of the business, not just a matter of how a developer happens to store information.
A relational database organizes data in tables and provides ways to connect related records. For example, one table might hold customers, another orders, and another order items. An order can refer to the customer who placed it, while each order item refers to its order.
When a scenario repeatedly emphasizes connected entities, a relational approach deserves attention. Amazon RDS supports several relational database engines, giving customers managed options for relational workloads.
The useful question is whether the workload benefits from the relational model, especially when it combines relationships with flexible queries and transactional requirements.
An access pattern describes how data is requested or changed. “Look up a cart by cart ID” is an access pattern. So is “find all orders placed by a customer,” or “summarize sales by month.”
Specific access patterns are more useful than broad statements such as “the application needs a database.” Ask:
- Does the application usually retrieve one item using a known key?
- Does it need to combine or filter related records in several ways?
- Does it scan or aggregate substantial historical data to answer business questions?
DynamoDB is often a strong candidate when access patterns are well understood and the application needs to retrieve or update items using keys. A key is a value used to identify…