#Breaking two big monoliths to microservices architecture

1 messages · Page 1 of 1 (latest)

azure salmon
#

Hi guys
I have a project i created with two big monoliths , one serving as an api server for my main website, and the second one for the admin website.
For several reasons ive decided to break those two monoliths in to microservices architecture.
From my understanding the best practice is using the nestjs/microservices library and currently for simplicity ive decided to use TCP as the transport protocol between the microservices.
I understand that i need to add another nestjs application that will serve as an api gateway (receiving http requests and acting as a proxy to the specific microservice through TCP).
What i wanted to know is what are some best practices and recommendations for all this process.
Should the api gw validate the jwt tokens kr each microservice?
where should i use the cache layer?
Should i use curcuit breaker?

I will also add that i have another different service which consumes jobs from bullmq, but this is not really relevant.

I would like to get some dos and donts as i want to be able to handle high scales (talking about thousands of users), and if im doing something wrong i would like to learn😇

Thanks in advance

tall burrow
#

First thing you should consider is, you should only move to microservices, WHEN you need to. There is a lot to know and get right, especially on the infrastucture side, to run them properly either via k8s or via an IaaS provider's own system (like AWS app runner or fargate).

Also, we can't teach you all the dos and don'ts of implementing a microservices architecture. If you ask a specific question, we can try to help.

Look into some good reading about microservices or get a course on Udemy or something similar. They can help you best for starting off. If you still have Nest specific questions, we'll be here for you.

azure salmon
#

Hi Scott, thanks for fast reply.
If you have any recommendations on a specific course i would appreciate it.
Anyway, in terms of infrastructure i am working with a devops team that provides all the it, the system already runs on k8s and is pretty scaleable, ive decided to move to microservices because flows like payments, and some other basic flows on my website should always be available and to not be affected by load from other parts of the system.
Of course i dont expect you to teach me all the dos and donts, and maybe ive asked for too much.