Read-only recommendation cache for read-only

I am building a site using Spring, Hibernate and Mysql. The mysql database contains information on coordinates and locations, etc. It is never updated only upon request. The database contains 15,000 coordinate lines and 48,000 coordinate connection lines. Each time the request is processed, the application should read all these coordinates, which take about 3-4 seconds. I would like to configure the cache to provide quick access to data. I am studying memcached at the moment, can you advise if this is my best option?

+4
source share
3 answers

Although CacheProvider exists for Memcached, here are my thoughts:

  • Memcached is not officially supported. The above CacheProvider is a third-party implementation (this may not be a problem).
  • Memcached launches the out-process , it is the client’s cache server and there is network and sorting service data for each request .
  • A cache, such as EhCache, launches an in-process (in the same JVM), so access is faster (regardless of whether you use memory or disk storage), and there will be no read-only network communication between cluster nodes, those. no overhead at all.
  • I think Ehcache will be significantly faster (see links below).

In other words, I would go for Ehcache.

References:

+3
source

Interest Ask. I used ehcache very successfully in a hibernation project, but then I didn’t just have read-only data.

Memcached was not originally intended for use with contexts like hibernation, although I see no reason why it should not be used. The only drawback with memcached in your context is that you probably don't need a funky distributed cached ability, since you probably have enough memory on one server to handle your load, and therefore you won’t get anything from Memcached client server overhead.

I don’t think you will regret your decision to go with memcached. It is very widely used for caching websites, I see no reason why you cannot use it in your context.

+2
source

Have you also looked at hibernation? Hibernate allows you to create different rows in different databases, which simplifies the search. It has been available for the past 3 years. This is a good place to start.

0
source

Source: https://habr.com/ru/post/1309366/


All Articles