mercredi 2 août 2017

Design pattern when search service fail

I have a UserRepository to search database (solr, elasticsearch, others...) and i have this user data in my SQL database (MySQL, PostgreSQL, others...), what better design pattern and place to when UserRepository search fail / not found go to SQL databases? Is in repository right? or need create other abstration for this (controller, service) ?

My example is in Java, but i will apply this to java (Spring) and PHP:

public interface UserRepository extends SolrCrudRepository<User, String> {}

Aucun commentaire:

Enregistrer un commentaire