Week 2 | Microservices
June 8, 2020Since we know that we’d be using MongoDB as our database, is just now a matter of choosing a language and framework. I have previous experience with Node.js and I know it plays well with MongoDB as JSON is native to both, so I decided to go with Node.js. Node.js is not enough to create a REST API, adding a framework would speed the development process. While I know of Express, I decided to look into other frameworks to see if I can learn something new. However, after looking into other frameworks, I decided that Express would be simple and easy enough to easily develop a prototype while allowing expandability. What I like most about Express is the use of middleware as a way to add simple functionality for the entire web application or for individual routes. I can see myself using middleware in the future to add more features such as authentication.
For development, I used docker to have MongoDB on my local machine and to test my Express application. Docker uses “containers” so that one can easily bootup something like a database without having to install a server themselves. What is nice about docker is that I can easily deploy it without changing much and expect the same functionality.
This week was mostly getting my development set up and relearning Node.js, Express, and MongoDB. I used resources on freeCodeCamp.org to help me with this.
After some relearning, I went ahead and started working on prototype for the microservice and this mainly consisted of implementing the schemas from the data model and setting up endpoints.
Next week, I plan on adding unit tests (which I’ve never done for a web application) and practice deploying it to a server.