Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Amazon SimpleDB Developer Guide
Amazon SimpleDB Developer Guide

Amazon SimpleDB Developer Guide: Scale your application's database on the cloud using Amazon SimpleDB

eBook
$22.99 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Amazon SimpleDB Developer Guide

Chapter 2. Getting Started with SimpleDB

In this chapter, we going to sign up for an AWS account, download and install the necessary libraries, and create little code snippets for exploring SimpleDB. We will introduce the libraries as well as the SimpleDB Firefox plugin for manipulating SimpleDB. We will also examine the two methods for accessing SimpleDB: SOAP and ReST. For PHP users we will introduce the PHP sample library. You can download and install the samples on your PHP5 server so that you can try the samples as you read about them.

Creating an AWS account


In order to start using SimpleDB, you will first need to sign up for an account with AWS.

Visit http://aws.amazon.com/ and click on Create an AWS Account.

You can sign up either by using your e-mail address for an existing Amazon account, or by creating a completely new account. You may wish to have multiple accounts to separate billing for projects. This could make it easier for you to track billing for separate accounts. After a successful signup, navigate to the main AWS page— http://aws.amazon.com/, and click on the Your Account link at any time to view your account information and make any changes to it if needed.

Enabling SimpleDB service for AWS account


Once you have successfully set up an AWS account, you must follow these steps to enable the SimpleDB service for your account:

  1. 1. Log in to your AWS account.

  2. 2. Navigate to the SimpleDB home page—http://aws.amazon.com/simpledb/.

  3. 3. Click on the Sign Up For Amazon SimpleDB button on the right side of the page.

  4. 4. Provide the requested credit card information and complete the signup process.

You have now successfully set up your AWS account and enabled it for SimpleDB.

All communication with SimpleDB or any of the Amazon web services must be through either the SOAP interface or the Query/ReST interface. The request messages sent through either of these interfaces is digitally signed by the sending user in order to ensure that the messages have not been tampered within transit, and that they really originate from the sending user. Requests that use the Query/ReST interface will use the access keys for signing the request, whereas requests to the SOAP interface...

Query API and authentication


There are two interfaces to SimpleDB. The SOAP interface uses the SOAP protocol for the messages, while the ReST Requests uses HTTP requests with request parameters to describe the various SimpleDB methods and operations. In this book, we will be focusing on using the ReST Requests for talking to SimpleDB, as it is a much simpler protocol and utilizes straightforward HTTP-based requests and responses for communication, and the requests are sent to SimpleDB using either a HTTP GET or POST method.

The ReST Requests need to be authenticated in order to establish that they are originating from a valid SimpleDB user, and also for accounting and billing purposes. This authentication is performed using your access key identifiers. Every request to SimpleDB must contain a request signature calculated by constructing a string based on the Query API and then calculating an RFC 2104-compliant HMAC-SHA1 hash, using the Secret Access Key.

The basic steps in the authentication...

SimpleDB libraries


There are libraries available for interacting with SimpleDB from a wide variety of languages. Most of these libraries provide support for all of the basic operations of SimpleDB. However, Amazon has been working hard to enhance and improve the functionality of SimpleDB, and as a result, they add new features frequently. You will want to leverage these new features as quickly as possible in your own applications. It is important that you select a library that has an active development cycle, so the new features are available fairly quickly after Amazon has released them. Another important consideration is the community around each library. An active community that uses the library ensures good quality and also provides a great way to get your questions answered. There are five libraries that meet all of these criteria:

  • Java Library for Amazon SimpleDB: This is the official Java library provided by Amazon. In our experience, this library is a bit too verbose and requires...

SDBtool — Firefox plugin


SDBtool is a Firefox plugin by Bizo Engineering for manipulating SimpleDB. As you go through the sample code, you can then view the results in the database. This is invaluable in both viewing results as well as updating or deleting data.

