Amazon SimpleDB Developer Guide

Amazon SimpleDB Developer Guide
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters


  • 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

Book Details

Language : English
Paperback : 252 pages [ 235mm x 191mm ]
Release Date : June 2010
ISBN : 1847197345
ISBN 13 : 9781847197344
Author(s) : Prabhakar Chaganti, Rich Helms
Topics and Technologies : All Books, Application Development, Cloud, Enterprise, Web Services

Table of Contents

Chapter 1: Getting to Know SimpleDB
Chapter 2: Getting Started with SimpleDB
Chapter 3: SimpleDB versus RDBMS
Chapter 4: The SimpleDB Data Model
Chapter 5: Data Types
Chapter 6: Querying
Chapter 7: Storing Data on S3
Chapter 8: Tuning and Usage Costs
Chapter 9: Caching
Chapter 10: Parallel Processing
  • Chapter 1: Getting to Know SimpleDB
    • Experimenting with SimpleDB
    • How does SimpleDB work?
      • Domain
      • Item
      • Attributes
      • Values
    • How do I interact with SimpleDB?
    • How is SimpleDB priced?
      • Free tier
    • Why should I use SimpleDB?
      • Make your applications simpler to architect
      • Build flexibility into your applications
      • Create high-performance web applications
      • Take advantage of lower costs
      • Scale your applications on demand
      • Architect for the cloud
    • Summary
  • Chapter 2: Getting Started with SimpleDB
    • Creating an AWS account
    • Enabling SimpleDB service for AWS account
    • Query API and authentication
    • SimpleDB libraries
    • SDBtool — Firefox plugin
    • Sample outline — performing basic operations
    • Basic operations with Java
      • Exploring SimpleDB with Java
      • Creating a domain with Java
      • Listing domains with Java
      • Manipulating items with Java
      • Deleting a domain with Java
    • Basic operations with PHP
      • Exploring SimpleDB with PHP
      • Creating a domain with PHP
      • Listing domains with PHP
      • Manipulating items with PHP
      • Deleting a domain with PHP
    • Basic operations with Python
      • Introducing boto
      • Exploring SimpleDB with Python
      • Creating a domain with Python
      • Retrieving a domain with Python
      • Creating items with Python
    • Summary
  • Chapter 3: SimpleDB versus RDBMS
    • No normalization
    • No joins
    • No schemas
    • Simpler SQL
    • Only strings
    • Eventual consistency
      • Flash: February 24, 2010 — consistent read added
    • Scalability
    • Low maintenance
    • Advantages of the SimpleDB model
    • Disadvantages of the SimpleDB model
    • Summary
  • Chapter 4: The SimpleDB Data Model
    • Domains
      • Domains with Java
      • Domains with PHP
      • Domains with Python
    • Exploring the metadata for a domain and costs
      • Retrieving domain metadata
        • Retrieving domain metadata with Java
        • Retrieving domain metadata with PHP
        • Retrieving domain metadata with Python
      • Components of a domain's metadata
      • SimpleDB domain constraints
    • Items
      • Adding attributes to an item with Java
      • Adding attributes to an item with PHP
      • Adding attributes to an item with Python
      • Constraints on SimpleDB items
    • Attributes
      • Attributes with Java
      • Attributes with PHP
      • Attributes with Python
      • Constraints on SimpleDB item attributes
    • Values
      • Storing multiple values in a single attribute with Java
      • Storing multiple values in a single attribute with PHP
      • Storing multiple values in a single attribute with Python
      • Constraints on values of a SimpleDB item
    • Consistent Read and Conditional Put / Delete announcement
      • ConsistentRead = true for getAttributes and Select
      • Conditional Put / Delete
    • Summary
  • Chapter 5: Data Types
    • What is lexicographical comparison?
    • Storing numeric values
      • Storing numeric values with Java
      • Storing numeric values with PHP
      • Storing numeric values with Python
    • Storing date values
      • Storing date values with Java
      • Storing date values with PHP
      • Storing date values with Python
    • Storing Boolean values
      • Storing Boolean values with Java
      • Storing Boolean values with PHP
      • Storing Boolean values with Python
    • XML-restricted characters
      • Using base64 values with Java
      • Using base64 values with PHP
      • Using base64 values with Python
    • Summary
  • Chapter 6: Querying
    • Sample data
      • Loading the sample data
        • Importing the sample data with Java
        • Importing the sample data with PHP
        • Importing the sample data with Python
      • Using Select
        • Simple select with Java
        • Simple select with PHP
        • Simple select with Python
      • Quoting values in Select expressions
      • Predicates in Select expressions
        • Simple predicate query with Java
        • Simple predicate query with PHP
        • Simple predicate query with Python
    • Comparison operators
    • Queries with Select
      • Comparison operators
      • Greater than
      • LIKE
      • NOT LIKE
      • BETWEEN
      • IN
      • IS NULL
      • IS NOT NULL
      • EVERY()
    • Combining expressions
      • NOT
      • OR
    • Sorting
    • Counting the results
      • COUNT()
    • Queries on multi-valued attributes
    • Querying for multi-valued attributes
      • getAttribute
        • getAttributes in Java
        • getAttributes in PHP
        • getAttributes in Python
    • Summary
  • Chapter 7: Storing Data on S3
    • Amazon S3
      • Buckets
      • Objects
      • Keys
    • Pricing for S3
    • Plan of action
      • Creating an S3 bucket
        • Creating an S3 bucket with Java
        • Creating an S3 bucket with PHP
        • Creating an S3 bucket with Python
      • Creating additional metadata
        • Creating additional metadata with Java
        • Creating additional metadata with PHP
        • Creating additional metadata with Python
      • Uploading the songs to S3
        • Uploading the songs to S3 with Java
        • Uploading the songs to S3 with PHP
        • Uploading the songs to S3 with Python
      • Retrieving the files from S3
        • Retrieving the files from S3 with Java
        • Retrieving the files from S3 with PHP
        • Retrieving the files from S3 with Python
    • Summary
  • Chapter 8: Tuning and Usage Costs
    • BoxUsage
      • Computing costs using BoxUsage
      • Usage reports
      • BoxUsage — Java
        • Cost of Select
      • BoxUsage — PHP
        • Cost of NextToken
        • Cost of Select
        • Cost of creating a domain
        • Cost of creating items
      • BoxUsage — Python
    • Partitioning
    • Summary
  • Chapter 9: Caching
    • Caching
    • Memcached
    • Memcached and security
    • Installing memcached
    • Installing memcached client
      • Memcached client in Java
      • Memcached client in PHP
      • Memcached client in Python
    • Storing and retrieving data from memcached
      • Storing and retrieving data from memcached in Java
      • Storing and retrieving data from memcached in PHP
      • Storing and retrieving data from memcached in Python
    • Cache_Lite
    • Logic flow for using caching with SimpleDB
      • Using memcached with SimpleDB in Java
      • Using Cache_Lite with SimpleDB in PHP
      • Using memcached with SimpleDB in Python
    • Summary
  • Chapter 10: Parallel Processing
    • BatchPutAttributes
      • BatchPutAttributes in Java
      • BatchPutAttributes in PHP
      • BatchPutAttributes in Python
    • Serialized SimpleDB requests
    • Parallelizing SimpleDB requests
      • Parallelizing SimpleDB requests in Java
      • Parallelizing SimpleDB requests in PHP
      • Parallelizing SimpleDB requests in Python
      • Simple threading
      • Threading with queues
      • Threading with workerpool
    • Concurrency and SimpleDB
    • Summary

