layout: true class: middle, inverse --- class: center # .orange[DynamoDB Pricing Models] ### Jamie Kelly ??? - BJSS PE --- class: center # Overview #### What DynamoDB Is #### DynamoDB Pricing #### Examples #### Questions --- .navi[#### Overview #### .orange[What DynamoDB Is] #### DynamoDB Pricing #### Examples #### Questions ] .content[ ] .content[ ] .content[ .center[What DynamoDB Is] --- ] --- .navi[#### Overview #### .orange[What DynamoDB Is] #### DynamoDB Pricing #### Examples #### Questions ] .content[ .center[Key-Value and Document Database] ] -- .content[ .center[AWS Managed Service] ] -- .content[ .center[Automatically Scales] ] -- .content[ .center[Can be relatively cheap] ] -- .content[ .center[Fast (<10ms)] ] --- .navi[#### Overview #### .orange[What DynamoDB Is] #### DynamoDB Pricing #### Examples #### Questions ] .content[ ] .content[ Items in DynamoDB look like this: ``` { "Author": "John Grisham", "Title": "The Rainmaker", "Formats": { "Hardcover": "J4SUKVGU", "Paperback": "D7YF4FCX" }, "Category": "Suspense" } ``` ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] #### Examples #### Questions ] .content[ ] .content[ ] .content[ .center[DynamoDB Pricing] --- ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] #### Examples #### Questions ] .content[ There are two pricing structures: ] -- .content[ - Provisioned Capacity ] -- .content[ - On-Demand ] -- .content[ ] .content[ .center[The right pricing structure will depend on your workload] ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### .orange[Provisioned] ##### On-Demand #### Examples #### Questions ] .content[ ] .content[ ] .content[ .center[Provisioned Capacity] --- ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### .orange[Provisioned] ##### On-Demand #### Examples #### Questions ] .content[ ] .content[ --- .center[Provisioned Capacity is a reservation of throughput measured in Write Capacity Units (WCUs) and Read Capacity Units (RCUs)] --- ] -- .content[ ] .content[ --- .center[Capacity Units determine the number and size of requests that you can make on the table per second before the service will throttle] --- ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### .orange[Provisioned] ##### On-Demand #### Examples #### Questions ] .content[ .center[1 WCU = 1 Write Request up to 1KB in size per Second] --- ] -- .content[ ] .content[ Examples: .center[5 writes of 1KB per second = 5 WCUs] ] -- .content[ .center[5 writes of 2KB per second = 10 WCUs] ] -- .content[ .center[1 write of 5KB per second = 5 WCUs] ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### .orange[Provisioned] ##### On-Demand #### Examples #### Questions ] .content[ ] .content[ .center[0.5 RCU = 1 Read Request up to 4KB in size per Second (Eventually Consistent)] ] -- .content[ .center[OR] .center[1 RCU = 1 Read Request up to 4KB in size per Second (Strongly Consistent)] ] -- .content[ .center[OR] .center[2 RCUs = 1 Read Request up to 4KB in size per Second (Transactional)] ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### .orange[Provisioned] ##### On-Demand #### Examples #### Questions ] .content[ ] .content[ Examples: .center[6 reads of 4KB per second = 3 RCUs] ] -- .content[ .center[6 reads of 1KB per second = 3 RCUs] ] -- .content[ .center[6 reads of 5KB per second = 6 RCUs] ] -- .content[ .center[2 strongly consistent reads of 8KB per second = 4 RCUs] ] -- .content[ .center[1 transactional read of 5KB per second = 4 RCUs] ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### Provisioned ##### .orange[On-Demand] #### Examples #### Questions ] .content[ ] .content[ ] .content[ .center[On-Demand] --- ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### Provisioned ##### .orange[On-Demand] #### Examples #### Questions ] .content[ ] .content[ --- .center[On-Demand is a pay per request model measured in Write Request Units (WRUs) and Read Request Units (RRUs)] --- ] -- .content[ ] .content[ --- .center[There is no capacity to set, DynamoDB will scale to whatever capacity you need as requests ramp up - the starting capacity is 2,000 WRUs and 6000 RRUs (though it can handle double this immediately)] --- ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### Provisioned ##### .orange[On-Demand] #### Examples #### Questions ] .content[ .center[1 WRU = 1 Write Request up to 1KB in size] --- ] -- .content[ .center[0.5 RRU = 1 Read Request up to 4KB in size (Eventually Consistent)] ] -- .content[ .center[OR] .center[1 RRU = 1 Read Request up to 4KB in size (Strongly Consistent)] ] -- .content[ .center[OR] .center[2 RRUs = 1 Read Request up to 4KB in size (Transactional)] ] --- .navi[#### Overview #### What DynamoDB Is #### .orange[DynamoDB Pricing] ##### Provisioned ##### .orange[On-Demand] #### Examples #### Questions ] .content[ ] .content[ Examples: .center[6 reads of 4KB = 3 RRUs] ] -- .content[ .center[6 reads of 1KB = 3 RRUs] ] -- .content[ .center[6 reads of 5KB = 6 RRUs] ] -- .content[ .center[2 strongly consistent reads of 8KB = 4 RRUs] ] -- .content[ .center[1 transactional read of 5KB = 4 RRUs] ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] #### Questions ] .content[ ] .content[ ] .content[ .center[Examples] --- ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] ##### .orange[Consistent Load] ##### Daily Spike #### Questions ] .content[#### Consistent Load <1KB items ~100 writes per second and ~8000 eventually consistent reads per second throughout the month ] -- .content[ Provisioned Writes: 400 WCUs for load + headroom = 440 WCUs Provisioned Reads: 4000 RCUs for load + headroom = 4400 RCUs ] -- .content[ On-Demand Writes: 262,800,000 WRUs On-Demand Reads: 10,512,000,000 RRUs ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] ##### .orange[Consistent Load] ##### Daily Spike #### Questions ] .content[ #### Provisioned Pricing (eu-west-1) $0.000735 per WCU per hour. Monthly Cost = $236.08 $0.000147 per RCU per hour. Monthly cost = $472.16 Total Monthly Cost = $708.25 ] -- .content[ #### On-Demand Pricing (eu-west-1) $1.4135 per million WRUs. Monthly Cost = $371.47 $0.283 RRUs. Monthly cost = $2,974.90 Total Monthly Cost = $3,346.37 ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] ##### Consistent Load ##### .orange[Daily Spike] #### Questions ] .content[#### Daily Spike <1KB items ~100 writes per second and ~8000 eventually consistent reads per second for 1 hour per day, 1 write and 80 reads per second for the rest of the day ] -- .content[ Provisioned Writes: 400 WCUs for peak load + headroom = 440 WCUs Provisioned Reads: 4000 RCUs for peak load + headroom = 4400 RCUs ] -- .content[ On-Demand Writes: 13,468,500 WRUs On-Demand Reads: 639,480,000 RRUs ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] ##### Consistent Load ##### .orange[Daily Spike] #### Questions ] .content[ #### Provisioned Pricing (eu-west-1) $0.000735 per WCU per hour. Monthly Cost = $236.08 $0.000147 per RCU per hour. Monthly cost = $472.16 Total Monthly Cost = $708.25 ] -- .content[ #### On-Demand Pricing (eu-west-1) $1.4135 per million WRUs. Monthly Cost = $19.04 $0.283 RCUs. Monthly cost = $180.97 Total Monthly Cost = $200.01 ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] #### Questions ] .content[ .center[- Use Provisioned for predictable workloads without large spikes] ] -- .content[ .center[- Use On-Demand for spiky, unpredicatable, or low-volume workloads. A majority of workloads I see fall under this pattern] ] -- .content[ .center[- Do the maths. 1 WCU/RCU ~= 379,000 WRU/RRU] ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### .orange[Examples] #### Questions ] .content[ .center[ ![Example Savings](ddb.png) Example cost savings on a low usage table (~30k request units per day) ] ] --- .navi[#### Overview #### What DynamoDB Is #### DynamoDB Pricing #### Examples #### .orange[Questions] ] .content[ ] .content[ ] .content[ .center[?] --- ]