I'm trying to build Restful API's using NodeJs for a e-commerce application with a minimal functionality like User Accounts, Products, Inventory System, Cart/ Orders, Payments, Wallet/Credit, Delivery Management, Notifications etc.
Yes, I wanted to do this with microservice approach, (It may add more components / features like services etc)
No, I do not want to use a microservice framework here, I want to explore and learn.
How should I structure?
How should I divide features/ functionality as a service?
How should I use the common features like user model, or (products, inventory and orders).
I'll really appreciate and thank for helping on this subject.
Atul Sharma
Full Stack Developer | Cloud Native Applications
What is the issue ?
Its pretty straight . What micro-services architecture suggests is to develop independent services that are stateless and can exchange data with each other.
You need to create independent services ( Rest Gateways / Web Sockets / Messaging Queue based communication .... whatever method you want to keep as communication between these endpoints. ). Its always suggested to keep different Databases for different services or if load is pretty high its suggested to use different machines for different services under same /different network.
Here
Passenger Managementis a micro-service. Similarly ,Billing,Driver Managementall are separate independent micro-services with their respective API endpoints.You can always use different languages to build different micro-services.
Micro-services architecture is pretty great But, always ensure your communication between these endpoints is secure. If your endpoints are not using any sort of authentication they are vulnerable to compromise if your internal network got compromised.