开发者

Architecture of caching integration

开发者 https://www.devze.com 2023-02-06 14:10 出处:网络
I have repositories and services that wrap them. Now I need to in开发者_如何学JAVAtegrate caching for some places and I want to ask your advice.

I have repositories and services that wrap them. Now I need to in开发者_如何学JAVAtegrate caching for some places and I want to ask your advice.

I see two ways.

  1. Integrate caching into existing services. But it will make services hard to test.
  2. Create extra services layer for caching. It looks better for testing but at the same time more difficult to build and maintain.


Without more detail on what the repositories are or do, I'd recommend a separate tier for your caching.

This allows you to scale your service and the cache separately as appropriate without having to scale both in order to scale one.

Work on automating your build, test, and deploy systems so that it's no more work to have the additional layers.

0

精彩评论

暂无评论...
验证码 换一张
取 消