Mastering DynamoDB

Book description

Master the intricacies of the NoSQL database DynamoDB to take advantage of its fast performance and seamless scalability

In Detail

This book is a practical, example-oriented guide that begins with an introduction to DynamoDB, how it started, what it is, and its features. It then introduces you to DynamoDB's data model, demonstrating CRUD operations on the data model. Once you get an understanding of the data model, you will be able to dive deep into the DynamoDB architecture to understand its flexibility, scalability, and reliability.

The book also gives you plenty of best practices you should follow in order to achieve time and cost efficiency. Later, you will explore some advanced topics such as CloudWatch Monitoring, the AWS security token service, and the use of IAM to perform access control management.

The book discusses a variety of use cases that will help you get a practical sense of DynamoDB. Finally, the book ends with a discussion on using DynamoDB as a backend for Android/iOS mobile applications with sample code that will help you build your own applications.

What You Will Learn

  • Comprehend the DynamoDB data model and how to build the efficient schema of DynamoDB tables
  • Decipher the architecture of DynamoDB and its core features
  • Understand how DynamoDB manages ring membership and handles partial failures
  • Get acquainted with the AWS security token service and learn how DynamoDB deals with authentication and authorization
  • Integrate DynamoDB with other AWS services in order to form a complete application ecosystem on AWS Cloud
  • Explore third-party tools and libraries to efficiently use DynamoDB to help to autoscale, test, and back up/archive
  • Familiarize yourself with mobile application development using DynamoDB at the backend

