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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With