3 ms·
Right. And it's not uncommon for backend services to access internal data via REST endpoints.
by balls187 5y ago
Right.
And it's not uncommon for backend services to access internal data via REST endpoints.
- therealdrag0 5y agoBut do I want to store data in my microservices? Esp if I've scaled them horizontally. Maybe I have 4 or 8 or 20 instances, I don't want 20 copies of my cache. I want one copy in Redis. I might also want shared evictions/TTLs or other semantics on the data.
- balls187 5y ago> But do I want to store data in my microservices? That is a trade-off, and gets to the meat of my question. If I understand the anti-pattern recommendation, if you have a single data item that needs to be accessed at a very high throughput rate, if you choose to use REDIS, it's best to have n-copies indexed by different keys, in order to properly distribute the data across multiple-shards to have that specific through-put. The tradeoff would be having one-copy of the data (a single key in REDIS) and the complexity of caching it locally, OR have it cached at REDIS, and the complexity of managing having multiple copies of the same data in REDIS with equally distributed keys. My original question--what would be a usecase for choosing the latter.
- therealdrag0 5y agoOh ya good point. I understand what you’re getting at now.