Skip to content

CockroachDB v1.1.4 triple-node database for storing medical patient information.

License

Notifications You must be signed in to change notification settings

nwHacks2017/database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LifeBand (nwHacks 2017): Database

By Luminescence

Build Status License

CockroachDB v1.1.4 triple-node database for storing medical patient information.

This repository contains the setup, configuration, and scripts to automate operation and usage of the database for the Lifeband project.

Setup

Install CockroachDB.

Create encryption certificates prior to startup for secure access to the database:

./setup-teardown/setup-certs.bash

Start up the 3 database nodes on ports 26257, 26258, and 26259:

./start-stop/start-nodes.bash

Set up the database users and tables, and initialize some mock data:

./setup-teardown/setup-database.bash
./setup-teardown/create-mock-data.bash

Usage

To open the database shell and execute CockroachDB-compliant SQL commands (using the generated certificates), run:

./runsql

You can also pass in the name of a SQL file to execute - for example:

$ echo "SHOW USERS;" > test.sql
$ ./runsql test.sql
0 rows
username

To connect the database to an application, use:

  • The user janitor_dev with the SSL cert ~/cockroach/certs/janitor_dev.cert and the SSL key ~/cockroach/certs/janitor_dev.key (for the development environment), or
  • The user janitor with the SSL cert ~/cockroach/certs/janitor.cert and the SSL key ~/cockroach/certs/janitor.key (for the production environment)

Teardown

If you want to remove the tables, make sure the nodes are running and execute:

./setup-teardown/teardown-tables.bash

When you want to shut down the nodes, run:

./start-stop/stop-nodes.bash

If you want to permanently remove the nodes, storage, and certs, make sure the nodes are not running and execute:

./setup-teardown/teardown-nodes-and-certs.bash

About

CockroachDB v1.1.4 triple-node database for storing medical patient information.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages