Dynamodb – Basic Steps in Calculating RCU and WCU

So there will come a day when you will need to calculate RCU/WCU for Dynamodb tables on AWS.   This will probably come in the form of a word problem like this one…

From A Cloud Guru’s discussion group on a quiz on DynamoDB…

“You have a motion sensor which writes 600 items of data every minute. Each item consists of 5kb.

Your application uses eventually consistent reads. What should you set the read throughput to?”

Ignore the inconsistency of the first use of “writes” and let’s assume that we want reads and that the motion sensor reads 600 items of data every minute.

Here are a few simple steps:

  1. Is this a Read (RCU) or Write (WCU) calculation? –   This matters for two reasons because:
    1. RCUs have a 4kb chunk size per operation
    2. WCUs have a 1kb chunk size per operation.
  2. Calculate the number of items per second  – Why?  Because the RCU and WCU (reads and writes) are provisioned by the second.  In our example, above we take 600 items and divide it by 60 seconds (every minute).   This comes out to 10 items per second are being read per our example. $IpS
  3. Calculate the number of actions per item needed.  – Each item is 5kb and our chunk (or grab) size is 4kb per read unit.  If this was a write then our chunk(or grab) size would be 1kb.   This means in our example of 5kb we need two 4kb operations to read that file.  One operation to grab the first 4kb and then one more to grab the remaining 1kb.   So that means we need 2 actions per item.  $ApI
  4. Multiply Items per Second times Actions per Item ($IpS * $ApI) – So in our example, above we take 10 items per second and multiply it by 2 actions per item.  This tells you that for our read example you need 20 RCUs.
  5. If you are doing reads then you need to know if it is eventually consistent (2 reads per RCU) or strongly consistent (1 read per RCU).
    1. If you are using strongly consistent reads then you are done.  Your answer is 20 RCU’s.
    2. If you are doing eventually consistent reads then you need to take the result of Step 4 and divide it by two.  So in our example 20 RCUs/2 = 10 RCUs needed for our word problem.

This is mainly exam focused so if this is for certification then at present (09/2106) that is what you need to know.   If this is for real throughput calculations then make sure you account for local secondary indexes which “share” RCU/WCU with the table they are indexed against.   You will also need to account for Global Secondary Indexes which are basically a read only copy of a table with its own RCU/WCU.

https://aws.amazon.com/documentation/dynamodb/

Let me know.

Advertisements

Developing on Amazon Web Services Certification Exam – My Study Steps

Hola!
Many times I have been asked how I studied for the various Amazon Web Services exams and I thought I would write a specific series of steps of how I have approached this topic.

The first thing to note is that my background is that of a systems engineer so I come from the old school UNIX and Linux worlds of HP-UX, AIX, and Solaris.  I evolved into architecture, networking, and virtualization (and of course people), but that isn’t where I stayed.  So Citrix/VMware-style virtualization is normal for me as well as Windows in various flavors.  I have also been doing AWS either directly or indirectly (as a manager or architect) for over 5 years.   I know the lingo, read the blogs, and of course, now I have taught AWS for most of 2016.

But to the chase….

Mercutio:
Nay, if our wits run the wild-goose chase, I am done; for
thou hast more of the wild-goose in one of thy wits than, I am
sure, I have in my whole five.

Romeo And Juliet Act 2, scene 4, 67–73

  1. Read the Exam Guide for the Developing on AWS Certification.  In particular, read the sections on Domain knowledge.  Note below that section the specific areas that you must study.  Focus on those.  Look up any terms you don’t understand like AMI, AAA, or CIDR.  This will tell you where to spend most of your time.
    developeronaws-domain-knowledge
  2. Take one of the following in preferred order:
    1. A Cloud Guru’s Developing on AWS course – This course normally runs for $30 and involves 8 hours of videos.  A great starter course.  The best part of it… the quizzes.  Not only the quizzes here in this course but the ones you can get below on Android (or iPhone?).   Best recommendation and the one most people love.  They also have ALL of the certification which I recommend.  Do not move on until you can pass the final simulated quiz with a %95 or better.
    2. Linux Academy’s Developing on AWS course. – This course is also good with quizzes and other community tidbits.  I actually like Linux Academy for the breadth of courses it offers and not just their AWS section.  AS of this writing on 9/15, they do not have the DevOps Engineering exam certification so hence A Cloud Guru.
    3. Cloud Academy’s Developing on AWS course – This is the one course that I hear complaints about.  I have never heard any complaints about A Cloud Guru or Linux Academy but hear many about Cloud Academy.  Honestly, I don’t know why because they seem pretty solid, but I have to share my experience.
  3. Obtain the mobile app for A Cloud Guru (a.k.a Exam Certified) in Google Play or iTunes store for the Developing on AWS Exam Test..  –  There is an app for Solutions Architect and Developer and I recommend the Developer mobile app to make sure you can test, test, test.   Aim for 95% or higher and make sure you understand why your answer is the correct one.
  4. Do all of the free Intro labs for AWS at Qwiklabs and maybe even kinda sorta buy an account with them and go past the introductory courses.