All Projects → cafebazaar → mnemosyne

cafebazaar / mnemosyne

Licence: MIT license
Multilayer Cache Manager supporting multiple In-momery & Redis configurations

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mnemosyne

redis-developer.github.io
The Home of Redis Developers
Stars: ✭ 28 (+75%)
Mutual labels:  redis-cache
database-journal
Databases: Concepts, commands, codes, interview questions and more...
Stars: ✭ 50 (+212.5%)
Mutual labels:  redis-cache
cache
🗃 Generic cache use and cache manage. Provide a unified usage API by packaging various commonly used drivers. Support File, Memory, Redis, Memcached and more. Go 通用的缓存使用库,通过包装各种常用的驱动,来提供统一的使用API,便于使用。
Stars: ✭ 146 (+812.5%)
Mutual labels:  redis-cache
guava-cache-redis
implement guava cache interface backed by redis
Stars: ✭ 34 (+112.5%)
Mutual labels:  redis-cache
sessionx
Go's web session library.
Stars: ✭ 75 (+368.75%)
Mutual labels:  redis-cache
cafebazaar flutter
CafeBazaar In-App Billing Plugin for flutter
Stars: ✭ 27 (+68.75%)
Mutual labels:  cafebazaar
ipd
查询ip地理信息,多种查询模式,高效,具有缓存机制,并可使用elasticsearch构建自己的ip数据库
Stars: ✭ 24 (+50%)
Mutual labels:  bigcache
Poolakey
Android In-App Billing SDK for Cafe Bazaar App Store
Stars: ✭ 60 (+275%)
Mutual labels:  cafebazaar
SpeQL8
Speculative GraphQL metrics for your Postgres databases.
Stars: ✭ 73 (+356.25%)
Mutual labels:  redis-cache
cache
Laravel & Lumen Cache Service | File and Redis cache system
Stars: ✭ 19 (+18.75%)
Mutual labels:  redis-cache
GraphCMS-cache-boilerplate
The main goal of this service is to provide a reliable cache contingency backup plan in case a GraphCMS/GraphQL endpoint is failing.
Stars: ✭ 24 (+50%)
Mutual labels:  redis-cache
game 01
Scalable MMORPG game server based on entity control
Stars: ✭ 19 (+18.75%)
Mutual labels:  redis-cache
tag-cache
Tagged Cache implementation over redis
Stars: ✭ 16 (+0%)
Mutual labels:  redis-cache
CleanArchitecture-Template
This is a solution template for Clean Architecture and CQRS implementation with ASP.NET Core.
Stars: ✭ 60 (+275%)
Mutual labels:  redis-cache
react-native-cafe-bazaar
In-App billing for Cafe Bazaar (local android market)
Stars: ✭ 26 (+62.5%)
Mutual labels:  cafebazaar
rueidis
A Fast Golang Redis RESP3 client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, RedisAI, RedisGears, etc.
Stars: ✭ 422 (+2537.5%)
Mutual labels:  redis-cache
Uragano
Uragano, A simple, high performance RPC library. Support load balancing, circuit breaker, fallback, caching, intercepting.
Stars: ✭ 28 (+75%)
Mutual labels:  redis-cache
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (+443.75%)
Mutual labels:  redis-cache
Begiresh
Smart Android App Banner for Persian Markets
Stars: ✭ 28 (+75%)
Mutual labels:  cafebazaar
centminmod-magento2
Magento 2.2.2 Install Guide For Centmin Mod Nginx LEMP Stacks
Stars: ✭ 16 (+0%)
Mutual labels:  redis-cache

Mnemosyne

Mnemosyne

Mnemosyne (/nɪˈmɒzɪniː, nɪˈmɒsɪniː/; Greek: Μνημοσύνη, pronounced [mnɛːmosýːnɛː]) is a multilayer cache which can be configured to use various configurations of Redis and/or BigCache (an in-memory caching package) with minimum configuration out of the box.

Getting Started

Installing

go get -u github.com/cafebazaar/mnemosyne

Initializing a Manager and Selecting a Cache Instance

mnemosyneManager := mnemosyne.NewMnemosyne(config, nil, nil)
cacheInstance := mnemosyneManager.select("result-cache")

Working with a cacheInstance

  cacheInstance.Set(context, key, value)
  var myCachedData myType
  err := cacheInstance.Get(context, key, &myCachedData)
  // cache miss is also an Error

Configuration

Mnemosyne uses Viper as it's config engine. Template of each cache instance includes the list of the layers' names (in order of precedence) followed by configuration for each layer. here's an example:

cache:
  my-result-cache: # arbitary name for the cache instance
    soft-ttl: 2h 
    layers:   # Arbitary names for each cache layer
      - result-memory
      - result-gaurdian
    result-memory:
      type: memory
      max-memory: 512
      ttl: 2h
      amnesia: 10
      compression: true
    result-gaurdian:
      type: gaurdian
      address: "localhost:6379"
      slaves:
        - "localhost:6380"
        - "localhost:6381"
      db: 2
      ttl: 24h
      amnesia: 0
      compression: true
  my-user-cache:
    soft-ttl: 2h
    layers:
      - user-memory
      - user-redis
    user-memory:
      type: memory
      max-memory: 512
      ttl: 2h
      amnesia: 0
      compression: true
    user-redis:
      type: redis
      address: "localhost:6379"
      db: 4
      ttl: 24h
      amnesia: 0
      compression: true

soft-ttl is an instance-wide TTL which when expired will NOT remove the data from the instance, but warns that the data is old

Each cache layer can be of types redis, gaurdian, memory or tiny. redis is used for a single node Redis server, gaurdian is used for a master-slave Redis cluster configuration, memory uses the BigCache library to provide an efficient and fast in-memory cache, tiny uses the native sync.map data structure to store smaller cache values in memory (used for low-write caches). Note: all of the cache types are sync-safe, meaning they can be safely used from simultaneously running goroutines.

Common layer configs:

amnesia is a stochastic fall-through mechanism which allows for a higher layer to be updated from a lower layer by the way of an artificial cache-miss, a 0 amnesia means that the layers will never miss a data that they actually have, a 10 amnesia means when a key is present in the cache, 90% of the time it is returned but 10% of the time it is ignored and is treated as a cache-miss. a 100 amnesia effectively turns the layer off. (Default: 0)

compression is whther the data is compressed before being put into the cache memory. Currently only Zlib compression is supported. (Default: false)

ttl is the hard Time To Live for the data in this particular layer, after which the data is expired and is expected to be removed.

Type-spesific layer configs:

db [redis - gaurdian] is the Redis DB number to be used. (Default:0) idle-timeout [redis - gaurdian] is the timeout for idle connections to the Redis Server (see Redis documentation) (Default:0 - no timeout) address [redis - gaurdian] is the Redis Server's Address (the master's address in case of a cluster) slaves [gaurdian] is a list of Redis servers addresses pertaining to the slave nodes. max-memory [memory] is the maximum amount of system memory which can be used by this particular layer.

Documentation

Documents are available at https://godoc.org/github.com/cafebazaar/mnemosyne

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Roadmap

- Improve documentation
- Add tests

Authors

  • Ramtin Rostami - Initial work - rrostami
  • Pedram Teymoori - Initial work - pedramteymoori
  • Parsa abdollahi - Initial work -

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Made with in Cafebazaar Search Team

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].