alternative to memcached that can persist to disk

前端 未结 15 2051
猫巷女王i
猫巷女王i 2020-12-02 07:52

I am currently using memcached with my java app, and overall it\'s working great.

The features of memcached that are most important to me are:

  • it\'s fast,
相关标签:
15条回答
  • 2020-12-02 08:23

    Take a look at the Apache Java Caching System (JCS)

    JCS is a distributed caching system written in java. It is intended to speed up applications by providing a means to manage cached data of various dynamic natures. Like any caching system, JCS is most useful for high read, low put applications. Latency times drop sharply and bottlenecks move away from the database in an effectively cached system. Learn how to start using JCS.

    The JCS goes beyond simply caching objects in memory. It provides numerous additional features:

    * Memory management
    * Disk overflow (and defragmentation)
    * Thread pool controls
    * Element grouping
    * Minimal dependencies
    * Quick nested categorical removal
    * Data expiration (idle time and max life)
    * Extensible framework
    * Fully configurable runtime parameters
    * Region data separation and configuration
    * Fine grained element configuration options
    * Remote synchronization
    * Remote store recovery
    * Non-blocking "zombie" (balking facade) pattern
    * Lateral distribution of elements via HTTP, TCP, or UDP
    * UDP Discovery of other caches
    * Element event handling
    * Remote server chaining (or clustering) and failover
    * Custom event logging hooks
    * Custom event queue injection
    * Custom object serializer injection
    * Key pattern matching retrieval
    * Network efficient multi-key retrieval
    
    0 讨论(0)
  • 2020-12-02 08:25

    I have never tried it, but what about redis ?
    Its homepage says (quoting) :

    Redis is a key-value database. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists and sets with atomic operations to push/pop elements.

    In order to be very fast but at the same time persistent the whole dataset is taken in memory and from time to time and/or when a number of changes to the dataset are performed it is written asynchronously on disk. You may lost the last few queries that is acceptable in many applications but it is as fast as an in memory DB (Redis supports non-blocking master-slave replication in order to solve this problem by redundancy).

    It seems to answer some points you talked about, so maybe it might be helpful, in your case?

    If you try it, I'm pretty interested in what you find out, btw ;-)


    As a side note : if you need to write all this to disk, maybe a cache system is not really what you need... after all, if you are using memcached as a cache, you should be able to re-populate it on-demand, whenever it is necessary -- still, I admit, there might be some performance problems if you whole memcached cluster falls at once...

    So, maybe some "more" key/value store oriented software could help? Something like CouchDB, for instance?
    It will probably not be as fast as memcached, as data is not store in RAM, but on disk, though...

    0 讨论(0)
  • 2020-12-02 08:25

    Just to complete this list - I just found couchbase. However I haven't tested it yet.

    0 讨论(0)
提交回复
热议问题