Re:Decoupling a core service from your monolith the right way
by marcyb5st on Sunday June 04, 2023 @01:15PM
(#36187380)
I think that while the approach is good, there was a better option (IMHO). Specifically, I would:
1. Create protobuffers (or similar) messages that wrap the requests and responses. E.g. CheckSubscriptionPaidRequest and CheckSubscriptionPaidResponse.
2. Refactor your code so that the fields in the messages defined in #1 are your only mean to pass/retrieve information.
3. If need be, expose the service through GRPC or similar.
4. Repeat for each service/endpoint.
This way, you don't incur in any overhead apart from the negligible creation of the protobuffer messages instances.
1. Create protobuffers (or similar) messages that wrap the requests and responses. E.g. CheckSubscriptionPaidRequest and CheckSubscriptionPaidResponse.
2. Refactor your code so that the fields in the messages defined in #1 are your only mean to pass/retrieve information.
3. If need be, expose the service through GRPC or similar.
4. Repeat for each service/endpoint.
This way, you don't incur in any overhead apart from the negligible creation of the protobuffer messages instances.