Table of contents

  1. Mastering DynamoDB
    1. Table of Contents
    2. Mastering DynamoDB
    3. Credits
    4. Foreword
    5. About the Author
    6. Acknowledgments
    7. About the Reviewers
    8. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    9. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    10. 1. Getting Started
      1. DynamoDB's history
      2. What is DynamoDB?
      3. Data model concepts
        1. Operations
          1. Table operations
          2. Item operations
          3. The Query and Scan operations
        2. Provisioned throughput
        3. DynamoDB features
          1. Fully managed
          2. Durable
          3. Scalable
          4. Fast
          5. Simple administration
          6. Fault tolerance
          7. Flexible
          8. Indexing
          9. Secure
          10. Cost effective
      4. How do I get started?
        1. Creating a DynamoDB table using the AWS management console
        2. DynamoDB Local
      5. Summary
    11. 2. Data Models
      1. Primary key
        1. Hash primary key
        2. Hash and range primary key
      2. Secondary indexes
        1. Local secondary index
        2. Global secondary index
      3. Data types
        1. Scalar data types
          1. String
          2. Number
          3. Binary
        2. Multivalued data types
      4. Operations on tables
        1. Using the AWS SDK for Java
          1. Create table
          2. Update table
          3. Delete table
          4. List tables
        2. Using the AWS SDK for .NET
          1. Create table
          2. Update table
          3. Delete table
          4. List tables
        3. Using the AWS SDK for PHP
          1. Create table
          2. Update table
          3. Delete table
          4. List tables
      5. Operations on items
        1. Strong versus eventual consistency
          1. Eventual consistency
        2. Conditional writes
        3. Item size calculations
        4. Using the AWS SDK for Java
          1. Put item
          2. Get item
          3. Update item
          4. Delete item
          5. Batch get items
          6. Batch write items
        5. Using the AWS SDK for .NET
          1. Put item
          2. Get item
          3. Update item
          4. Delete item
          5. BatchGetItems
          6. BatchWriteItems
        6. Using the AWS SDK for PHP
          1. The putItem method
          2. The getItem method
          3. The updateItem method
          4. The deleteItem method
          5. The batchGetItem API
          6. The batchWriteItems API
      6. Query and scan operations
        1. Query versus scan
        2. Pagination
        3. Limit and counts
        4. Parallel scan
        5. Querying tables
          1. Using the AWS SDK for Java
          2. Using the AWS SDK for .NET
          3. PHP API
        6. Scanning tables
          1. Using the AWS SDK for Java
          2. Using the AWS SDK for .NET
          3. Using the AWS SDK for PHP
      7. Modeling relationships
        1. One to one
        2. One to many
        3. Many to many
      8. Summary
    12. 3. How DynamoDB Works
      1. Service-oriented architecture
      2. Design features
        1. Data replication
        2. Conflict resolution
        3. Scalability
        4. Symmetry
        5. Flexibility
      3. Architecture
        1. Load balancing
        2. Data replication
        3. Data versioning and reconciliation
          1. Logic-based reconciliation
          2. Time-based reconciliation
        4. Request handling
        5. Handling failures
        6. Ring membership
        7. Seed nodes
      4. Functional components
        1. Request coordinator
        2. Membership failure and detection
        3. Local persistence store
      5. Summary
    13. 4. Best Practices
      1. Table level best practices
        1. Choosing a primary key
        2. Evenly distributed data upload
        3. Managing time series data
      2. Item best practices
        1. Caching
        2. Storing large attribute values
          1. Using compressions
          2. Using AWS S3
          3. Using multiple chunks
            1. Blog table
            2. Body chunks table
        3. Implementing one-to-many relationship
          1. Inefficient approach
          2. Better and efficient approach
      3. Query and scan best practices
        1. Maintaining even read activity
        2. Using parallel scans
      4. Local secondary indexes best practices
      5. Global secondary index best practices
      6. Summary
    14. 5. Advanced Topics
      1. Monitoring DynamoDB tables
        1. AWS Management Console
        2. CloudWatch API
        3. A command-line interface
      2. Using IAM to provide access control to DynamoDB
        1. How to use IAM for DynamoDB
        2. Sample IAM policies
          1. Providing read-only access to items from all DynamoDB tables
          2. Restrict users from deleting all the tables and items from a table
          3. Allowing you to place and update an item on a single table
          4. Allowing access to all indexes of a particular table
          5. Allowing all DynamoDB actions to all the tables
        3. Fine-grained access control
        4. Sample fine-grained access control policies
          1. Restricting access to only specific hash value
          2. Restricting access to only specific attributes of a table
          3. Allowing a query on only specific projected attributes in index
        5. Web identity federation
      3. Limitations in DynamoDB
      4. Error handling
        1. Type of errors
        2. Catching error information
        3. Auto retries and exponential back-offs
      5. Summary
    15. 6. Integrating DynamoDB with Other AWS Components
      1. Integrating with AWS EMR
        1. Exporting data from DynamoDB
        2. Export data to AWS S3
          1. Formatted data export
          2. Compressed data export
        3. Export data to EMR – HDFS
        4. Querying DynamoDB data
          1. Getting the total count of employees in Employee table
          2. Getting the total count of employees department wise
          3. Joining two DynamoDB tables
          4. Joining tables from DynamoDB and S3
        5. Importing data into DynamoDB
          1. Importing data from AWS S3
          2. Importing data from HDFS
        6. Performance considerations while using EMR with DynamoDB
      2. Integrating with AWS Redshift
        1. Exporting data from DynamoDB
          1. Automatic compression and sampling
      3. Integrating with AWS CloudSearch
        1. Configuring CloudSearch domain
          1. Using AWS management console
          2. Using command-line tools
        2. Export data from DynamoDB to CloudSearch
          1. Using AWS management console
          2. Using command line tools
      4. Summary
    16. 7. DynamoDB – Use Cases
      1. Bookstore application
        1. Technology stack
        2. Architecture
        3. DynamoDB data model
        4. Implementation
        5. Integration with other AWS components
        6. Deployment
      2. Knowledge market website
        1. Technology stack
        2. Architecture
        3. DynamoDB data model
        4. Implementation
        5. Integration with other AWS components
        6. Deployment
      3. Summary
    17. 8. Useful Libraries and Tools
      1. Libraries
        1. Transaction library
          1. Atomic writes
          2. Isolated reads
        2. Geo library
          1. Query rectangle
          2. Query radius
        3. Language-specific libraries
          1. Java
            1. Jsoda
            2. Phoebe
            3. Jcabi
          2. .NET
          3. Node.js
          4. Perl
            1. Net::Amazon::DynamoDB
          5. Ruby
            1. Fog
            2. mince_dynamodb
            3. dynamoid
          6. Others
      2. Tools
        1. Tools for testing
          1. DynamoDB Local
          2. Fake DynamoDB
          3. Injecting failures
        2. Tools for auto-scaling
          1. Dynamic DynamoDB
        3. Tools for backup and archival
          1. DynamoDB Table Archiver
      3. Summary
    18. 9. Developing Mobile Apps Using DynamoDB
      1. Authentication and Authorization
        1. Using Web Identity Federation
        2. Creating your own custom authentication
      2. Performing operations using mobile SDKs
        1. Writing data to DynamoDB
          1. Android
          2. iOS
        2. Getting consumed capacity information
          1. Android
          2. iOS
        3. Conditional writes
          1. Android
          2. iOS
        4. Deleting an item
          1. Android
          2. iOS
        5. Fetching data
          1. Android
          2. iOS
        6. Querying data
          1. Android
          2. iOS
        7. Consistent reads
          1. Android
        8. Using local secondary indexes
          1. Android
          2. iOS
      3. Summary
    19. Index

Product information

  • Title: Mastering DynamoDB
  • Author(s): Tanmay Deshpande
  • Release date: August 2014
  • Publisher(s): Packt Publishing
  • ISBN: 9781783551958