‫Now let's talk about databases and AWS.
‫And first I want to give you an introduction
‫as to what is a database
‫and the different types of databases we have today.
‫So when you are storing data on disk,
‫would it be on an EBS drive, an EBS volume,
‫an EC2 Instance Store, Amazon S3, you have your limits.
‫If you want to store data in the structure way,
‫you may want to store it in a database.
‫And this structure is going to allow you
‫to build indexes and to efficiently query
‫or search through the data.
‫So well we have with EFS EBS, EC2 Instance Store
‫and Amazon S3, we can do per files operations
‫with databases, it's going to be a lot more structured.
‫We can even define relationships between your datasets.
‫So these databases nowadays,
‫they're all optimized for a purpose
‫and they will come with different features,
‫shapes and constraints.
‫From an exam perspective, it's up to you to understand
‫which database is going to fit best
‫at the use case given to you by the question.
‫So the first kind of database that has been very common
‫and it's still a very common today,
‫is called the relational databases.
‫So if you used Excel before, you know, Excel spreadsheets,
‫this is just the same as Excel spreadsheets,
‫but do you have links between each table.
‫So for example, we have the students table,
‫and as we can see, we have four columns
‫and there's a student ID, department ID,
‫a name and an email and then for example,
‫you would have a second spreadsheet
‫called the department spreadsheets
‫with text the department ID and as more information.
‫And the idea is that's in a relational database,
‫you are defining a relation between the department ID,
‫the second column in the students table,
‫into the first column of the departments table.
‫And you can even define more relations,
‫for example, you can define a subject's stable
‫and link the table of the students
‫to the subjects by defining another relation.
‫This is why it's called a relational database.
‫Now in relational databases,
‫the particularity clarity is that you can use
‫the SQL language to perform queries or lookups.
‫So these, whenever you hear SQL think relational databases.
‫Next, we have NoSQL Databases, NoSQL means non-SQL,
‫which means non relational databases.
‫So NoSQL are in more modern kind of databases.
‫They're built for a specific purpose
‫with a specific data model in mind
‫and have a flexible schema for building modern application.
‫The schema is basically the shape of the data.
‫So the benefits of using a NoSQL database
‫is that you have more flexibility.
‫It's easier to make the data model evolve,
‫it's scalable, so it's designed to scale out
‫by adding distributed servers.
‫So, the example from before the relational database,
‫it's not easy to add servers to scale it,
‫so you have to scale up by doing some vertical scaling,
‫but with no sequel databases, you can do horizontal scaling.
‫It's also high performance,
‫it's optimized for a specific data model.
‫It's highly functional,
‫the types are optimized for the model.
‫And finally, some examples of NoSQL databases
‫are going to be key-value databases,
‫document, graph, in-memory or a search databases.
‫We will be seeing those in this section.
‫So, for example, in the NoSQL database,
‫you can have the data in JSON format.
‫So JSON stands for JavaScript Object Notation,
‫and we've seen it before
‫this is the same language we've been using
‫when we defined our IAM policies,
‫and this is what a JSON document looked like.
‫As we can see, this does not look at all
‫like an Excel documents.
‫So JSON is a very common way to describe data
‫and as we can see in here,
‫we have different sub nesting of the data.
‫We have different fields, different name, different types.
‫And so, it is a very common way
‫to muddle data in a NoSQL model.
‫The data can be nested, for example,
‫if you look at address right here,
‫it is nested within the higher object elements.
‫So address and types are going to be nested.
‫The fields can change over time.
‫So it's up to us to add a new field into our JSON documents
‫and their support for arrays, for example,
‫John who is 30, has three different cars,
‫Ford, BMW, and Fiat, he's a lucky man.
‫Okay, so databases, as you can see get a different forms
‫and we'll be seeing them in details in the section.
‫So just some words around databases
‫and the shared responsibility model on AWS.
‫So AWS will offer to manage different databases for us.
‫So these are the offering we'll see
‫and the benefits of using a managed database,
‫is that it's very quick to provision.
‫Usually a database will have,
‫high availability in mind when designing it.
‫And if you wanna scale your database,
‫you can do vertical and horizontal scaling pretty easily.
‫They will also include some utilities
‫to do automated backup and restore of your databases
‫as well as operations and upgrades.
‫And if you need to patch the operating system
‫of the underlying instance,
‫actually it's not your responsibility anymore.
‫It's AWS's responsibility.
‫So AWS will be responsible for the entire database
‫in terms of patching.
‫The monitoring and alerting as well
‫are going to be integrated.
‫And so this is why using a managed database
‫on AWS is very, very important and very beneficial.
‫So, you are obviously able
‫to run your own database technology on an EC2 instance,
‫but if you do so, you need to handle yourself,
‫all the things associated with resiliency, backup, patching,
‫high availability, fault tolerance, and scaling.
‫So this is why in this case, using a managed database
‫is going to be a lifesaver
‫for so many of our use cases, okay?
‫So in this section,
‫we'll have a look at all the managed databases from AWS
‫and which use cases they fit.
‫So we'll see you in the next lecture.