Learn AWS RDS Now!
Tags: aws, rds, beginners, cloud
Published: 2023-05-19 10:38:15

![meme of databases](https://media.giphy.com/media/GbH8vRmrNHdVZhouBt/giphy.gif)

I "recently" finished Andrew Browns 'Week 4' of his AWS Bootcamp! In this bootcamp we were creating a Twitter clone website, utilizing AWS. The topic for the week was... You guessed it, RDS! I wont be going over how to do all of these, but I will go over some good takeaways I learned from my mistakes. **_Spoiler alert:_** it was a lot of human errors.

## I learned how to:

1. Provision an RDS instance via CLI!
2. Create a Postgres DB using CLI shortcuts
3. _Troubleshoot_
4. Learned to write and use BASH scripts ( _SHEBANG_ )
5. _Did I say Troubleshoot yet? Because I did a lot of that._
6. Implement a Lambda that runs in a VPC and commits code to RDS
7. Programmatically update a security group rule
8. Operate common SQL commands
9. Create AWS Cognito trigger to insert user into database **(Headache!)**

_"Yeah, yeah, cool you learned a lot, but what is RDS? and why should I care?!" 
      -you_, the reader.

## What is RDS?

A web service (Relational Database Service) that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.

Here are some examples of how companies use AWS RDS.

- **Expedia** uses AWS CloudFormation with Chef to deploy its entire front and backend stack into its Amazon Virtual Private Cloud (Amazon VPC) environment. Expedia Group uses a multi-region, multi-availability zone architecture with a proprietary DNS service to add resiliency to the applications.

- **Unilever** used AWS Service Catalog to scale its database-as-a-service platform, facilitating simple database deployments, management, and support with a lean team of engineers.

Some benefits of using AWS RDS for companies like Unilever and Expedia include:

- **Scalability:** RDS allows companies to easily scale their databases up or down as needed with simple API calls or a few manual changes from the AWS Management Console.
- **Reduced Database Administration:** RDS handles routine database management tasks such as provisioning, backup, recovery, repair, patching, and failure detection. This frees up time for developers to innovate for their customers.
- **Cost Savings:** Companies only pay for the resources they use with RDS, without up-front investments.
- **Increased Agility and Resiliency:** By using AWS, Expedia Group has become more resilient and its developers have been able to innovate faster while saving the company millions of dollars.

## Troubleshooting Issues:

![monkeyangryatcomputer](https://media.giphy.com/media/T8Dhl1KPyzRqU/giphy.gif)

We all encounter issues in all of our jobs or tools we use. Whether you are a pro or a beginner (N00b) we all have done something dumb to sometimes be the cause of said issue. The important thing is to remember it and learn from it!

Here are just a couple of the things I learned.

1. Ran into lots of issues with the Postgres table not pushing to the website backend. I later found through the very helpful discord that someone else had the same connection pool error that I had, however, my issue was simply I had forgotten to re-compose up my docker image after making changes to the docker compose file. Do not forget to double-check the "little things"!

2. I recently came to the realization that I had forgotten to turn the instance back 'on' after creating a new database named "2". It was a simple oversight on my part, but I will make sure to be more mindful moving forward.

3. Next issue: syntax, a simple extra word can screw up your code and thus I spent 20+ minutes trying to figure that out...

4. Last issue: In AWS lambda our lambda had an environment variable for my 'CONNECTION_URL' that was not fully correct. Checking docker logs and Cloudwatch logs to find the issue it ended up being that I had some syntax error, always double-check your Environment variables! In my code it is `'CONNECTION_URL = PROD_CONNECTION_URL = "XXX" '`. However, in the AWS console Lambda portion, it doesn't need the 
`" = PROD_CONNECTION_URL"` portion, just the value afterwards! After I cleared that up, the user I created (via AWS Cognito) was able to connect with the Postgres table and fill it in with user info! ( had some help from the boot camp Discord - someone else had the same problem, I tried to fix it myself at first but alas I went looking for help - do not deny yourself help when you need it)

Although this "week" took me more than a week( LOL), I managed to finish it, and although I won't be finishing the boot camp I will continue with my fundamental cloud studies(Linux, Networking, AWS). I have learned so much in the "5 weeks" of instruction that was provided by Andrew Browns AWS bootcamp! 

Sorry for the long post! Thanks for reading!! Follow for more cloud/tech-related content! Please comment to let everyone know how you use RDS if you do!