Challenge Overview
Welcome to the Cloud Hub Database Replacement Architecture Contest. As part of this contest, we would like you to propose how to replace an existing application’s database in MongoDB with PostgreSQL.
Project Overview
Cloud Hub is trying to help their client solve the problem of knowing what software applications they are spending the most money on over time. Cloud Hub will take in data from credit cards and other sources and attempt to show what software the client has and who is using the applications the most.
Contest Overview
Our client currently has an application written in Nodejs that uses MongoDB as its database. Our client however would like to replace their database with PostgreSQL. They understand that most of their data is relational in nature and thus they would like to carry out this transition.
For this contest, we would like you to propose how the existing models and collections can be modelled in PostgreSQL. We understand that the transition will not be a 1:1 mapping from MongoDB to PostgreSQL and thus we want you to propose which tables to create in PostgreSQL and the schema for these tables, including the relations between the tables, if any.
You can find the existing models here: https://github.com/cloudspokes/waterworks/tree/30054274_postgresql_arch/api/models
Thus you need to:
- Deploy the app
- Go through the application. Play around a bit with it and understand what it does and how it works
- Understand the MongoDB collections being used
- Determine the relation between the models
- Decide which tables in PostgreSQL will replace the collections in MongoDB
- Decide the schema of these tables
- Also propose the relationship between these tables, if any
Final Submission Guidelines
The deliverables for this contest are:
- Entity Relationship Diagram
- The SQL scripts to build the tables. Data migration scripts are not expected. Just scripts that will generate the table in PostgreSQL.