So now let's discuss
advanced concepts of Aurora
that you need to know going into the exam.
So let's talk about Replicas-Auto Scaling.
So let's say we have clients
and we have three Aurora instances right now.
So one will be writing through the writer endpoint
and the other two will be reading
through the reader endpoint, okay?
Now let's say that we are having many, many requests,
read requests on the reader endpoint
and so therefore the Amazon Aurora databases
have an increased CPU usage.
In that case, we can set up Replica-Auto scaling.
and what this will do is that it will add,
obviously, Amazon Aurora replicas.
And then what will happen is that automatically,
the reader endpoint is going to be extended
to cover these new replicas.
And therefore these new replicas will start
receiving some traffic and the reads will be happening
in a more distributed fashion
hopefully bringing down the overall CPU usage.
So this is replica-auto scaling.
The second thing is custom endpoints.
So let's say we have the same setup
but this time we have two different kinds of replicas.
As you can see, we have some db.r3 large
and some db.r5.2xlarge.
So some read replicas are bigger than others.
And the reason you would do this
is that you wanna define a subsets
of your Aurora instances as a custom endpoint.
So let's say we define a custom endpoint
on these two bigger Aurora instances.
The reason we would do so is for example,
that we know that these instances are more powerful
and therefore they're going to be better
to run analytical queries on these specific replicas.
So when you do so you have a custom endpoint that's defined.
And when you have a custom endpoint
generally, the reader endpoint itself is not used
after defining custom endpoints.
So it would not disappear, but you would not use it anymore.
And what you would do practically speaking, is set up
many custom endpoints for many different kind of workloads
therefore allowing you to query only a subsets
of your Aurora replicas.
Next we have serverless.
So this is going to give you automated database
instantiation and auto-scaling based on actual usage
which is great when you have infrequent, intermittent
or unpredictable workloads
and therefore you don't need to do any capacity planning.
You're going to pay per the second
of each Aurora instance that is being spun up
and this can be a lot more cost effective.
So how does that work?
Well, the clients is going to talk to a proxy fleet
that is managed by Aurora
and in the backend many Aurora instances will be created
based on your workload in a serverless fashion.
So you don't have to provision capacity at all in advance.
Then we have a multi-master
and this is in case you want immediate fill over
for the writer nodes,
in case you want high availability for the writer node.
In this case, all the nodes in your Aurora cluster does read
and write versus the idea
that before, if you only have one right node
and it falls down, it fails
then you have to promote the read replica as the new master.
So here we have three Aurora instances.
There's replication happening between all of them,
there's a shared storage volume
and the clients will have multiple database connection.
All the Aurora instances can do writes
and in case one Aurora instance fails,
then you can automatically fail over to another one
giving you immediate failover for the writer node.
And this is the kind of use cases
and scenarios that the exam will test you on.
Finally, we have global Aurora.
So in case we have a Aurora cross region read replica,
it's going to be very helpful for disaster recovery
very simple to put in place
but you can also set up the Aurora global database
which is the recommended way of doing things today.
In this case, you have one primary region
where all the reads and writes happen,
but you can set up up to five secondary read only regions
where the replication should be less than one second
and up to 16 read replicas per secondary region.
And this will help you decrease latency
for the read workloads all over the world.
But also in case you have a database outage
in one region promoting another region
for disaster recovery purposes has an RTO,
so recovery time objective of less than one minute.
So it takes less than one minute to recover
into another region.
And here is a sentence you should look
out for from an exam perspective.
It takes on average, less than one second to replicate data
across region for your Aurora global database.
So this is something that if you see an exam,
it's a hint to use a global Aurora.
So let's have a look.
We have us-east-1 as our primary region
which is where the applications do the read and writes.
And then we'll set up a secondary region in eu-wes-1
where some replication happening with a global database
of Aurora and the applications there can do read only
from that setup but in case us-east-1 fails,
then we can fail over to eu-wes-1 by promoting it
as a read Write Aurora to cluster.
Aurora also has an integration
with machine learning services within AWS.
So the idea with Aurora machine learning
is that you can have ML-based predictions
to your applications.
You have the SQL interface, it's a simple optimized
insecure integration between Aurora
and different AWS machine learning services.
So two supported services are SageMaker,
which allows you to use any kind of machine learning model
in the backend or Amazon Comprehend
if you want to do sentiment analysis.
Now you don't need to be an expert in SageMaker
or Comprehend, you just need to know
that Aurora has an integration with those.
So in order to use Aurora machine learning,
you don't need to have a machine learning experience
and the use cases for this would be to have fraud detection,
ads targeting, sentiment analysis, or product recommendation
all within Aurora.
So to give you the architecture idea,
Aurora is going to be connected
to the machine learning services
in AWS, and your application can just run
a very simple SQL query.
For example, what are the recommended products?
Aurora will send some data
into the machine learning services, such as for example,
the user's profile, the shopping history,
et cetera, et cetera
and then the machine learning service will return
a prediction directly to Aurora.
For example, the user should buy a red shirt and blue pants
and then Aurora can just return the query results
to the application all through
as a result of the SQL query, which is very handy.
So that's it, just a feature you need to know
going to the exam.
So that's it for this lecture, I hope you liked it
and I will see you in the next lecture.