Skip to content

Commit

Permalink
docs: 📚️ wip database docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderl19 committed May 14, 2024
1 parent 3cf6225 commit ad358af
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
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.

0 comments on commit ad358af

Please sign in to comment.