-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduces MongoDB as the primary Database, as well as: - Migration scripts that run after next deployments; - A script and a data structure for importing development data (this data can be used for development and for e2e tests); - A CLI script that makes it easy for developers to start a MongoDB locally with development data; - An ADR about why we choose MongoDB. --------- Co-authored-by: Jasper Herzberg <[email protected]>
- Loading branch information
1 parent
01ff617
commit 0affebe
Showing
17 changed files
with
2,952 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
PORT=$PORT | ||
MONGODB_URI=$MONGODB_URI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
const { composePlugins, withNx } = require('@nrwl/webpack'); | ||
const CopyPlugin = require('copy-webpack-plugin'); | ||
|
||
module.exports = composePlugins(withNx(), (config) => { | ||
config.plugins.push( | ||
new CopyPlugin({ | ||
patterns: [{ from: 'src/.env', to: '.', noErrorOnMissing: true }], | ||
}), | ||
); | ||
|
||
return config; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# ADR005: Database Selection - MongoDB | ||
|
||
## Status | ||
|
||
accepted | ||
|
||
## Context | ||
|
||
We are in the process of selecting a suitable database for the project. In | ||
general, we need for a database that allows for fast development and changes, | ||
integrates well with the NestJS framework and is cost-efficient without a vendor | ||
lock-in (possibility to self-host). | ||
|
||
## Decision | ||
|
||
We have chosen MongoDB as primary database. | ||
|
||
**Fast Development and Changes:** MongoDB's schemaless nature allows for rapid | ||
development and changes without the need to define a fixed schema upfront. This | ||
flexibility enables us to iterate quickly and adapt to changing requirements. | ||
|
||
**Azure CosmosDB with MongoDB Adapter**: The availability of Azure CosmosDB with | ||
the MongoDB adapter provides a convenient way to use cloud resources with the | ||
option to easily opt out if needed. This aligns with the goal of leveraging the | ||
available Azure credits and taking advantage of cloud-based features such as | ||
managed backups. | ||
|
||
**NestJS Integration**: MongoDB has first-tier support in the NestJS framework, | ||
which means it is well-integrated and supported out of the box. This simplifies | ||
the development process and reduces the effort required for integration. | ||
|
||
**Widely Spread Database**: MongoDB is a popular NoSQL database with a large | ||
community, which makes it easy to find resources and contribute to the project. | ||
|
||
## Consequences | ||
|
||
Next to positive factors already pointed out above, it might be complex to model | ||
our data in a way that we have the complete safety of a Relational Database. | ||
Even though MongoDB offers ACID transactions, this is not the "NoSQL way" of | ||
managing related data. The possible consequence is, that we have to often | ||
migrate our database, since it takes time to get into the mental model of NoSQL. | ||
Furthermore, the danger of Azure CosmosDB not providing the latest features of | ||
MongoDB is also given. The danger of having non-compliant queries is given, but | ||
rare since Azure CosmosDB widely supports most of the MongoDB specifications. |
Oops, something went wrong.