Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User as a microservice

I'm working on PAAS solution as a product. we have divided business processes in several microservices. One core part of the processes is closely connected to nearly all microservices.

Is this a good practice to create a separate service to manage data such as user management? After the implementation, only this service will have access to users and other related DB tables. All other services will have to call this new user microservice for user related tasks.

This approach will enforced us to refactor DB schema by adding denormalization. We would not get underlying tables that is served among multiple microservices. If serveral services needs data, it would be shared via a microservice.

like image 331
Saqib Avatar asked Apr 25 '17 11:04

Saqib


1 Answers

I would say yes.

After all, it is typical for user credentials, authorization authentication to be centralized into a logical unit (mind you that this "logical unit" might be a single server or a distributed solution with a uniform interface.)

This typically encompasses user profile management. Mind you that sometimes you also have a separate component or unit for that. And that can perfectly be a separate microservice.

Why? Because managing a user profile is distinct from all other services, including authentication and authorization.

Now, if this is a single physical deployment point, then that would be a bottleneck. But if this is a distributed service (that is, multiple instances of the same microservice, which is a topic for another discussion), then that concern is alleviated.

Even in monolithic applications (when written well, that is), you typically see user authentication and management as their own isolated components separated from the rest.

Hope this helps.

like image 63
luis.espinal Avatar answered Nov 10 '22 14:11

luis.espinal