smartcache

SmartCache - cache that can survive everything.

Лицензия

Лицензия

Группа

Группа

org.kielo.smartcache
Идентификатор

Идентификатор

smartcache-core
Последняя версия

Последняя версия

0.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

smartcache
SmartCache - cache that can survive everything.
Ссылка на сайт

Ссылка на сайт

https://github.com/kielo/smartcache
Система контроля версий

Система контроля версий

https://github.com/kielo/smartcache

Скачать smartcache-core

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.kielo.smartcache/smartcache-core/ -->
<dependency>
    <groupId>org.kielo.smartcache</groupId>
    <artifactId>smartcache-core</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.kielo.smartcache/smartcache-core/
implementation 'org.kielo.smartcache:smartcache-core:0.3.0'
// https://jarcasting.com/artifacts/org.kielo.smartcache/smartcache-core/
implementation ("org.kielo.smartcache:smartcache-core:0.3.0")
'org.kielo.smartcache:smartcache-core:jar:0.3.0'
<dependency org="org.kielo.smartcache" name="smartcache-core" rev="0.3.0">
  <artifact name="smartcache-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.kielo.smartcache', module='smartcache-core', version='0.3.0')
)
libraryDependencies += "org.kielo.smartcache" % "smartcache-core" % "0.3.0"
[org.kielo.smartcache/smartcache-core "0.3.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.googlecode.concurrentlinkedhashmap : concurrentlinkedhashmap-lru jar 1.4
org.slf4j : slf4j-api jar 1.7.7

test (4)

Идентификатор библиотеки Тип Версия
com.jayway.awaitility : awaitility jar 1.6.3
ch.qos.logback : logback-classic jar 1.0.13
org.spockframework : spock-core jar 1.0-groovy-2.4
ch.qos.logback : logback-core jar 1.0.13

Модули Проекта

Данный проект не имеет модулей.

SmartCache

SmartCache is reliable cache that can protect your application from 3rd party systems failure.

Motivation

Big problem of integrating with external services is protecting against downtimes. If external service is not mission critical or used deeply in backend, we can just wait. In other cases it is enough to inform the user about problems and again wait for solution.

However, there is a group of systems that need to integrate with external services and at the same time 99.99999% accessibility time is a must. Sometimes freshness of data doesn't matter, as long as system can stay operable during external vendor blackout. SmartCache is a lightweight library that wants to help solve this problem.

How does it work?

Usual cache works on objects - naive implementation is as simple as associate object V with key K and store it. SmartCache operates on callable actions instead. When getting item from cache, you actually need to provide action that can resolve it. If result of this action is already cached, it is returned without calling possibly long-running action. Otherwise action is called and unless it exceeds configurable timeout or other exception is thrown, result of action is returned and stored in cache.

SmartCache protects against calling multiple same actions simultaneously using action aggregation.

How to use it?

SmartCache cache = new SmartCache(Executors.newCachedThreadPool());
cache.registerRegion(new Region("region", new TimeExpirationPolicy(10000), 5));

T value = cache.get("key")
                .fromRegion("region")
                .withTimeout(Duration.ofMillis(1000))
                .invoke(() -> { /* action */ });

License

SmartCache is published under Apache License 2.0.

org.kielo.smartcache

kielo.org

Версии библиотеки

Версия
0.3.0