Welcome back, another question to review.
So let's waste no time and get started straight away.
Okay, so this is the question
that we're going to be reviewing.
The question is, you are auditing a serverless application
for a university enrollment system.
The application uses API Gateway, S3
and Lambda to provide the front end serverless compute
and DynamoDB for backend data storage.
During yearly student intake periods,
the system is expected to have 10,000 times the load
versus other times of the year.
The DynamoDB tables use provisioned capacity
of 50 RCU and 50 WCU.
Which architecture changes could you suggest
to reduce the impact of the extra load
and you need to choose two?
Now, we're going to follow the same process,
highlighting keywords and anything
of scenario significance in the question.
If you want to try this, pause the video
and give it a go and then resume
and we can carry on.
So let's review what I found in this question.
The first thing which jumps out, is serverless.
Now this is a vague word at best,
but it lets us know that the architecture
is likely to be scalable.
So for any performance issues, your default position
can be that they're probably not application related.
If it uses S3 API Gateway and Lambda,
which it does all three of those are scalable products.
So we probably not looking for performance issues
in the front end application.
Now we can also see that it uses DynamoDB for the backend.
What makes this question special
is that it's a classic example of a burst problem,
an application, which has a normal level
of load most of the time.
But then for a certain period has massively more load.
Now, this might be certain times of the day,
certain days of the week or sale or enrollment periods,
but the architecture is always the same.
A normal level of load, which increases to orders
of magnitude more during certain periods.
Now the application uses DynamoDB,
and has a provisioned capacity of 50 RCU and 50 WCU.
Now for this question, we need to pick two correct answers.
So it's slightly different than questions
we've looked at previously, which only required one.
Now, if there's two correct answers,
we can either be looking at two parts of the same solution
or two potentially correct solutions to this problem.
So let's look at the answers that we have available.
And this time we have a total of five answers
and we need to pick two from this list of five.
On the surface level, the answers all look to be different.
So why don't you pause the video, read through them,
try to identify the key points
and then we'll step through them together
and evaluate which of them are valid for this question.
Okay, so let's look at what points
I highlighted in these questions,
and you can compare those to the ones that you found.
Now, keep in mind for this one.
We're actually looking for answers,
which might help in reducing the impact
of the extra load experienced during these bursty periods,
an important point to make is that the question
didn't explicitly mention anything about cost.
That's important because we're picking two answers.
Maybe one of them is perfect and is a low cost option.
And another one is good,
but might be significantly more expensive.
When we're asked to pick two answers out of a list,
we need to focus initially on answers which are possible.
Anything that fits, anything that meets the requirements
in the question at this point
will be a potentially correct answer.
So let's go through them one by one.
Now the first answer, we can immediately exclude it
without even factoring in the question.
And the reason for this,
is you don't launch DynamoDB databases.
DynamoDB is a database table as a service product.
You don't provision databases within the product.
You provision DynamoDB tables.
Now that sounds picky,
but that's a valid distinction to make
and it gives us a reason to exclude this answer.
The second answer is affected by a dynamic
you've seen in previous questions.
The database currently in use is DynamoDB,
which is a no sequel database.
The data in it will also be no sequel data.
It will be modeled with a non-relational model.
Now the answer is suggesting that you backup DynamoDB data
and restore it into an Aurora Serverless cluster
and this is a trick answer.
The word serverless is designed to check that you know,
that Aurora Serverless is a sequel
or a relational database product.
It's not no sequel, and the difference in these data models.
So no sequel to sequel makes this a bad answer.
So we're going to exclude it.
Now let's skip ahead to the last answer.
This one is self exclusionary for two reasons.
First 500,000 RCU and WCU
is above the per table limit on capacity.
Now I don't expect you to know that from memory,
but when you see any large values for RCU or WCU,
that should be your immediate default
to question whether it's above any service limits.
Now, secondly, it's a known bad practice on DynamoDB
to increase the RCU and WCU, and then decrease it again.
Increasing values causes
additional partitions to be created.
Reducing the values,
doesn't reduce the number of partitions.
And this means by doing this,
you can introduce longterm performance problems.
So it's generally a bad idea.
Now this leaves us with two correct answers
and logically both of them have to be correct,
but the question is why?
Well changing the capacity from provisioned,
where you explicitly set to RCU and WCU to on demand.
Well, this is more expensive,
but it means that AWS handle the performance
behind the scenes.
So it is a potentially valid answer
and at this stage, that's good enough.
Now the other answer involves adding an SQS queue.
The application is modified to write to the queue
rather than the database,
and then a Lambda function can pass the queue
and write data into the table over time.
Leveling out the load over that same time period.
Now this is a pretty common architecture
for leveling rights to a DynamoDB table
and so it's something to be aware of.
Now, these are the two answers
that I'd select for this question.
Now you might be thinking that neither of them
are amazing solutions and you would
be a hundred percent right.
These answers were actually crafted
to show you an example of a question with answers,
which you might find to be sub optimal.
They might be bad answers,
but they are the least bad of the answers available.
And this is often how pro level
or specialty level questions are architected.
Where you have to pick the least bad answer
from a collection of bad answers.
Okay, well, that's everything for this question.
I hope it made sense.
And I hope it gives you an idea of how to answer
this type of question.
Thanks for watching.
Go ahead and complete this video
and then when you're ready,
I look forward to your joining me in the next.