OPS345

Databases On AWS

Eric Brauer

Introduction To Databases

When a spreadsheet just isn’t enough… You need a Database!

An organized collection of data, especially data that is shared. Usually controlled by a Database Management System (DBMS).

Databases At A Glance

  • The one we’re learning about is MariaDB, which was forked from MySQL.
flowchart TD
    A[DBMS] --> db1[Database 1] 
    A --> db2[Database 2]
    db1 --> t[Table 1]
    db1 -->t2[Table 2]
    t --> c[columns and rows]

How AWS Handles Databases

  • AWS provides a special type of instance called a Relational Database Service.
  • We will connect to this RDS over the network and manipulate by installing the Mariadb client on our instance.
  • Note the message about database passwords. Lax security has caused many a bad day for professionals in our field!
  • Take heed 💀

Availability Zones

  • In short, Amazon maintains its infrastructure in multiple areas around the globe. Users who are geographically closer infrasture will experience better performance.
  • Availability Zones are a way to logically present this concept.
  • Setting up services in multiple availability zones is also a way to increase reliability (For example, if a specific data centre experiences an outage).

Setting Up An RDS Instance

  • Install mariadb package on your www instance (you will need to use a temporary elastic IP).
  • Find the endpoint of the RDS.
  • Security Group needs modification yet again. Inconvenient but necessary!
  • Note: -pyourpassword is not a typo!

Connecting To Your RDS Instance

Again, it should be noted that this is not a database course. But try to approach the instructions with our previous diagram in mind:

  • When we log in to our DBMS, we first see a list of databases.
  • When we use a database, we then can see the tables that are inside.
  • Each table has a list of fields, which we can specify using SELECT.

Database Permissions

  • Data is incredibly valuable, and must be protected. So DBMSes have security built in to them.
show grants for 'dbroot';

NextCloud

This is a Cloud Service that is similar to Google Drive, OneDrive, Mega, Dropbox, etc. Only difference is, that instead of relying on Google, MS, or whoever, this is a file service that you have to set up and administer.

NextCloud will use a database to store our data.

Installing NextCloud Server

  • The steps involved are fairly straightforward, as long as you pay attention.
  • There are multiple users and passwords in use here: The user for your instances, the user dbroot and myseneca for MariaDB, and the admin user for NextCloud.
  • Take notes, and try not to get confused!

Cleanup

  • Don’t forget about that temporary elastic IP…