Hacker News new | ask | show | jobs
by russianator 2898 days ago
These days you shouldn't use a monolithic architecture IMHO, you should consider creating services or microservices with Node.js to provide API's to a "headless" frontend.

Depending on your "workloads" you can start simple with just API's to support your frontends, and then expand your architecture to include services for other services. You would need to consider whether you need caches (redis) or databases (postgresql, mongodb, etc). All these can be containerised as well.

There are also frameworks such as next.js and nuxt.js which can ease the server side rendering side of things, depending on your choice of frontend view library (React/Vue).

In terms of orchestration and deployment, consider building your services with a Dockerfile.

I've had some success for personal projects using something like Rancher (1.x) for easier orchestration and scaling of containers. But at some stage you might want to learn how to use Kubernetes, since it seems to be the in thing now for container orchestration, scheduling, etc. Rancher allowed me to manage hosts and clusters on multiple cloud providers once I had the Rancher manager node setup.

So it can vary from case to case, depending on what your app actually does, you could still use koa+sequelize + passport for your API's. The above are just my own suggestions.

If you choose to go down the serverless road I would recommend checking out the Serverless framework, which can help you with deving as well as deploying to your cloud provider of choice.

Good luck!

Micro Node.js microservice library: https://www.npmjs.com/package/micro

React SSR framework: https://nextjs.org/

Vue SSR framework: https://nuxtjs.org/

Rancher for Docker things: https://rancher.com/docs/rancher/v1.6/en/

Serverless: https://serverless.com/

1 comments

Thanks a lot for the reply ! Indeed, I was lurking on micro services with go, but never considered applying that to node jsesque apis (feels silly now actually). Your approach seems fair and the way to go. Thanks a lot for the links, will definitely check it out, rancher particularly if it can make the eventual switch to kubernetes easier.