I'm learning micro services architecture for NodeJs, as much i know about micro services is mentioned below:
- ms architecture have different types of services.
- each service will have it's own DB.
- each service will contain full NodeJs project.
- each service will communicate through calling API endpoints of each others.
- each service should be able to deploy independently.
If anything is wrong or i missed up so please let me know.
My main question is like if we have 2 services, one is video service and another one is user service. Video service has model Videos and User service has model Users. Videos model will have a userId of the user who uploaded it. Now i want create an API which will return all the videos, each video object will have a sub object of user (who uploaded it) in behalf of that userId like given sample code. but now both Videos and Users model are exist on different databases, so how i can achieve this?
videosList: [
{ id: 1, name: "Video 1", userId: 11, userObj: {...} },
{ id: 2, name: "Video 2", userId: 20, userObj: {...} },
{ id: 3, name: "Video 3", userId: 15, userObj: {...} },
...
]