lundi 27 mars 2017

Best practice to communicate with Elastic in an application

It will be first time I am going to use Elastic in production.

For databases, I use repository pattern, for example concrete classes of IOrderRepository, IFacetRepository uses SQL and Mongo drivers to communicate with db.

The application is going to get all the products from Elastic, and I use Elastic REST Api to get data.

What can be the best practice to represent elastic provider(?) in code base?

I can continue using Repository pattern,and create ProductRepository that uses ElasticClient and make http calls, but I feel it is not a perfect solution.

I also can't create ProductService as I don't want any business in the code. Single responsibility is getting the products from elastic, that's all.

May be mediator pattern is the right way to implement.

What do you suggest?

Aucun commentaire:

Enregistrer un commentaire