Ruby/Rails Model Relationships Across Disparate Services/APIs (SOA) -
I use Ruby / Rail (Grapes, Rail-API etc.) to create a suite of services (micro) Working that feeds user-facing web / mobile applications, these services are self / contained / separate, although there is a need to have some cross-service relationship between the models / entities.
In the case of a is_on / , I just type the id I can store. The problem I am experiencing is that has_many / related_to or has_many / is_my how to relate Have to handle
For example, if I had a order and product model, then in a monolithic rail app, I would do the following:
How can this type of relationship be handled when dealing with different services? Is there a 'railroad' to do this?
The best option so far is to store foreign id s as a hash within the model, something like PostcodeSQL's hstore column , But it feels both wrong with a scalability and data-integrity approach.
Any help would be greatly appreciated!
These services are self / contained / separate, although some cross- Need to have a service relationship. / P>
Rail way (TM) is a monolithic application for such relationships.
If you have these kinds of obstacles and you are creating "micro services" - in my opinion, you are not doing a great job to architecture your platform.
Comments
Post a Comment