‫So now let's go ahead and create
‫our first Amazon RDS database instance.
‫So on Databases on the left-hand side,
‫you can just click on Create database.
‫Okay, so when we are on the screen
‫we have to select the database engine.
‫So we have six engines types,
‫and we have two database creation methods,
‫would be standard create or easy create.
‫Because I wanna show you all the options,
‫we're going to choose standard create
‫which is going to be longer
‫but we'll show you all you need to know for the exam.
‫Now for the engine options,
‫we have Aurora that we'll deal with later on,
‫MySQL, MariaDB, PostgreSQL, Oracle,
‫and Microsoft SQL Server.
‫For simply sake, right now I'm just going to use MySQL
‫and go down with it.
‫We going to use the version
‫that is provided right here, MySQL 8.0.28
‫but whatever is the first selected is good enough for you.
‫Next, we have templates to meet our use case.
‫So if you wanted to have a free tier setup,
‫you would click here
‫and this would pre-select some options for the free tiers,
‫or if you had a dev test environment,
‫then it would pre select option for dev test,
‫and production, you have full control over every option.
‫Now I'm going to use production as a template
‫but we'll modify every option to be within the free tier
‫but I'm showing you this so that we can have a look
‫at all the options one by one.
‫So first for availability and durability.
‫We have three options.
‫We have Single DB instance, Multi-AZ or Multi-AZ DB Cluster.
‫So, because we want to remain within the free tier,
‫we're going to use Single DB instance
‫but if you want to have a standby database instance,
‫you would use a Multi-AZ type of option.
‫Now for the DB identifier, we're going to use database-1.
‫The credential is admin
‫and the password I'm going to use,
‫a password here that I'm just going to enter as we go.
‫Okay, next for the instance configuration,
‫this is the size of the underlying EC2 instance.
‫So in that case, we can have standard classes
‫or memory optimized classes or burstable classes.
‫And within it, you can choose whatever instance
‫that you want with different characteristics.
‫Now to remain within the free tier,
‫I'm going to use a burstable class.
‫I will include previous generation classes
‫and choose db.t2.micro, which is within the free tier.
‫Now for storage type, if you are in production,
‫you're going to use an Io1 type of EBS volume,
‫but as we run within the free tier,
‫I wanna use a gp2 type of volume,
‫which is lower performance.
‫And we'll use, maybe 10, 20 gigabytes of allocated storage.
‫Now we can also enable storage autoscaling
‫which will automatically increase
‫the size of the EBS volume
‫in case we are starting to near a threshold.
‫And what is the maximum amount of storage we want
‫in case we enable autoscaling, let's say 1000 gigabytes.
‫Now for connectivity, we have the option
‫to connect what was called an EC2 compute resource.
‫So this is in case you wanted to make sure
‫that there is connectivity
‫between a specified EC2 instance and your RDS database.
‫You would just choose it in this list.
‫And then the configuration in terms of networking
‫will be done automatically.
‫So you don't have to handle security groups
‫et cetera, cetera,
‫which is very helpful when you're a beginner.
‫But we're going to look at all the options.
‫So I'm going to say don't connect
‫to an EC2 compute resource.
‫Therefore we have to deploy in a specified VPC
‫and then we have to specify a subnet group
‫and then whether or not we want public access
‫to the database.
‫So I'm going to say yes
‫because I want to access this database from my own computer.
‫Next, we need to choose or to create a security group.
‫So I'm going to create a new security group.
‫And the name is going to be demo-database-mysql.
‫In terms of AZ preference, we could set one, but no need.
‫And as you can see, the port to connect to the database
‫on MySQL is 3306.
‫In terms of database authentication,
‫we have three mechanism.
‫The first one is to a username and password,
‫this is what we'll be using,
‫but we can also enable IAM database authentication
‫to have IAM users and roles directly access RDS,
‫or we can enable Kerberos,
‫but right now I'm going to leave it
‫as password authentication.
‫We can enable monitoring
‫and enhance monitoring gives you a 60 second granularity
‫on your resources, but I can disable it right now.
‫And we can specify some additional database configuration.
‫So for the initial database name,
‫I'm just going to enter mydb.
‫Then we can enable or disable backups.
‫So backups are automated
‫and we can have a backup retention period of 1 to 35 days.
‫And if I said zero
‫then it will just completely disable them.
‫So let's leave it at seven.
‫And then for backup window,
‫we can choose a specific time window
‫where the backups will be done, or no preference.
‫Then we can export the logs into CloudWatch Logs.
‫For example, you can export the audit log
‫from RDS into CloudWatch Logs for long-term retention.
‫Then do we want to have a maintenance window
‫for the minor version upgrades?
‫And if so, what is a window you want have?
‫And do you want to have deletion protection?
‫This is to protect the database
‫from being accidentally deleted.
‫So now, as you can see we have some DB cost of $17 per month
‫even though I told you this is within the free tier.
‫So it's not reflected right here,
‫but if you use a db.t2.micro type,
‫then you will have a free tier for this
‫even though it says here 17.34 US dollars.
‫So when you're done, just create this database.
‫So while my database is being created,
‫let's go ahead and download SQL Electron.
‫And this is a SQL clients
‫that we're going to use to connect to our database.
‫So very simple, you're going to click on Download GUI
‫and then click on it,
‫take the latest version for whatever platform you have.
‫So you have latest Windows
‫and then for Mac is going to be a DMG.
‫So I'm gonna do this one,
‫then open it and install it.
‫Okay, so my database is now created,
‫took a little bit of time.
‫And now, cause we can see it is available.
‫And so what I'm going to show you are a few options.
‫So first of all, we have the endpoint right here
‫and the port 3306,
‫and it's linked to this security group,
‫and this security group if you click on it
‫and look at the inbound rules,
‫we can see that we have an inbound rule here
‫on TCP port 3306.
‫So that's great.
‫Coming from just my IP address.
‫Okay.
‫So you should course modify this security group
‫if you have problem connecting to your database instance
‫to maybe have it to anywhere IPv4.
‫Okay, so now let's take this endpoint
‫and we're going to connect to it using SQL Electron.
‫So using SQL Electron I'm going to add a new database,
‫I'll call it RDSDemo.
‫It's a database of type MySQL.
‫And then for the server address,
‫I'm going to enter what I have right here on port 3306.
‫The user is admin and the password for me was password.
‫And then the initial database is mydb
‫as I entered it from before.
‫Let's click on Test
‫and the connection is successful.
‫If it's not successful, please have a look whether or not
‫your database was set to be a public database number one,
‫and number two, have a look at your security group settings
‫to make sure that your IP is allowed in.
‫So let's save this and connect your database.
‫And now I am connected into my database directly to mydb
‫which was the database that was created.
‫And in here I could go ahead
‫and enter some create table statements.
‫So CREATE TABLE mytable,
‫and then just a name of VARCHAR 20
‫and first name of VARCHAR 20.
‫So it's just a very quick statement,
‫just to show you how SQL works,
‫but this is definitely out of scope for the exam.
‫Execute this.
‫So now we have mytable that has been created
‫and then we don't have any content in it.
‫But you could have an insert statement
‫to insert some data into your table.
‫So you would say, for example, enter the value maarek
‫and then the value here, Stephan.
‫Execute this.
‫And then if you click on select throws,
‫then you see that my table has my name
‫and my first name to be maarek and Stephan.
‫So this is how you would use a RDS database with MySQL,
‫but again, out scope of the exam,
‫I just wanted to show you the full picture
‫of using SQL Electron.
‫So back in here, my RDS database is fully managed.
‫So this is great. We can use it.
‫This is amazing.
‫Other things we can do that are worthy
‫are to create a read replica
‫directly from this database
‫so we can create a read replica.
‫And then this read replica would allow us
‫to have more read capacity for our database
‫which would be very, very helpful.
‫And we want whether or not that database
‫to be Multi-AZ for recovery purposes.
‫So I'll keep it as No and cancel it next.
‫We can have a look at monitoring
‫and monitoring for example show us the CPU utilization.
‫And as we can see while the utilization is monitored
‫by my database, and we can monitor this,
‫for example, for scaling our database
‫if in case we have too many connections into it.
‫We can have a look
‫at the database connection accounts as well
‫to see how many clients are connected into our database,
‫and a lot of metrics overall.
‫Other things we can do with RDS is around creating snapshot.
‫So you can take a snapshot and this will snapshot database
‫and you can restore it wherever you want.
‫You can restore to a point in time for your database
‫or you can even migrate a snapshot
‫if you wanted to migrate a snapshot
‫into a different region, for example.
‫So all these are a bunch of options that we can use
‫but as we can see, the whole power of RDS
‫is to manage the database for us to have read replicas,
‫Multi-AZ, we can increase the instant type
‫as we go along and so on.
‫And that's all comes very handy
‫from a managed service perspective.
‫So you've seen all you need to know for your RDS database.
‫I hope you liked it.
‫And just to finish yourself,
‫please make sure to delete the database.
‫So to delete it, first you need to remove
‫the termination protection.
‫So you go to modify
‫and then at the very bottom, you will scroll down
‫and find the delete protection setting.
‫So here it is.
‫We'll disable it.
‫Press Continue.
‫And then Apply immediately.
‫And then once the delete protection is done,
‫you can go ahead and delete this database.
‫You can remove creating your final snapshots
‫and then say delete me
‫and acknowledge the fact that upon deletion
‫everything will be lost.
‫Click on Delete.
‫And you're good to go.
‫So that's it for this lecture.
‫I hope you liked it.
‫And I will see you in the next lecture.