Hi there,
I'm just wondering what is the best way to do this. I'm not asking about micro-services, just a general API coding practice.
Currently, I have a number of APIs (separate code base) and each has their own model (e.g. users) and the endpoints create don't need anymore tables (models) except the ones it uses. We have also left out the relationships between the tables.
I haven't used ORMs at this level of separation before (all of my previous projects have all been 1 giant application) so I'm not sure what is the best way to do this. We are starting to develop APIs that would require it to span a few tables.
My query is:
- Is it good practice to copy all the models (tables) for each API that we'll be creating? Have a directory of all the models and copy this directory to every API we create.
- Or is it better to just just the models (tables) that this model will be using? Just copy the models that this API needs.
- Is it a bad idea to leave out the relationships?
Thanks.
Desmond