Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Provisioning Docs #14

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pages/guidebook/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"getting-started": {
"title": "Getting Started"
},
"infrastructure": {
"title": "Infrastructure"
},
"processes": {
"title": "Processes"
},
Expand Down
4 changes: 4 additions & 0 deletions pages/guidebook/infrastructure/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"guides": "Guides",
"reference": "Reference"
}
4 changes: 4 additions & 0 deletions pages/guidebook/infrastructure/guides/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"provisioning-pg-database": "How to Provision a Postgres Database",
"provisioning-dev-database": "How to Provision a Development Database"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Steps, Callout } from "nextra/components";

# How to Provision a Development Database
36 changes: 36 additions & 0 deletions pages/guidebook/infrastructure/guides/provisioning-pg-database.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Steps, Callout } from "nextra/components";

# How to Provision a Postgres Database

This guide shows you how to provision a new Postgres database within our [RDS database server](/guidebook/infrastructure/reference/rds-postgres).

{/* This guide is written with the assumption that user is familiar with SQL and / or a management tool like pgAdmin. */}

## Steps:

<Steps>
### Create Database

<Callout type="info">
The root postgres user credentials can be accessed by Project Chairs via the password manager.
</Callout>

Create a Postgres database within our RDS database server, with the owner being the `postgres` user.

### Creating Roles and Users

The `<project>_dev` group is the parent group of devs and should be created with READ, WRITE, and EXECUTE permissions on the dev / public schema.

#### `<project>_lead` Group

**This group should exist for all databases.**

This is the parent group that project leads' database users inherit their permission from.

#### `<project>_prod` User

**This group should exist for all databases.**

This is the databse user used to connect from the production deployment.

</Steps>
3 changes: 3 additions & 0 deletions pages/guidebook/infrastructure/reference/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rds-postgres": "RDS Postgres"
}
29 changes: 29 additions & 0 deletions pages/guidebook/infrastructure/reference/rds-postgres.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# RDS Postgres

ICSSC projects use a single [AWS RDS](https://aws.amazon.com/rds/) Postgres server that contains many of our databases. Currently, [API](/ppapi), [ZotMeet](/zotmeet), [ZotNFound](/zotnfound), [Corporate Dashboard](/special-projects/corporate-dashboard), & Fellowship Rewrite use this database server.

## Reasoning

Refer to the Postgres Glossary to learn the difference between a Postgres server and database. Using a single Postgres server allows us to reduce cost and increate performance at our scale. This allows all our projects that require a relational / SQL database to share and pool their resources, compared to having seperate instances per project.

## Databases

### Roles / Permissioning

#### `<project>_dev` Group

**This group should exist for all databases.**

This is the parent group that individual members' database users inherit their permission from.

#### `<project>_lead` Group

**This group should exist for all databases.**

This is the parent group that project leads' database users inherit their permission from.

#### `<project>_prod` User

**This group should exist for all databases.**

This is the databse user used to connect from the production deployment.
Loading