The Artima Developer Community
Sponsored Link

Java Community News
Amazon to Offer Database as a Web Service

5 replies on 1 page. Most recent reply: Dec 19, 2007 6:22 AM by Gregg Irwin

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Amazon to Offer Database as a Web Service Posted: Dec 14, 2007 5:24 PM
Reply to this message Reply
Summary
Amazon.com announced today a new developer-focused Web service, SimpleDB, providing database-like functionality over the company's high-availability compute cloud.
Advertisement

Amazon.com has been steadily releasing developer-focused Web services for the past year: The company's S3 data storage service is a popular choice for Web applications requiring large file storage, such as photos, and the Elastic Compute Cloud (EC2) service has become available as a public beta. Most recently, Amazon.com announced the soon-to-be-available SimpleDB database-as-a-Web service product.

SimpleDB will allow developers to store persistent data in an on-demand database via simple Web service calls, such as CREATE, PUT, DELETE, and GET. SimpleDB is designed for storing structured data defined as a series of attribute names and values, similar to a spreadsheet or a database relation. The property values are automatically indexed by SimpleDB, and the service provides a simple query language to retrieve sets of items matching a combination of property values.

In announcing SimpleDB, Amazon compared the service to a more traditional relational database:

Traditionally, this type of functionality has been accomplished with a clustered relational database that requires a sizable upfront investment, brings more complexity than is typically needed, and often requires a DBA to maintain and administer. In contrast, Amazon SimpleDB is easy to use and provides the core functionality of a database - real-time lookup and simple querying of structured data - without the operational complexity. Amazon SimpleDB requires no schema, automatically indexes your data and provides a simple API for storage and access...

You organize your structured data into domains and can run queries across all of the data stored in a particular domain. Domains are comprised of items, and items are described by attribute-value pairs. To understand these elements, consider the metaphor of data stored in a spreadsheet table... An Amazon SimpleDB domain is like a worksheet, items are like rows of data, attributes are like column headers, and values are the data entered in each of the cells.

SimpleDB offers a query language with a syntax similar to simple SQL operators:

QUERY your data set using this simple set of operators: =, !=, <, > <=, >=, STARTS-WITH, AND, OR, NOT, INTERSECTION AND UNION. Query execution time is currently limited to 5 seconds. Amazon SimpleDB is designed for real-time applications and is optimized for those use cases.

SimpleDB differs from relationship databases in many aspects. One of them is the lack of pre-defined schema. As new properties are added to items, those properties will be indexed as well:

Amazon SimpleDB removes the need to maintain a schema, while your attributes are automatically indexed to provide fast real-time lookup and querying capabilities. This flexibility minimizes the performance tuning required as the demands for your data increase.

What do you think of Amazon's SimpleDB service?


Max Lybbert

Posts: 314
Nickname: mlybbert
Registered: Apr, 2005

Sounds like Berkely DB Posted: Dec 15, 2007 10:27 PM
Reply to this message Reply
Given a choice, I would probably use Berkeley DB or Samba's TDB (which has an API for multiple simultaneous writers). So long as you can run PHP or CGI scripts (Perl, Python) on the server, Berkeley DB should be available. If you're unable to do that, then Amazon's new service may be for you.

Steven E. Newton

Posts: 137
Nickname: cm
Registered: Apr, 2003

Re: Sounds like Berkely DB Posted: Dec 16, 2007 2:08 PM
Reply to this message Reply
It's really more like an associative memory or tuple space implementation.

Gregg Irwin

Posts: 16
Nickname: greggirwin
Registered: Jan, 2004

Re: Sounds like Berkely DB Posted: Dec 18, 2007 10:37 AM
Reply to this message Reply
I don't see how it's like a TupleSpace. It's just a searchable hash, isn't it?

Steven E. Newton

Posts: 137
Nickname: cm
Registered: Apr, 2003

Re: Sounds like Berkely DB Posted: Dec 18, 2007 5:29 PM
Reply to this message Reply
In a berkeley DB style hash you can only retrieve by the keys. Amazon's SimpleDB lets you store structured data and search by any attribute.

Simply put, DBD is a hashtable, you store and retrieve by key only. The value can be structured, of course, but the software accessing it has to know what that structure looks like, and every record must have the same structure. Usually the keys must be unique, although there are implementations that allowed duplicate keys, if the application is able to handle them.

By contrast, SimpleDB stores a collection of 1..N key-value pairs in a record, and allows you to search for any of the values by any key.

Here's an example from Amazon's documentation:


PUT (item, 123), (description, sweater), (color, blue), (color, red)
PUT (item, 456), (description, dress shirt), (color, white), (color, blue)
PUT (item, 789), (description, shoes), (color, black), (material, leather)

"Amazon SimpleDB automatically indexes all of your data, enabling you to easily query for an item based on attributes and their values. In the above example, you could submit a query for items where (color = blue AND description = dress shirt), and Amazon SimpleDB would quickly return item 456 as the result."

Notice that each record can have a different structure. The only way BDB could store that data would be to pick one value as the key, say the item #, and populate the values with the rest of the pairs, and you'd still never be able to search on the data in the values, except by iterating over the entire hash and checking each record.

So, yes, this is VERY different from a BDB dictionary/hashtable, and much closer to a TupleSpace.

If you were sufficiently clever you could use Amazon's compute cloud to implement the eval() function and SimpleDB together for in() and out(), storing say Java bytecode as one of the items in the tuple. But the main difference is that Amazon's SimpleDB lets you do things like the classic Linda example:


out ('testdata', i, 3, 4+6)

in ('testdata', ?cnt, ?var, 10)


with something like


PUT (string, 'testdata'), (cnt, i), (var, 3), (sum, 4+6)


(Assume for the sake of argument that the actual code to implent this would know what i and 4+6 are)

and a query for (string = 'testdata' AND sum = 10)

Gregg Irwin

Posts: 16
Nickname: greggirwin
Registered: Jan, 2004

Re: Sounds like Berkely DB Posted: Dec 19, 2007 6:22 AM
Reply to this message Reply
I see what you mean now, but I still think it's more akin to a searchable hash--not necessarily BDB--than a tuplespace model.

* Records have IDs, tuples don't

* "columns" are named (you could argue that named columns are values and formals are just things you don't query on, but that's really stretching the definition IMO)

* no concept of IN (you have to do a GET+DELETE, correct?)

* no concept of querying for a tuple and blocking until it appears

Now, if Amazon comes out with SimpleTupleSpace...

Flat View: This topic has 5 replies on 1 page
Topic: JetBrains Releases Groovy, Ruby Plug-ins for IntelliJ Previous Topic   Next Topic Topic: Extension Methods for Java Proposal

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use