8. Create PostgreSQL Database

  1. From the left-hand navigation of the Digital Ocean dashboard, under the Manage section, choose Databases
  2. Click on Create in top left, then in pull-down choose Databases
  3. Under Create a database cluster, choose PostgreSQL 11; choose a node plan - if you are going to have high-volume traffic, you will want more memory/CPU/disk space. For testing, you can choose the 1G/1CPU/10GB Disk plan.
  4. Choose the datacenter where your Stream Manager droplet resides. db01
  5. Under Finalize and create choose a unique database cluster name (or accept the assigned name) and select your project, then click on Create a Database Cluster. db02
  6. After the database is provisioned, you can secure and configure the database cluster. NOTE: this can take 10-15 minutes, so now is a good time to get up and stretch your legs.
  7. Add trusted sources - from the Overview tab, cilck on Secure this database cluster by restricting access. in the TRUSTED SOURCES section. Click on the Edit button next to Trusted Sources. Find your stream manager and your terraform server in the Add Trusted Sources pull-down; you can also add your IP address if you wish. Then click on Allow these inbound sources only.
  8. Make a note of the time for scheduled updates; if you want to change that time you can modify that in settings.
  9. Click on the Users & Databases tab. Add a new database called cluster. Note: this database will be populated by the Stream Manager at startup. db05
  10. Add an autoscaling admin User account to the database. A secure password will be generated - make a note of that password (or you can reset it if you like).
  11. Add two new databases: cluster and terraform. Note: these databases will be populated by the Stream Manager and Terraform at startup. db04

Database Connections

You will need 3 database connections for each node (origin, edge, etc). In addition, each incoming publish and subscribe request queries the database, so for production traffic you will likely want to choose the highest available database node type.

NOTE: For production it is suggested that you also enable a standby database node.