There are a variety of options to choose from when creating a new RDS instance. What engine to use, the engine's version, templates, standby databases, private clouds, etc. In this video, we go over each of the options and what they mean.
But, an RDS instance can get expensive fast. That's why you will also learn how to configure your instance so that is affordable for dev/test purposes.
Sam Julien: [0:00] Let's create a relational database using RDS. You might see RDS in your Recently Visited Services here. If you don't, go on up to the Services menu, scroll down to Databases here, and you can choose RDS. I like to star mine so that they end up in the Favorites on my left sidebar here. I'm just going to go ahead and click on RDS.
[0:24] Once the console loads, I'm going to go ahead and click out of this ad for Aurora, and I'm going to click on DB Instances. Databases are specific to the region that you're in. I am currently in the us-west-2, Oregon region, but it doesn't really matter for our purposes which region you choose.
[0:46] I'm going to click on Create Database, and close this little Feedback box. I'm just going to walk you through the standard creation method. You'll notice here that we have six different types of relational databases that we can create.
[1:02] Aurora is a proprietary Amazon MySQL-compatible or PostgreSQL-compatible database. It's meant to have all of the speed and performance of the big Enterprise options like Oracle but with some of the convenience of an open-source database, compatible with things like MySQL.
[1:23] MySQL is a very popular database that you'll likely run into quite a lot. WordPress uses MySQL, for example. MariaDB is an open-source database. PostgreSQL is another one you're going to run into very frequently. It's a very powerful, very cool database option that you'll probably run into quite a lot.
[1:43] Oracle is an Enterprise option. You will know if you need to create an Oracle database. Then SQL Server is a Microsoft product. Likely, you'll need this if you're using something like C# on the backend of your web application. The two that you're going to use most frequently are MySQL and PostgreSQL.
[2:04] I happen to be partial to PostgreSQL. Let's choose that and keep scrolling. You have an option to choose a different version of PostgreSQL. You're going to want to check whatever docs for whatever server you're using in case there's some sort of compatibility issue. We're going to leave this as whatever the default is.
[2:24] This is important here for templates. RDS can get very expensive very quickly. Be sure to play with these parameters to set these options to be the cheapest or closest to free that you can get while you tinker around with RDS. We're going to choose dev/test. If we scroll down, we can set up some of the basics.
[2:47] We're not even actually going to use this database for anything. We can just name it whatever we want. I'm going to name this Egghead Test DB. We can set a username and password. I'm just going to make this super simple because we're not actually going to connect this to anything.
[3:04] Then when we scroll down, we can set the different types of instance classes. Instance classes are basically just the speed and power and memory of the database.
[3:16] Some factors that you consider when you're setting up a database are how quickly you can access the data and how much of the data you can send back and forth to your server. We're just going to leave this as the standard.
[3:29] We're also going to leave the storage as the standard, which is 20 gigabytes. One thing that's very cool about RDS is that it can do this storage auto-scaling so that the database can actually grow if you fill it up.
[3:46] This is partially so that you don't crash your database by accidentally filling it to capacity. You can set the actual threshold of this so that you don't inadvertently rack up endless charges just growing your database with more and more data.
[4:00] We can just leave this as is because there's no way we're going to get even remotely next to 20 gigabytes since we're actually not using this database. You can also set up some availability and durability.
[4:11] This just means that we can basically have a standby database in another part of the world in case our database goes down. That way we don't lose our data or lockout users or anything like that if we had a big spike.
[4:27] Of course, since we're just using this for a demo, we don't actually need to do this. There's in this Connectivity section. One thing you have to consider when you're creating databases is, who is going to access it? What resources are going to access it?
[4:42] Most of the time, you're not going to put a database anywhere that has public access. You're going to want to connect to your database through a server. You're going to want to make sure your server has access to your database.
[4:55] You can set up these private Clouds and put your databases and your servers in those Clouds. We'll leave this database authentication as the default. You can see here that if we were to leave all of this as is, our total monthly cost would be $118 which of course, is quite a lot.
[5:17] We're not going to keep this database up for a month. In fact, I'm going to delete this as soon as I'm done recording this. I'm going to go ahead and hit Create Database and it usually takes it a little bit to create the database. I'll go ahead and fast-forward a few minutes.
[5:35] A few minutes later, our database has been created. You can see it in this list over here. If I scroll over, you can see a bunch of different pieces of information about the health of the database and the status of the database and where to find it. Then, if I click into the Database Item here, you can see there's a number of other things I can do.
[5:55] The most important thing that you're going to need as a developer is this endpoint here. You're going to need to copy this and use this as the connection string to whatever server is going to be hitting this database. You'll see that we also need the port, which is 5432.
[6:12] When it comes to connecting databases to servers, there are some networking and security things that you're going to need to learn. That would be the next place I would go with learning RDS and setting up servers is that networking and security piece, how to actually connect the server to the database.