redis - Which caching mechanism to use in my spring application in below scenarios -


we using spring boot application maria db database. getting data difference services , storing in our database. , while calling other service need fetch data db (based on mapping) , call service. avoid database hit, want cache mapping data in cache , use retrieve data , call service api.

so our ask - add data in cache when gets created in database (could add up-to millions records) , remove cache when status of 1 of column value "xyz" (for example) or based on eviction policy.

should use in-memory cache using hazelcast/ehcache or redis/couch base?

please suggest.

thanks

i agree rick in terms of don't build until need it, important these days think of caching layer fit later , how integrate (for example using interfaces). adding non-prepared system possible more expensive (in terms of hours) , complicated.

ok actual question; disclaimer: hazelcast employee

in general caching hazelcast, ehcache, redis , others candidates. first question want ask though is, "can hold necessary records in memory of single machine. in terms ehcache replication (all machines hold information) means every single node needs keep them in memory. depending on size want cache, maybe not optimal. in case hazelcast might better option partition data in cluster , optimize access single network hop minimal overhead on network latency.

second question around serialization. want store information in highly optimized serialization (which needs code transform human readable) or want store json?

third question number of clients , threads that'll access data storage. local cache ehcache fastest option, tradeoff of lots , lots of memory. apart important fact treading model in-memory store uses. it's either multithreaded , nicely scaling or single-thread concept becomes bottleneck when exhaust thread. overcome more processes it's workaround utilize todays systems fullest.

in more general terms, each of mentioned systems job. best tool should selected poc / prototype , real world use case. important bit real world, single thread behaves amazing under low pressure (obviously way faster) when exhausted become major bottleneck (again delaying responses).

i hope helps bit since, @ least me, every answer "yes best option" immediate no-go person said it.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -