Reetu Raj

#2 Structuring the Database

This post is mostly about the backend (database). I am using MongoDB for this project, which I have touched on in a previous post 🔗 here. Learn more about it below.

Why do I use MongoDB?

We also chose MongoDB for its flexibility and scalability, which are perfect for rapid prototyping. Initially, our schema design is not finalised, and MongoDB allows for quick iterations and adjustments as project requirements evolve. And most importantly, I am familiar with MongoDB, I have previously built a couple of projects with it.

Database Modelling

I am uncertain about how to model our document. Despite knowing that our model will soon change, I initially opted for an Embedded Data Model (EDM), which places all related data in a single document.

database modelling

Database Modelling

Setting Up Routes and Controllers

With the above database model created, I am now setting up multiple routes and controllers to handle API requests and responses accordingly. So far, I haven't implemented authentication, so all the routes are currently open.