AWS DynamoDB Throughput Capacity

  • AWS DynamoDB throughput capacity depends on the read/write chapters modes for processing reads and writes on the tables.
  • DynamoDB supports ii types of read/write chapters modes:
    • On-demand
    • Provisioned

Annotation – Provisioned mode is covered in the AWS Certified Developer – Acquaintance exam (DVA-C01) esp. the calculations. On-demand capacity fashion is latest enhancement and does non notwithstanding feature in the exams.

Provisioned Mode

  • Provisioned mode requires you to specify the number of reads and writes per second equally required by the application
  • Provisioned throughput is the maximum corporeality of capacity that an application tin consume from a tabular array or index
  • If the provisioned throughput capacity on a tabular array or alphabetize is exceeded, it is subject field to request throttling
  • Provisioned style is a adept for applications
    • anticipated awarding traffic
    • consequent traffic
    • power to forecast capacity requirements to command costs
  • Provisioned mode provides the post-obit capacity units
    • Read Capacity Units (RCU)
      • Total number of read capacity units required depends on the item size, and the consistent read model (eventually or strongly)
      • i RCU represents
        • two eventually consistent reads per 2d, for an particular up to 4 KB in size i.e. eight KB
        • ane strongly consistent read per 2nd for an detail up to 4 KB in size i.e. 2x cost of eventually consistent reads
        • Transactional read requests require 2 read capacity units to perform one read per 2d for items up to four KB. i.eastward. 2x cost of strongly consistent reads
      • DynamoDB must consume additional read chapters units for items greater than 4 KBfor e.yard. for an 8 KB particular size, 2 read capacity units to sustain i strongly consistent read per 2nd, i read chapters unit if yous choose eventually consistent reads, or four read chapters units for a transactional read request would be required
      • Item size is rounded off to 4 KB equivalents for east.g. a vi KB or a 8 KB item in size would require the same RCU
    • Write Chapters Units (WCU)
      • Total number of write chapters units required depends on the item size but
      • one write per 2nd for an item upwardly to 1 KB in size
      • Transactional write requests require 2 write chapters units to perform one write per second for items upwardly to 1 KB. i.east. 2x cost of full general write.
      • DynamoDB must consume boosted read chapters units for items greater than 1 KBfor an 2 KB item size,  2 write capacity units would be required to sustain one write asking per 2nd or 4 write capacity units for a transactional write request
      • Item size is rounded off to 1 KB equivalentsfor e.g. a 0.5 KB or a 1 KB particular would need the aforementioned WCU

Provisioned Style Examples

  • DynamoDB tabular array with provisioned capacity of ten RCUs and ten WCUs can back up
    • Read throughput
      • Eventual consistency = 4KB * 10 * 2 = 80KB/sec
      • Stiff consistency = 4KB * 10 = 40KB/sec
      • Transactional consistency = 4KB * 10 * 1/2 = 20KB/sec
    • Write throughput
      • Eventual and Strong consistency = x * 1KB = 10KB/sec
      • Transaction consistency = 10 * 1KB * 1/2 = 5KB/sec
  • Capacity units required for reading and writing 15KB item
    • Read capacity units – 15KB rounded to 4 blocks of 4KB = four RCUs
      • Eventual consistency 4 RCUs * 1/2 = 2 RCUs
      • Strong consistency 4 RCUs * 1 = 4 RCUs
      • Transactional consistency 4 RCUs * 2 = eight RCUs
    • Write capacity units 15KB = xv WCUs
      • Eventual and Strong consistency fifteen WCUs * ane = 15 WCUs
      • Transactional consistency fifteen WCUs * 2 = 30 RCUs

On-demand Mode

  • On-demand way provides flexible billing option capable of serving thousands of requests per second without capacity planning
  • There is no need to specify the expected read and write throughput
  • Charged for only the reads and writes that the application performs on the tables in terms of read request units and write request units.
  • Offers pay-per-request pricing for read and write requests and so that you lot pay only for what you use
  • DynamoDB adapts speedily to conform the changing load
  • DynamoDB on-demand using Asking units which are similar to provisioned capacity Units
  • On-demand mode does not support reserved capacity

