vendredi 4 décembre 2020

In which API layer (repository/service) to place custom SQL queries logic?

I'm building an API in which I need data that differs a lot from how it is persisted (for each access to the DB, I'm doing 5-10 joins and I can't perform them via code because it takes too long).

I'm using a controller-service-repository architecture and I have read in several sources that repositories should contain only basic CRUD operations.

Given this:

  • should they be at the repository or service level?
  • is there any other way of structuring code that fits better in this use case?

Aucun commentaire:

Enregistrer un commentaire