The program is a Firefox web browser (http://www.mozilla.com/firefox/) plugin. One of Firefox's key features is the ability to install plugins to expand the capabilities. Firefox is available for Microsoft Windows and Apple Mac OS X as well as Linux.

To install SDBtool, visit http://code.google.com/p/SDBtool/ with a Firefox browser. Then click on the Click here to install link. Firefox will ask for a confirmation to install the plugin.

To start SDBtool, click on Tools | SDB Tool in the top menu.

When SDBtool starts for the first time, it is necessary to configure your Access Keys. Click on the Config button and enter your Access Key and Secret Key. There is also a checkbox that sets if the tool can delete a domain. If you are working...

Sample outline — performing basic operations


In this book, each sample set will begin with a sample outline. The sample goals, as well as common SimpleDB principles, will be introduced. Then the sample will break into three streams: Java, PHP, and Python.

The purpose of this sample is to introduce code snippets to create, list, and delete domains as well as create, query, and delete items.

Note

Each domain is a container for storing items. Any item that does not have any attributes is considered empty and is automatically deleted by SimpleDB. You can therefore have empty domains stored in SimpleDB, but not items with zero attributes. Each value is stored as a UTF-8 string in SimpleDB. This is an important consideration, and you need to be aware of it when storing and querying different data types, such as numbers or dates. You must convert their data into an appropriate string format, so that your queries against the data return expected results. The conversion of data adds a little bit of...

Basic operations with Java


Java is a very popular language used for building enterprise applications. In this section we will download typica and then use it for exploring SimpleDB.

Exploring SimpleDB with Java

Download typica from the project site at Google Code— http://code.google.com/p/typica/.

The latest version of typica at the time of writing this is 1.6. Download the ZIP file from the website. Unzip to the folder of your choice and add the typica.jar to your classpath. You also need some third-party libraries used by typica and can download each of these dependencies and add the corresponding JAR files to your classpath:

We are going to learn about and explore SimpleDB...

Basic operations with PHP


PHP is a popular scripting language for writing web applications. Many of the most popular open source applications such as WordPress are written with PHP. There are several SimpleDB APIs available. The PHP samples are based on an API written by Dan Myers. This program is easy to understand, use, and expand. Rich Helms has expanded the API and provided samples for this book.

All of the sample code can be downloaded and run from your site, or executed from our site, with your Access Keys to your SimpleDB. Note that the user interface in these samples is very basic. The focus is on illustrating the SimpleDB interface.

Exploring SimpleDB with PHP

Rich Helms: "When I wrote my first SimpleDB PHP program, I struggled to find a working sample to build on. After a number of APIs, I found Dan Myers' SDB-PHP. The entire API was in one file and simple to understand. Working with Dan, I expanded the API to provide complete SimpleDB functionality including data normalization...

Basic operations with Python


Prabhakar Chaganti: "My personal preference is for the Python library—boto, which has a very nicely designed interface and a great community of users".

Python is an elegant, open source, object-oriented programming language that is great for rapid application development. Python is a stable, mature language that has been around for quite a long period of time, and is widely used across many of the industries and in a large variety of applications. It comes with an interactive console that can be used for quick evaluation of code snippets and makes experimentation with new APIs very easy. Python is a dynamically-typed language that gives you the power to program in a compact and concise manner. There is no such verbosity that is associated with a statically-typed language such as Java. It will be much easier to grasp the concepts of SimpleDB without drowning in a lot of lines of repetitive code. Most importantly, Python will bring fun back into your programming...

Summary


In this chapter, we set up an AWS account, enabled SimpleDB service for the account, and installed and set up libraries for Java, PHP, and Python. We explored several SimpleDB operations using these libraries. In the next chapter, we will examine the differences between SimpleDB and the relational database model in detail.

Left arrow icon Right arrow icon

Key benefits

  • Offload the time, effort, and capital associated with architecting and operating a simple, flexible, and scalable web database
  • A complete guide that covers everything from installation to advanced features aimed at optimizing your application
  • Examine SimpleDB and the relational database model and review the Simple DB data model
  • Packed with examples in Java, PHP, and Python and screenshots to illustrate key concepts allowing you to focus application development

Description

SimpleDB is a highly scalable, simple-to-use, and inexpensive database in the cloud from Amazon Web Services. But in order to use SimpleDB, you really have to change your mindset. This isn't a traditional relational database; in fact it's not relational at all. For developers who have experience working with relational databases, this may lead to misconceptions as to how SimpleDB works.This practical book aims to address your preconceptions on how SimpleDB will work for you. You will be quickly led through the differences between relational databases and SimpleDB, and the implications of using SimpleDB. Throughout this book, there is an emphasis on demonstrating key concepts with practical examples for Java, PHP, and Python developers.You will be introduced to this massively scalable schema-less key-value data store: what it is, how it works, and why it is such a game-changer. You will then explore the basic functionality offered by SimpleDB including querying, code samples, and a lot more. This book will help you deploy services outside the Amazon cloud and access them from any web host.You will see how SimpleDB gives you the freedom to focus on application development. As you work through this book you will be able to optimize the performance of your applications using parallel operations, caching with memcache, asynchronous operations, and more.

Who is this book for?

If you are a developer wanting to build scalable web-based database applications using SimpleDB, then this book is for you. You do not need to know anything about SimpleDB to read and learn from this book, and no basic knowledge is strictly necessary. This guide will help you to start from scratch and build advanced applications.

What you will learn

  • Explore several SimpleDB operations with the easy-to-use Boto library on Java, PHP, and Python consoles
  • Encode and decode various data types into string data using Lexicographical comparison with precise instructions
  • Query, sort, and count data using SELECT syntax
  • Store large binary objects in Amazon S3 while using SimpleDB as the metadata store
  • Tune SimpleDB queries using the box usage value
  • Avoid excessive SimpleDB requests by using a cache
  • Optimize your application s performance using parallel operations
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 01, 2010
Length: 252 pages
Edition : 1st
Language : English
ISBN-13 : 9781847197344
Vendor :
Amazon
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Jun 01, 2010
Length: 252 pages
Edition : 1st
Language : English
ISBN-13 : 9781847197344
Vendor :
Amazon
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 137.97
Mastering RabbitMQ
$60.99
FreeSWITCH Cookbook
$32.99
Amazon SimpleDB Developer Guide
$43.99
Total $ 137.97 Stars icon

Table of Contents

10 Chapters
Getting to Know SimpleDB Chevron down icon Chevron up icon
Getting Started with SimpleDB Chevron down icon Chevron up icon
SimpleDB versus RDBMS Chevron down icon Chevron up icon
The SimpleDB Data Model Chevron down icon Chevron up icon
Data Types Chevron down icon Chevron up icon
Querying Chevron down icon Chevron up icon
Storing Data on S3 Chevron down icon Chevron up icon
Tuning and Usage Costs Chevron down icon Chevron up icon
Caching Chevron down icon Chevron up icon
Parallel Processing Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(2 Ratings)
5 star 0%
4 star 50%
3 star 50%
2 star 0%
1 star 0%
Patric Ojala Feb 18, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The different scripting languages take up quite a bit of realestate, but I cannot think of much else negative to say about this. Great read for learning NoSQL basics, NoSQL vs SQL differences, how to use SimpleDB and what to use it for.
Amazon Verified review Amazon
Michael Bulla May 22, 2011
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Das Buch bietet einen guten allumfassenden Einblick in das Thema Amazon Webserverices. Es wird angesprochen wozu Cloud Computing überhaupt gut ist. Es werden die ersten Schritte aufgezeigt, um mit AWS durchstarten zu können. Es werden alle Dienst (Stand Ende 2010) erklärt. Insofern ein super Buch, für alle, die noch keine Schnittpunkte hatten und gucken wollen, was AWS überhaupt ist.Ich hatte mich vor dem Kauf des Buches schon intensiv mit der AWS-Homepage auseinander gesetzt. Daher gab es für mich nicht viel Neues. Ein weiterer Kritikpunkt ist, dass der Autor es mit dem Beispielcode zu gut macht. Da wird über Seiten hinweg PHP-Code abgedruckt, der imho keinen Mehrwert bietet. Ohne diesen könnte das Buch bestimmt 25% dünner sein.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela