Externalizing persistence with MongoDB
Persistence will be dealt with in more depth in the next chapter, but still, you will see the choice of a NoSQL approach is absolutely clear in our situation, since the APIs are going to receive standardized, structured serializations of the business entities. I could use other document-based NoSQL databases, but MongoDB has become quite a de facto standard (the Mongo grammar is implemented by MongoDB but also other databases, such as Azure Cosmos DB), so this is what we are going to set up here.
Choosing between local and online storage
Once the type of database is chosen, the next decision is about its location. We could go all the way toward externalizing the database and choose a free tier in Atlas or Cosmos DB, which are basically MongoDB as a service, but for the sake of simplicity, we will simply start a Docker container with MongoDB inside. Again, once the prerequisite Docker is active, this is done with just one line:
docker...