Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User-specific settings for microservice

Lets say there is this service A, that's in charge of selling apples to the users.

If every user had to pay a different price for an apple, would this data (setting) be stored as a part of the service A database, or should it be external?

If we had more than one different configs ( user/apple cost, user/apple discount, user/apple allowance), what would be a good architectural approach to deal with User/Service mappings, any suggestions?

like image 292
Naughty Ninja Avatar asked Nov 15 '22 18:11

Naughty Ninja


1 Answers

Depends upon complexity. I've seen such a complicated microservice topology that separated ConfigurationService was perfectly reasonable decision. As long as your domain simple enough, such a setting definitely belongs to the service A.

Keep in mind that once upon a time this setting might be required somewhere else, so write such code, that would allow you to cut it out and publish as separated package/self-hosted service easily.

like image 101
Zazeil Avatar answered Dec 03 '22 10:12

Zazeil