Running a MongoDB Server
The API we've built so far is not connected to a database. For a real-world application, we need to use a form of data storage; otherwise, data will be lost if the API crashes or the server hosting the API goes down. MongoDB is one of the most popular NoSQL databases.
The following schema shows how MongoDB will be integrated into the API architecture:
Before we get started, we need to deploy a MongoDB server. There are plenty of deployment options:
- You can download the MongoDB Community Edition binary from the following URL: https://www.mongodb.com/try/download/community. Select a package based on your OS:
- You can use the MongoDB as a Service solution, known as MongoDB Atlas (https://www.mongodb.com/cloud/atlas), to run a free 500 MB database on the cloud. You can deploy a fully managed MongoDB server on...