ArticleslgStudy

computer science

Amazon SimpleDB

Amazon SimpleDB is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Amazon SimpleDB rather than just read about it. In short: Amazon SimpleDB is a distributed database written in Erlang by Amazon.com. It is used as a web service in concert with Amazon Elastic Compute Cloud (EC2) and Amazon S3 and is part of Amazon Web Services.

Amazon SimpleDB — main illustration
Amazon SimpleDB — illustration

Key takeaways

  • Amazon SimpleDB belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Amazon SimpleDB to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Amazon SimpleDB from memory before moving on to harder problems.

Reference excerpt

Amazon SimpleDB is a distributed database written in Erlang by Amazon.com. It is used as a web service in concert with Amazon Elastic Compute Cloud (EC2) and Amazon S3 and is part of Amazon Web Services. It was announced on December 13, 2007. As with EC2 and S3, Amazon charges fees for SimpleDB storage, transfer, and throughput over the Internet. On December 1, 2008, Amazon introduced new pricing with Free Tier for 1 GB of data & 25 machine hours. Transfer to other Amazon Web Services is free of charge.

Limitations

SimpleDB provides eventual consistency, which is a weaker form of consistency, compared to other database management systems. This is often considered a limitation, because it is harder to reason about, which makes it harder to write correct programs that make use of SimpleDB. This limitation is the result of a fundamental design trade-off. By forgoing consistency, the system is able to achieve two other highly desirable properties:

availability – components of the system may fail, but the service will continue to operate correctly. partition tolerance – components in the system are connected by a computer network. If components are not able to contact one another using the network (a condition known as a network partition), the operation of the system will continue. Component failures are assumed to be inevitable; thus, both of these properties were deemed necessary in order to provide a reliable web service. The CAP theorem states that it is not possible for a system to exhibit these properties along with consistency; thus, the designers need to settle for a weaker form of consistency. Published limitations:

Store limitations

Query limitations

Features

Conditional Put and Delete Conditional put and conditional delete are new operations that were added in February 2010. They address a problem that arises when accessing SimpleDB concurrently. Consider a simple program that uses SimpleDB to store a counter, i.e. a number that can be incremented. The program must do three things:

Retrieve the current value of the counter from SimpleDB. Add one to the value. Store the new value in the same place as the old value in SimpleDB. If this program runs while no other programs access SimpleDB, it will work correctly; however, it is often desirable for software applications (particularly web applications) to access the same data concurrently. When the same data is accessed concurrently, a race condition arises, which would result in undetectable data loss. Continuing the previous example, consider two processes, A and B, running the same program. Suppose SimpleDB services requests for data, as described in step 1, from both A and B. A and B see the same value. Let's say that the current value of the counter is 0. Because of steps 2 and 3, A will try to store 1. B will try to do the same; thus, the final counter value will be 1, even though the expected final counter value is 2, because the system attempted two increment operations, one by A, and another by B. This problem can be solved by the use of conditional put. Suppose we change step 3 as follows: instead of unconditionally storing the new value, the program asks SimpleDB to store the new value only if the value that it currently holds is the same as the value that was retrieved in step 1. Then, we can be sure that the counter's value actually increases. This introduces some additional complexity; if SimpleDB is not able to store the new value because the current value was not as expected, the program must repeat steps 1–3 until the conditional put operation actually changes the stored value.

Consistent Read Consistent read was a new feature that was released at the same time as conditional put and conditional delete. As the name suggests, consistent read addresses problems that arise due to SimpleDB's eventual consistency model (See the Limitations section). Consider the following sequence of operations:

Program A stores some data in SimpleDB. Immediately after, A requests the data it just stored. SimpleDB's eventual consistency guarantee does not allow us to say that the data retrieved in step 2 reflects the updates that were made in step 1. Eventual consistency only guarantees that step 2 reflects the complete set of updates in step 1, or none of those updates. A consistent read can be used to ensure that the data retrieved in step 2 reflects changes in step 1. The reason that inconsistent results can arise when the consistent read operation is not used is that SimpleDB stores data in multiple locations (for availability), and the new data in step 1 might not be written at all locations when SimpleDB receives the data request in step 2. In that case, it is possible that the data request in step 2 is serviced at one of the locations where the new data has not been written. Amazon discourages the use of consistent read, unless it is required for correctness. The reason for this recommendation is that the rate at which consistent read operations are serviced is lower than for regular reads.

Relationship to DynamoDB

There has been some talk of SimpleDB being superseded by DynamoDB (it is no longer being "iterated on", though Amazon does not plan to remove it). DynamoDB appears to be its successor.

See also NoSQL

References

External links Amazon SimpleDB official home page

Illustrations

Amazon SimpleDB: SimpleDB Logo
SimpleDB Logo

Worked examples

Example 1 — a first encounter with Amazon SimpleDB

Start with the simplest possible case. Write down what Amazon SimpleDB claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Amazon SimpleDB before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Amazon SimpleDB ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Amazon SimpleDB

In research
Amazon SimpleDB appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Amazon SimpleDB in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Amazon SimpleDB is common in secondary-school and first-year university syllabi. It links to neighbouring topics Amazon Web Services, Cloud databases, Database-related software for Linux, so understanding it makes those chapters shorter.
In everyday life
Look for Amazon SimpleDB outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Amazon SimpleDB” →

How to study Amazon SimpleDB in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Amazon SimpleDB means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Amazon SimpleDB out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Amazon SimpleDB in simple terms?

Amazon SimpleDB is a distributed database written in Erlang by Amazon.com. It is used as a web service in concert with Amazon Elastic Compute Cloud (EC2) and Amazon S3 and is part of Amazon Web Services.

Why does Amazon SimpleDB matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Amazon SimpleDB?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Amazon SimpleDB.

Tags

  • Amazon Web Services
  • Cloud databases
  • Database-related software for Linux
  • Distributed data stores
  • Document-oriented databases

Keep exploring