From the course: Amazon Web Services: Data Services

Explore AWS RDS MySQL - Amazon Web Services (AWS) Tutorial

From the course: Amazon Web Services: Data Services

Start my 1-month free trial

Explore AWS RDS MySQL

- [Instructor] In the Amazon RDS console, we can create a database by using this button or we can restore from files in S3. We're going to create a database. We have many options here. We can use Standard Create or Easy Create. Easy create is quick for getting us up and going for just learning. But we should only use it for learning purposes not for production. We have a number of engines to select from. We can use open source MySQL or its alternative MariaDB, or an optimized version of MySQL specifically for Amazon called Amazon Aurora. Scales much higher than MySQL and is much more performant. We also have the option of open source PostgreS and that is also optimized for Aurora, that's a relatively new feature. Or we can use licensed relational database engines such as Oracle Or SQL Server. Now if you select either of these two, then you're going to have to pay a licensing fee to Oracle or SQL Server as well. Microsoft in the latter case. So we're going to go ahead and select MySQL. And we're going to select Free Tier. Notice we have Production Dev Test and Free Tier. Just go with the default database instance, the master username, and we'll put in a password. And we're just going to click Create Database. Now this is often used also for applications. I've worked with a lot of students in hackathons. And they all use a MySQL instance just as a relational transactional data store. And it works great for that. There is a continuum of features in RDS. Everything from really a toy database for just doing, you know, quick throwaway, minimal, viable products for hackathons and startups. All the way to serious production level databases. So one of the key aspects of working with RDS is selecting the appropriate configuration. Now in the console here, you have a data or DevOps focus. For the server-based instances, so everything from MySQL to SQL Server, you would then have to get the appropriate database client. So in the case of MySQL, something like MySQL Workbench. Which is a free client. So you'd have to install that, configure it and connect to it. Now, as we'll see, in the newest implementation of RDS, Aurora Serverless, there actually is this included Query Editor, but it only works with Serverless. All the other instances, you have to get a client. Now this is creating. And so while it's doing that, I'm going to show you some of the DataOps capabilities that you can see in this console. So we have the ability to look at performance insights, which is Amazon recommending sizing in terms of your cluster. And there's a reason that it's near the top. Because as I was just saying, in production, this is the thing that a lot of customers get wrong. Because it's difficult to know the right EC2 instance sizes, the right size of your cluster, the right amount of memory and CPU and all that kind of stuff. And so even though there's lots of counters and monitoring and logs available, this is a pretty new capability, where Amazon will recommend to you if you should size up or size down your cluster. And it's pretty important for proper performance and saving money. Snapshots is similar conceptually to when we just looked at EBS file backing for EC2 instances and snapshotting those files. That's the same type of idea. That you take the files that are associated in the compute here. And then if you shut down the Compute Engine, you just save those files out in an S3 bucket basically, so that you can recreate. Now along with that, this is partially managed. So you have the ability have automated backups. Which for a lot of my startup clients, they love, they don't have a DBA. And so they just use RDS. And they have automated backups, and automated performance insights. Reserved instances can save you a lot of money. If you're moving a production workload, you have a really large cluster. And you know, it's a regular workload of CRUD operations. Inserts, updates, and deletes. Its your transactional workhorse database system. So if you know and you have a predicted workload, you can reserve instances and you can pay a lot less for the service. And this is a capability that I help customers save hundreds and even thousands of dollars with. Proxies is around connecting. And then subnet parameter and option groups and availability zones are around security, very important to properly secure. One story from the real world I would tell you is that I've seen many a dev group unfortunately, just for their own convenience, make their database publicly available, and I've seen a couple of times where there's crawlers out on the internet looking for that port to be open for the particular database, and there'll be Bitcoin mining. That will happen within 15 minutes, and then Amazon will shut you down. So you don't want to do that. And here we have events, events subscriptions and certificate updates. Now you can see that we're still in the creating state. So I'm going to go ahead and click in here and see what we've got. Inside of here, we have some administration. So we can see that the system is still being set up because we don't have the endpoint and the port information, but we do. We're operating in a VPC. And then we will have monitoring. And we have basic monitoring in here. So CPU DB connections, memory, read-write. So we can size our cluster. We can compare instances. And of course, we can go out to CloudWatch and look at the actual logs if need be. Here's a summary of the logs. When here we can set up CloudWatch alarms. This will be our configuration. And then we have maintenance and backups inside of here. So you can see this is, Consoles are really focused, like I said, for DataOps or DevOps. The idea is that you are administering this or you're looking at the administration of the system to see if it's sized properly, if it's running properly. And then we have the typical Amazon tags. And it's telling you here, might take a few minutes to launch. Typically, it does take between five and 15 minutes to launch. So what we'll do is we'll go ahead and pause this and when it's launched, we'll come back in and take another look. Alright, now we can see that are instances available. And we have some actions that we can do here. We could stop, reboot, delete. We could create a read replica, we could create an Aurora read replica, because again, Amazon's encouraging their customers to move from MySQL to Aurora. It's optimized, for their ecosystem. You can take a snapshot, restore to a point in time or migrate a snapshot. Now you might be wondering, how can you restore to a point in time? This is a relatively new feature. And I really love it. It's something we've had in the license database world for a long time. But again, we're working with MySQL. So when this instance was created, one of the things that it does is it backs it up on Create. So if I go into the backups here, you can see here is a backup. And I could restore to a point in time. Relatively new feature and a great feature actually. So I wanted to point it out. Also, in here, of course, now we have all of our endpoint information that we would use for our client to connect. So we get a Client Connect here by specifying in the security group configuration which is here, a rule for wherever we're connecting from. So the IP address of our laptop for example, for this particular port. You'd have to set that up for whichever client you would use. And then you could work with your SQL statements from a developer standpoint. Also, I want to end this by saying that notice here you can modify. And you really get the advantage of the elasticity of the cloud. And this is a great capability because you basically just pay for more usage. If you need bigger servers or whatever it is, you just can scale up or you can scale down. And again, that relates back to these performance insights. So setting your RDS cluster to the appropriate size is a key aspect of using the service correctly.

Contents