Today we are going to look at running Schema as a Service using Amazon AWS as your IaaS foundation. Yesterday we looked at Schema as a Service using Oracle DBaaS. To quickly review, you can run a schema in the cloud using apex.oracle.com for tables upto 25 MB for free or cloud.oracle.com for tables of 5 GB, 20GB, or 50 GB for a monthly fee. You do not get a login to the operating system, database, or file system but do everything through an html interface. You can query the database through an application that you write in the APEX interface or through REST api interfaces, both of which are accessible through http or https. Today we are looking at what it takes and how much it cost to do the same thing using Amazon AWS.
Amazon offers a variety of database options as a managed service. This is available through the Amazon RDS Console. This screen looks like
If you go to the RDS Getting Started page you will see that you can provision
- MySQL
- Oracle
- SQL Server
- Maria DB
- or an Amazon custom database, Aurora
We won’t go into a compare and contrast in this blog entry to compare the different database but go into the Oracle RDS offerings and look at what you get that compares to Schema as a Service offered by Oracle.
The Oracle database offerings that you get from Amazon RDS are
- Oracle Standard Edition One
- Oracle Standard Edition Two
- Oracle Standard Edition
- Oracle Enterprise Edition
Note that we can launch any version in EC2 but we are trying to look for a platform as a service where the database is pre-configured and some management is done for us like patching, backups, and operating system maintenance, failure detection, and service restarting.
You can launch 11g or 12c version of the Oracle database but it is important to note that through RDS you do not get access to the operating system, file system, or sys/system user. There is an elevated user that lets you perform a limited function list but not all options are available to this elevated user. Some features are also not enabled in the 12c instance
- In-Memory
- Spatial
- multi-tenant or pluggable databases
- Real Application Clusters (RAC)
- Data Guard / Active Data Guard
- Connection to Enterprise Manager
- Automated Storage Management
- Database Vault
- Java libraries
- Locator services
- Label Security
In the 11g instance the above list plus the following features are not supported
- Real Application Testing
- Streams
- XML DB
The following roles and privileges are not provided to users in Amazon RDS
- Alter database
- Alter system
- Create any directory
- Drop any directory
- Grant any privilege
- Grant any role
Before we dive into the usage of Amazon RDS, let’s talk pricing and licensing. The only option that you have for a license included with RDS is the Standard Edition One license type. To figure out the cost, we must look at the sizes that we can provision as well as the RDS cost calculator. To start this journey, we start at the AWS console, go to the RDS console, and select Oracle SE1 as the instance type.
If we select the license-included License Model we get to look at the shapes that we can deploy as well as the versions of the database.
We can use the cost calculator in conjunction to figure out the monthly cost of deploying this service. For our example we selected 11.2.0.4 v7, db.t2.micro (1 vCPU, 1 GB RAM), and 20 GB of storage. For this shape we find that the monthly cost will be $25.62. We selected the 11.2.0.4 version because this is the only 11g option available to us for the SE1 licensed included selection. We could have selected the 12.1.0.1 as an option. If we select any other version we must bring our own license to run on AWS. It is important to look at the outbound transfer rate because this cost is some times significant. If we put 20 GB outbound traffic the price increases to $26.07 which is not significant. This says that we can backup our entire database once a month offsite and not have to pay a significant to get our database off RDS.
It is important to look at the shape options that we have for the different database versions. We should also look at the cost associated with it. For 11g we have
- db.t2.micro (1 vCPU, 1 GB) – $25.62/month
- db.t2.small (1 vCPU, 2 GB) – $51.24/month
- db.t2.medium (2 vCPU, 4 GB) – $102.48/month
- db.t2.large (2 vCPU, 8 GB)- $205.70/month
- db.m4.large (2 vCPU, 8 GB)- $300.86/month
- db.m4.xlarge (4 vCPU, 16 GB)- $602.44/month
- db.m4.2xlarge (8 vCPU, 32 GB)- $1324.56/month
- db.m4.4xlarge (16 vCPU, 64 GB) – $2649.11/month
- db.m3.medium (1 vCPU, 3.75 GB) – $153.72/month
- db.m3.large (2 vCPU, 7.5 GB) – $307.44/month
- db.m3.xlarge (4 vCPU, 15 GB) – $614.88/month
- db.m3.2xlarge (8 vCPU, 30 GB) – $1352.74/month
- db.r3.large (2 vCPU, 15 GB) – $333.06/month
- db.r3.xlarge (4 vCPU, 30 GB) – $666.12/month
- db.r3.2xlarge (8 vCPU, 61 GB) – $1465.47/month
- db.r3.4xlarge (16 vCPU, 122 GB) – $2930.93/month
- db.m2.xlarge (2 vCPU, 17 GB) – $409.92/month
- db.m2.2xlarge (4 vCPU, 34 GB) – $819.84/month
- db.m2.4xlarge (8 vCPU, 68 GB) – $1803.65/month
- db.m1.small (1 vCPU, 3.75 GB) – $84.18/month
- db.m1.medium (2 vCPU, 7.5 GB) – $168.36/month
- db.m1.large (4 vCPU, 15 GB) – $336.72/month
- db.m1.xlarge (8 vCPU, 30 GB) – $673.44/month
For the 12c version we have
If we want to create the database, we can select the database version (11g), the processor size (smallest just to be cheap for demo purposes), and storage. We define the OID, username and password for the elevated user, and click next
We then confirm the selections and backup schedule (scroll down to see), and click on Launch.
When we launch this, the system shows that the inputs were accepted and the database will be created. We can check on the status by going to the RDS console.
It takes a few minutes to provision the database instance, 15 minutes in our test. When the creation is finished we see available rather than creating for the status.
Once the instance is created we can connect to the database using the Oracle Connection Instructions and connect using sqlplus installed on a local machine connecting to a remote database (the one we just created), using the aws connection tools to get status (aws rds describe-db-instances –headers), or connecting with sql developer to the ip address, port 1521, and user oracle with the password we specified. We chose to open up port 1521 to the internet during the install which is not necessarily best practices.
Note that we have fallen short of Schema as a Service. We have database as a service at this point. We will need to layer application express on top of this to get Schema as a Service. We can install APEX 4.1.1 on the 11g instance that we just created by following installation instructions. Note that this is a four step process followed by spinning up and EC2 instance and installing optional software to run a listener because the APEX listener is not supported on the RDS instance. We basically add $15-$20/month to spin up a minimal EC2 instance and install the listener software and follow the nine step installation process to link the listener to the RDS instance.
The installation and configuration steps are similar for 12c. We can provision a 12c instance of the database in RDS, spin up an EC2 instance for the listener, and configure the EC2 instance to point to the RDS instance. At this point we have the same experience that we have as Schema as a Service with the Oracle DBaaS option.
In summary, we can provision a database into the Amazon RDS. If we want anything other than Standard Edition One, we need to bring our own license at $47.5K/two cores for Enterprise Edition or $17.5K for Standard Edition and maintain our annual support cost at 22%. If we want to use a license provided by Amazon we can but are limited to the Standard Edition One version and APEX 4.1.1 with 11.2.0.4 or APEX 4.2.6 with 12.1.0.1. Both of these APEX versions are a major version behind the 5.0 version offered by Oracle through DBaaS. On the positive side, we can get a SE One instance with APEX installed for about $50/month for 11g or $100/month for 12c which is slightly cheaper than the $175/month through Oracle. The Oracle product is Enterprise Edition vs Standard Edition One on AWS RDS and the Oracle version does come with APEX 5.0 as well as being configured for you upon provisioning as opposed to having to perform 18 steps and spin up an EC2 instance to act as a listener. It really is difficult to compare the two products as the same product but if you are truly only interested in a simple query engine schema as a service in the cloud, RDS might be an option. If you read the Amazon literature, switching to Aurora is a better option but that is a discussion for another day.