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
zł141.99
Paperback
zł142.39 zł177.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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

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 : 9781847197351
Vendor :
Amazon
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 01, 2010
Length: 252 pages
Edition : 1st
Language : English
ISBN-13 : 9781847197351
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 zł20 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 zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 447.17 558.97 111.80 saved
Mastering RabbitMQ
zł197.59 zł246.99
FreeSWITCH Cookbook
zł107.19 zł133.99
Amazon SimpleDB Developer Guide
zł142.39 zł177.99
Total 447.17 558.97 111.80 saved 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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon