0
988views
System design for modern web apps - Microservices architecture
1 Answer
written 3.5 years ago by |
Broadly, web apps have two requirements:
Microservices should do a single job and ideally have their own data source.
Let's take an example:
Service Name | Input | Output | Data Store |
---|---|---|---|
Login Service | username + password | session token | mysql server |
Streaming Service | movie id + authentication from Login Service | data transfer connection to your device | big data system |
Recommendation Service | user model | movie names | mongodb |
Monthly subscription Service | user plan | true or false | mysql server (User can be duplicated from Login datastore but carefully) |
Problems with Monolithic system:
Benefits of Microservices:
Microservices should talk to each other. There are various ways in which this can happen
[GET POST PUT DELETE] endpoints + authentication (No session, use jwt-token)
queues + workers combinations
Queue pushes the message to
↓
// Amazon lambda function
function send_email(emailid,message_body):
email.send()
Microservices definitely shine in a few usecases where the coupling between systems is low and the sheer scale is huge. However, it's not one-fit-all
solution.
Like every bridge is different from other; so is every web app!