Databases - garageScript/databases GitHub Wiki

Intro

A list of Database related items

Setup

A list of setup instructions for each database!

MongoDB

NOSQL database.

  • Installation Instructions - Install. Hint, journalctl -u mongod.service to show logs.
  • How to create admin user
  • After creating an admin user (or after installation), you may encounter issues starting mongodb. Turns out to be a permissions issue. The linked problem statement is the same problem we had and the solution worked.
  • In our codebase, we used the mongodb service.

Node-Postgres

Node-postgres click here to setup and perform queries on the tables.

Postgres Tables

User

id username password dbpassword email email_confirmation password_reset databases (array?)
1 alopez ##(COEAUO mywonderful [email protected] raoheuroacheu4 (empty) mongodb,postgres
2 paul ##(COEAUO mywonderful [email protected] (empty) (empty) mongodb
3 kimong ##(COEAUO mywonderful [email protected] (empty) (empty) neo4j
4 song ##(COEAUO mywonderful [email protected] (empty) (empty) mongodb, neo4j, postgres

Column Descriptions

  • id: Primary key
  • username: string > 1 characters
  • password: Encrypted and salted with bcrypt
  • dbpassword: Stored in plain text string
  • email: Stored in plain text string
  • email_confirmation:
  • password_reset: token string encrypted by server secret. We encrypt it with user's email and expiration timestamp (24 hours) for security.
  • databases: comma separated string of the databases we support. To allow for unlimited growth, use TEXT data type.

Indexes - Create indexes on these columns to make lookups fast.

  • email: users are logging in with email