Repository pattern and multiple data providers/sources?

I’m trying to dive into the repository pattern, and I really like this article. Feel free to criticise the article in question, as I assume it’s not perfect, but my main question is:

How should I go forward if I have multiple data providers/sources? I’m trying to build a flexible model based on a third party REST API, i.e. it has /articles, /authors andpoint etc. We do also sync the third party database to our local Elasticsearch cluster, which we prefer to use for performance reasons. However, the sync is always 6-7 seconds delayed (at best), so the idea is to query the ES cluster first, and our third party provider second.

How is this best solved?

submitted by /u/n00belig
[link] [comments]

Leave a Reply