DynamoDB NoSQL key value and document database

  1. AWS DynamoDB is a NoSQL database providing single digit millisecond latency
  2. Fully managed by AWS, highly redundant and available and scalable
  3. Supports document and key value storage
  4. Runs across 3 different geographically separate locations so its highly redundant
  5. Supports
    1. Eventually Consistent Reads
      1. It may take 1 second before the reads return what has been written, but it will be eventually (after 1 sec) consistent
      2. Best price performance
    2. Strongly consistent reads
      1. Read returns all writes that received a “successful write” response before the read is sent
      2. If you need all your reads to be consistent with all writes (even that happened less than a second before) you will choose this model
  6. Pricing is based reads/writes/storage only. Not by CPU usage or data transfer
    1. Read throughput  0.000xxx $ per hour for every 10 units
    2. Write throughput  0.000xxx $ per hour for every 40 units
    3. Writes are 5X expensive than reads
    4. Storage Cost 0.25$ per Gb/month
    5. at the time of creating table choose
      1. Provisioned Read/Write capacity units
      2. Reserved Read/Write capacity units with 1 or 3 year contracts help you reduce costs
  7. Push button scaling
    1. By simply changing RCU/WCU inside the console on a table’s capacity tab
    2. Not possible in RDS since scaling involves some downtime in RDS
  8. Optimizing DynamoDB queries:
    1. Scan operations are less efficient than other operations in DynamoDB. A Scan operation always scans the entire table or secondary index, then filters out values to provide the desired result, essentially adding the extra step of removing data from the result set.
    2. Avoid using a Scan operation on a large table or index with a filter that removes many results, if possible.
    3. Also, as a table or index grows, the Scan operation slows. For faster response times, design your tables and indexes so that your applications can use query instead of Scan .
    4. For tables, you can also consider using the GetItem and BatchGetItem APIs.
    5. Avoid sudden spikes in read capacity:Note that it is not just the sudden increase in capacity units the scan uses that is a problem. It is also because the scan is likely to consume all of its capacity units from the same partition because the scan requests read items that are next to each other on the partition. If the request to read data had been spread across multiple partitions, then the operation would not have throttled a specific partition.
    6. Because a Scan operation reads an entire page (by default, 1 MB), you can reduce the impact of the scan operation by setting a smaller page size. The Scanoperation provides a Limit parameter that you can use to set the page size for your request. Each Query or Scan request that has a smaller page size uses fewer read operations and creates a “pause” between each request.
    7. Isolate Scan Operations. DynamoDB is designed for easy scalability. As a result, an application can create tables for distinct purposes, possibly even duplicating content across several tables. You want to perform scans on a table that is not taking “mission-critical” traffic. Some applications handle this load by rotating traffic hourly between two tables – one for critical traffic, and one for bookkeeping. Other applications can do this by performing every write on two tables: a “mission-critical” table, and a “shadow” table.
    8. AWS SDK implements exponential backoff algorithm for better flow control. The concept behind exponential backoff is to use progressively longer waits between retries for consecutive error responses. For example, up to 50 milliseconds before the first retry, up to 100 milliseconds before the second, up to 200 milliseconds before third, and so on. However, after a minute, if the request has not succeeded, the problem might be the request size exceeding your provisioned throughput, and not the request rate. Set the maximum number of retries to stop around one minute. If the request is not successful, investigate your provisioned throughput options.
<<< Elastic Container ServiceRedshift >>>
Copyright 2005-2016 KnowledgeHills. Privacy Policy. Contact .