OK.
Hello bloggers and welcome to this section of the course.
In this section of the course we're going to look at all the different databases available to us on
AWOL.
And it does come up an awful lot in your exams.
I think it's helpful just to start with what a database is.
I'm sure you all know but just in case you don't.
And if we think of relational databases let's start there.
The relational databases are what most of us or all used to.
They've been around since the 1970s.
I want you to think of a traditional spreadsheet so if you use Excel Excel is saved in a file might
be your cost stock Excel s or something like that.
So that's essentially the database itself.
And then if you go into that file you've got different worksheets and those are different tables and
inside your tables you've got rows and you've got columns or fields.
That's all a database is and here's a good example of one.
Let's say this is a student database.
You want a list of all your students in a particular class.
You've got your student I.D..
Off to the left and this could be a unique number.
And then we've got our first name our surnames.
And then what gender the students are.
So that's all a relational database is very very simple.
And databases on AWB has come in six different flavors.
So we've got Microsoft sequels server.
We have Oracle.
We have my SQL Server.
We have post rescue url.
We have a Roth IRA which is Amazon's own proprietary database.
And we also have Maria D.B..
So these are the six different relational databases on AWB.
Now the one that we'll be using in this course will be my sequel.
And the reason for that is we're going to be using Wordpress to do an installation and we'll look at
doing that in the very next lecture.
So the main thing you need to understand about RDX or relational database services is it has two key
features.
We've got multi easy which is for disaster recovery and then we've got read replicas which is for performance.
So multi easy Disaster Recovery read replicas performance and you will get all these different scenario
questions and to ask be asking you if you should be turning on you know multi easy or whether you should
be using read replicas.
And really it's all about whether or not you just want a you know to spread your databases across multiple
Availability Zones then you want multi easy whereas if you're trying to boost the database performance
you're going to go for read replicas.
And the way it works is we've got a diagram here.
So we've got our easy to instance up the top and it connects in to our databases using a connection
string and we'll have a look at those in the next lab but essentially as using an address it's a DNS
address.
So this is an example.
So I've got my example D.B..
And then this is the address US West to dot ideas dot Amazon dot com.
So it's connecting to that Amazon host this DNS record and they point it at a database a primary database
as they've pointed at it's in its internal IP address.
Now if for some reason we lost our primary Amazon would detect that and they'd automatically update
the DNS to point to the secondary.
So you don't need to go in and change IP addresses or anything like that on the fly.
All you're doing is pointing out to this DNS address an Amazon will go in and update that DNS address
with the new IP address.
So failover is automatic where the multi easy now with read replicas it's slightly different.
We've got our easy two instances and they're pointing off to our primary instance using this connection
string.
And what happens is that every time you do a right to that database that right is going to be replicated
to another database.
It's a good perfect copy of the other database but it's a replica.
Now if you were to lose your primary database for whatever reason yet there's no automatic failover
from one to the other what you would have to do is you'd have to go in and essentially create a new
euro and then you'd have to update your easy two instances to point to the read replica.
So where it is useful however is if you've got these easy two instances let's say you're running a very
popular wordpress blog and most of WordPress is read because people are reading your blog right.
And let's say that your primary database is getting way too many reads because you're you're getting
let's say you so a blog goes viral and you start getting a million requests per hour the way you can
scale your database is to have a perfect copy of it read replica and you can point half of your easy
to instances to read from the read replica and then the other half to read from the primary database
and you can scale out that way.
So that's what read replicas are and you can actually have five copies of read replicas.
Now we are going to cover this in a lot more detail in some lectures and labs coming up.
So we'll move on from that non relational databases is probably something you may or may not be familiar
with.
I certainly wasn't familiar with it until around 2008 2009 but they basically consist of a collection
and a collection is just a table.
And inside the collection you have documents and your documents is simply a row and then you have key
value pairs and these are basically your fields or columns.
So let's have a look at what a non relational database would look like.
So something like this.
This is just javascript object notation language.
So in here we've got our I.D. as a key value pair our first name our surname our age.
Then we've got our address so we can actually nest.
Key value pairs inside this address.
And what's really cool about this is I could go in and say this is record one I could go in and then
add a new field in here.
I could actually go in and add let's say gender for example.
So do something like this.
So we go from one record which doesn't have someone's gender and the other record which does.
Now if I was to do this in a relational database let's have a look at my relational database here.
If I was to add a new field.
The problem I have is that new field is added across all my records.
So I've added a new column in and suddenly I'm missing data for Ryan a missing data for John a missing
data for Danielle.
But I've got data for Julia.
So that's the difference between non relational and relational database as you can have as many different
columns as you want for any given row within a non relational database.
But for relational databases you basically have to keep some kind of consistency across all the records.
Moving on to data warehousing So what is data warehousing.
Well basically it's use for business intelligence so tools like Cognizant just piss off Sequel Server
Reporting Services.
Oracle Hyperion SAP network et cetera et cetera.
And it's used to pull in very large and complex data sets and usually used by management to do queries
on data such as current performance versus targets et cetera.
So before we look at Amazon's solution to data warehousing I just want to compare online transaction
processing versus online analytics processing.
So online transaction processing differs from online analytics processing in terms of the types of queries
that you run.
So let's look at an online transaction processing example LDP example.
So say I want to find a specific order say it's 2 1 2 0 1 2 1.
So I basically run a query saying hey select Order Number 2 1 2 0 1 2 1.
And this is going to pull up a row of data and this might have things like my name my date my address
to delivered to the delivery status et cetera.
Online analytics processing is going to be much more complicated.
So say I'm a manager and I want to understand the net profit for me as a Europe Middle East and Africa
and Pacific for the digital digital radio product.
And so this is going to pull in a huge number of records it's going to do a huge number of queries.
So it's basically going to add up the sum of all radios sold in EMEA.
It's going to add up all the sums of radios sold in the Pacific.
It's going to figure out the unit cost of the radio in each region and then it's going to take the sales
price of each radio and then it's also going to need to figure out the difference between the sales
price and the unit cost.
And essentially it's going to run a whole bunch of queries onto my database and you really want to start
splitting out your database what you're going to be using for just normal transactions for your website
and you want a different database for ones that you're going to run queries on where it's you know online
analytics processing where you're running all these very complicated queries so data warehousing databases
use different types of architecture both from a database perspective and from an infrastructure layer.
And so Amazon have a specific product for this called Red Shift.
So redshift is Amazon's data warehousing solution.
It's Amazon's answer to doing online analytics processing moving onto elastic cash elastic cache is
a Web service that makes it easy to deploy operate and scale and in memory caching service in the cloud.
And this basically improves the performance of your web applications by allowing you to retrieve information
from fast manage in memory caches instead of relying entirely on slower dis based databases.
So what does that mean.
Well again we're going to do a deep dive lecture on this but essentially Imagine you own Amazon.
Wouldn't we all like to own Amazon.com when people visit Amazon.com they might have a you know a particular
store the most top 10 purchased items.
Now of course if a thousand people are visiting that every minute the top 10 is not really going to
change all that much and there's no point bringing pulling that information from a database right.
Because the top 10 doesn't change all that frequently yet you're always when somebody is visiting the
website they're always making that query to the database Hey what are the top 10 products that are being
sold.
So what you can do is you can cache that and that's what elastic cache does basically it's a way of
cashing your most common web queries so when your web servers of getting a request they'll go to a plastic
cache first and get that information from elastic cache and it takes a huge load off of your databases
and you're going to get a whole bunch of scenario questions in your solutions architect associate exam
where your databases overloaded and it's going to ask you what a what is an option to you know help
with this.
And of course using elastic cash is one option.
You could also use read replicas.
And again we're going to cover this in more detail in this section of the course.
Alas the cache is consists of two different engines.
So we've got mem cash deep and then we've got readies and we will learn about the differences later
on in this course.
So what are my exam tips.
Just remember that RDX consists of online transaction processing comes in six different flavors of SQL
Server.
My SEC will post rescue l Oracle Aurora and Maria DB dynamo DB is Amazon's no sequel solution redshift
is Amazon's data warehousing solution.
This is done for online analytics processing it then got elastic cash comes in two different flavors
so many cash deals and read us and this is Amazon's casing solution.
And just remember that redshift is used for business intelligence or for data warehousing and elastic
cash is used to speed up the performance of existing databases.
So it's a way of cashing frequently identical queries so as always the best way to learn something about
eight of us is to go in and get our hands dirty so in the next lecture we're going to go in and create
our very first RDF database and we're going to install Wordpress to it.
So if you got the time please join me in the next lecture.
Thank you.