I want some advice regarding my architecture and hosting options. I'm attempting to build an e-commerce site for e-books. It will use nestJS for the backend and ReactJS+Typescript for the frontend. Postgresql will be the DB. I want to use Elasticsearch to provide search capabilities.

Initially, I thought to host each of these projects in their own server. But since I'll be using Elasticsearch for the portion most in need of scalability; I can put the front and back ends on the same server. Something akin to this: enter image description here

I would still need the backend as a separate project to perform user authentication and other utilities.

Does this make sense? Would a monolithic architecture work better in this case? I'm not serving multiple frontends nor would backend API be public. Maybe it will present an issue if I succeed with this and think of making a mobile app.

I was thinking of starting with the digital ocean as my hosting platform; I'd need three servers at minimum (DB, es, and front+back-ends).

I would love to read your insights.

1 Answer 1


A microservice architecture is about which services can be independently built, tested and deployed. There is no requirement to host each microservice on it's own server. The difference is that you could host one on their own server whereas in a monolith, all services must be deployed together.

Draw your service boundaries along domain boundaries.

  • So one domain would be book related functions, another is user operations, and so on? I'm just not certain a microservice architecture applies as well in the way I laid out the web app.
    – Ketra
    Mar 5, 2020 at 4:27
  • Just because everyone is talking about microservices doesn't mean it's really the only thing that matters. Especially if you don't expect a monthly user growth of several thousand, it's perfectly ok to build the application as a monolith first and use Domain Driven Design there, for example, then it's easier to migrate to microservices later on.
    – Darem
    Nov 25, 2021 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.