Prabhakar Chaganti

Prabhakar Chaganti is the founder and CTO of Ylastic, a start-up that is building a single unified interface to architect, manage, and monitor a user's entire AWS Cloud computing environment: EC2, S3, RDS, AutoScaling, ELB, Cloudwatch, SQS, and SimpleDB. He is the author of Xen Virtualization and GWT Java AJAX Programming, and is also the winner of the community choice award for the most innovative virtual appliance in the VMware Global Virtual Appliance Challenge. He hangs out on Twitter as @pchaganti.

Read about his tips on time management...

Rich Helms

"It's never been done" is a call to action for Rich Helms. He has built a career on breaking new ground in the computer field. He developed CARES (Computer Assisted Recovery Enhancement System) for the Metropolitan Toronto Police in Canada. CARES was the first computer system in the world for aging missing children. CARES has been internationally recognized as pioneering work in child aging. Rich has also created several generations of e-Learning platforms including Learn it Script and most recently Educate Press.

Rich is a seasoned software developer with over 30 years of experience. He spent 22 years in various positions at IBM including Chief Image Technology Architect. His credentials range from deep technical work (five patents in hardware and software) to running multinational R&D.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Amazon SimpleDB Developer Guide +    Getting Started with Talend Open Studio for Data Integration =
50% Off
the second eBook
Price for both: $34.95

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book


  • 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

In Detail

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.

Gain in-depth understanding of Amazon SimpleDB with PHP, Java, and Python examples, and run optimized database-backed applications on Amazon's Web Services cloud


This book is a practical real-world tutorial covering everything you need to know about Amazon SimpleDB. You will come across examples in three languages: Java, PHP, and Python. This book is aimed at transforming you from a beginner to an advanced developer.

Who this book is 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.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software