DynamoDB Burst Chapters

  • DynamoDB provides some flexibility in the per-partition throughput provisioning past providing flare-up chapters.
  • If segmentation'due south throughput is not fully used, DynamoDB reserves a portion of that unused capacity for subsequently bursts of throughput to handle usage spikes
  • DynamoDB currently retains up to v minutes (300 seconds) of unused read and write capacity.
  • During an occasional burst of read or write action, these extra chapters units can exist consumed speedily—even faster than the per-second provisioned throughput capacity that you've defined for your table.
  • DynamoDB can also consume burst chapters for background maintenance and other tasks without prior detect.

DynamoDB Adaptive Chapters

  • Adaptive chapters is a characteristic that enables DynamoDB to run imbalanced workloads indefinitely.
  • DynamoDB distributes the data across partitions and the throughput capacity is distributed equally across these partitions
  • Notwithstanding, when data access is imbalanced, a "hot" partition can receive a higher volume of read and write traffic compared to other partitions leading to throttling errors on that partition.
  • DynamoDB adaptive capacity enables the application to keep reading and writing to hot partitions without beingness throttled, provided that traffic does not exceed the table's total provisioned capacity or the sectionalization maximum chapters.
  • It minimizes throttling due to throughput exceptions.
  • It also helps reduce costs past enabling provisioning of simply the needed throughput chapters.
  • Adaptive chapters is enabled automatically for every DynamoDB tabular array, at no additional cost.

DynamoDB Throttling

  • Each partition on a DynamoDB tabular array is subject to a hard limit of 1,000 write chapters units and 3,000 read capacity units.
  • If the workload is unevenly distributed beyond partitions, or if the workload relies on short periods of time with loftier usage (a burst of read or write activity), the table might exist throttled.
    • Distribute read and write operations equally evenly as possible across your tabular array. A hot partition tin degrade the overall performance of your table.
    • Implement a caching solution. If the workload is mostly read admission to static data, then query results can be delivered much faster if the data is in a well‑designed cache rather than in a database. DynamoDB Accelerator (DAX) is a caching service that offers fast in‑memory performance for your application. ElastiCache can exist used as well.
    • Implement error retries and exponential backoff. Exponential backoff can better an application's reliability by using progressively longer waits between retries. If using an AWS SDK, this logic is congenital‑in.

AWS Certification Examination Practice Questions

  • Questions are collected from Internet and the answers are marked as per my knowledge and agreement (which might differ with yours).
  • AWS services are updated everyday and both the answers and questions might exist outdated soon, and so research appropriately.
  • AWS exam questions are not updated to continue up the pace with AWS updates, then even if the underlying feature has inverse the question might not exist updated
  • Open to further feedback, discussion and correction.
  1. You need to migrate 10 million records in i 60 minutes into DynamoDB. All records are 1.5KB in size. The data is evenly distributed beyond the segmentation key. How many write chapters units should y'all provision during this batch load?
    1. 6667
    2. 4166
    3. 5556 ( 2 write units (one for each 1KB) * 10 million/3600 secs)
    4. 2778
  2. A meteorological arrangement monitors 600 temperature gauges, obtaining temperature samples every minute and saving each sample to a DynamoDB tabular array. Each sample involves writing 1K of data and the writes are evenly distributed over time. How much write throughput is required for the target table?
    1. 1 write capacity unit
    2. 10 write capacity units ( ane write unit for 1K * 600 gauges/threescore secs)
    3. 60 write capacity units
    4. 600 write capacity units
    5. 3600 write capacity units
  3. A visitor is building a system to collect sensor data from its 36000 trucks, which is stored in DynamoDB. The trucks emit 1KB of data once every hour. How much write throughput is required for the target table. Choose an reply from the options beneath
    1. 10
    2. threescore
    3. 600
    4. 150
  4. A company is using DynamoDB to design storage for their IOT project to shop sensor data. Which combination would requite the highest throughput?
    1. 5 Eventual Consequent reads capacity with Item Size of 4KB (40KB/s)
    2. fifteen Eventual Consistent reads chapters with Item Size of 1KB (30KB/south)
    3. v Strongly Consistent reads capacity with Particular Size of 4KB (20KB/due south)
    4. 15 Strongly Consistent reads capacity with Particular Size of 1KB (15KB/s)
  5. If your table item's size is 3KB and you want to have xc strongly consistent reads per second, how many read capacity units will you need to provision on the table? Choose the correct answer from the options below
    1. ninety
    2. 45
    3. 10
    4. xix

References

  • DynamoDB_Developer_Guide