Next.js Discord

Discord Forum

Microservices

Unanswered
Papa Johns posted this in #help-forum
Open in Discord
In nextjs, is it possible to create microservices that being handled by docker.

#help-forum

25 Replies

I want to create a project where I want to use microservice based architecture
but I don't know how I can use nextjs in that format
Next.js is just a web app like Python Fast Django, Rails, Go Gin, Rust Actix and so on. Microservice means usually Kubernetes containers on AWS, GCP and Azure.
Great black wasp
Nope microservice just mean your service(api) is decoupled run on it own
sure. It depends on context. to answer the OP question in ur definition, APIs can be decoupled across CF and AWS lambda.
Great black wasp
Yeah nextjs just bring frontend and backend together far from being a microservice
@Great black wasp Yeah nextjs just bring frontend and backend together far from being a microservice
Next is an expansion of IAC. It's already a microservice, but you can add additional microservices as needed
I notice that you mensioned Docker in your question. If you want a Next.js image a part of microservice. yes. you can. in fact i run it on GCP k8s along with Rust, Go and Python services.
If you want to split up the code, you can use multi zones as well
https://nextjs.org/docs/pages/building-your-application/deploying/multi-zones
cool
interesting this could be micro frontend as well as backend.
As Next can handle backend and frontend, I was thinking how I can modularize the apis about based on the functionality or the module. Mainly these can be handled using containerization so that each module is independent and does not affect any other service at the time of crash. next js being microservice itself, the entire web app is down if even the api part is down which clearly is not the concept of microservices.
each service working must be independent of others.
Ur definition, you can go with Vercel multi-zone, k8s on AWS, GCP and Azure. Indeed Vercel gateway itself runs on k8s on AWS.
see creating a microservice and deploying on a microservice are two different things.
I want to create one using nextjs. If there are any example projects created in microservice architecture please let me know.
i am not sure exactly what you want but as i said it is possible to deply a Next.js docker image as one of microservices that runs on k8s cluster or managed service like Cloud Run.
Next.js JS codes itself does not have mechanisms that k8s has such as spinning up instances, autoscaling, health check and so on.
In fact, Vercel relies such mecanism on Cloudflare(V8) and AWS lambda(Node.js).
Azure Static Web Apps and AWS Amplify have full support for next.js, and you can easily proxy back to other services. You don't need micro frontends, really. Just a good design and product structure.
i know. as i said, you can specify runtime, V8 or Node.js, in JS codes. my comment was not a bit precise, so modified as such.
is it possible to have a call?
like a group call where I can properly explain what I am trying to do.