Thursday, September 20, 2018

Mixing cached data with data from DB with multiple contexts

We have a web app and some APIs which currently have different databases (they were developed independently..), which we want to integrate.

Via the APIs the users will submit low-level data, a lot of which relies on reference data, which is currently stored in the same database, but which we cache (as it doesn't change often).

The web app uses the same reference data but from its own database.

Ideally we'd like them both to get reference data from the same source, to avoid duplication. However, we are using EF Code First on the web app, and we don't really want to be getting the reference data from the database every time we retrieve an object which relies on it - some of the reference datasets are very large.

Initially we suggested a new 'reference data database', which both the web app and the API could reference. But how would we map the navigation properties? EF can't do it automatically if we do this because they would be different DB contexts. Ideally, we want this reference data cached in the web app as well, but not the objects which rely on the reference data.

With us not working on enterprise architectures normally, we're at a bit of a loss. Any ideas, recommendations for books/resources/etc?

Mixing cached data with data from DB with multiple contexts Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team