1
votes

In our new project, we want AppFabric Caching to become a key component. As a general guideline, we will have a write model/domain and a read model/domain : Backend services are notified by providers/others services and will put in cache some data, following business rules. Frontend services/websites will consume data as needed.

Read-Through/Write-Behind seems to be a good approach. But how to implement it for a real business solution ? Each example i have seen uses a simple query with ADO.NET for loading data. In our case, loading data is business-dependant and will involve many assemblies and interactions. Deploy all our business to each cache host seems not to be a good solution.

One another approach is to have a unique service per domain, responsible of get/read from cache and write/put into the cache. Not ideal and will degrade performance as it will be a wrapper to AppFabric caching.

If you have any further questions, please do not hesitate.

Thanks for help !

1

1 Answers

0
votes

One possible solution for such case is that you can make a service (possibly residing with the database server) containing all business logic and rules to access the data. Whereas each read-through/write-behind provider will contact that service to load data. This way you will not need to deploy your business logic and related assemblies on each cache server machine and will be able to use read-through/write-behind feature at the same time.

For caching solution you can also look into NCache which provides read-through, write-behind(async) and write-through(sync) features with more configurable options like batch write-behind operations and retries etc in case of write-behind failure.