All Projects → ragnor → Simple Spring Memcached

ragnor / Simple Spring Memcached

Licence: mit
A drop-in library to enable memcached caching in Spring beans via annotations

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Simple Spring Memcached

Scrapbook
PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APC(u), SQL and additional capabilities (e.g. transactions, stampede protection) built on top.
Stars: ✭ 279 (+50.81%)
Mutual labels:  cache, caching, memcached
Sequelize Transparent Cache
Simple to use and universal cache layer for Sequelize
Stars: ✭ 137 (-25.95%)
Mutual labels:  cache, caching, memcached
Libmc
Fast and light-weight memcached client for C++ / #python / #golang #libmc
Stars: ✭ 429 (+131.89%)
Mutual labels:  cache, caching, memcached
Olric
Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.
Stars: ✭ 2,067 (+1017.3%)
Mutual labels:  cache, caching, memcached
Cachemanager
CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
Stars: ✭ 2,049 (+1007.57%)
Mutual labels:  cache, caching, memcached
Easycaching
💥 EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
Stars: ✭ 1,047 (+465.95%)
Mutual labels:  cache, caching, memcached
Ansible Role Memcached
Ansible Role - Memcached
Stars: ✭ 54 (-70.81%)
Mutual labels:  cache, caching, memcached
Milkomeda
Spring extend componets which build from experience of bussiness, let developers to develop with Spring Boot as fast as possible.(基于Spring生态打造的一系列来自业务上的快速开发模块集合。)
Stars: ✭ 117 (-36.76%)
Mutual labels:  cache, spring
Cash
HTTP response caching for Koa. Supports Redis, in-memory store, and more!
Stars: ✭ 122 (-34.05%)
Mutual labels:  cache, caching
Wp Spider Cache
Your friendly neighborhood caching solution for WordPress
Stars: ✭ 133 (-28.11%)
Mutual labels:  cache, memcached
Cashew
A simple and elegant yet powerful HTTP client cache for .NET
Stars: ✭ 70 (-62.16%)
Mutual labels:  cache, caching
Ngx Cache
Cache utility for Angular
Stars: ✭ 144 (-22.16%)
Mutual labels:  cache, caching
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+886.49%)
Mutual labels:  cache, caching
Node Cache
a node internal (in-memory) caching module
Stars: ✭ 1,660 (+797.3%)
Mutual labels:  cache, caching
Node Cached
A simple caching library for node.js, inspired by the Play cache API
Stars: ✭ 85 (-54.05%)
Mutual labels:  cache, memcached
Overlord
Overlord是哔哩哔哩基于Go语言编写的memcache和redis&cluster的代理及集群管理功能,致力于提供自动化高可用的缓存服务解决方案。
Stars: ✭ 1,884 (+918.38%)
Mutual labels:  cache, memcached
Minicache
📦 Python memory caching utilities
Stars: ✭ 79 (-57.3%)
Mutual labels:  cache, caching
Libcache
A Lightweight in-memory key:value cache library for Go.
Stars: ✭ 152 (-17.84%)
Mutual labels:  cache, caching
Study
全栈工程师学习笔记;Spring登录、shiro登录、CAS单点登录和Spring boot oauth2单点登录;Spring data cache 缓存,支持Redis和EHcahce; web安全,常见web安全漏洞以及解决思路;常规组件,比如redis、mq等;quartz定时任务,支持持久化数据库,动态维护启动暂停关闭;docker基本用法,常用image镜像使用,Docker-MySQL、docker-Postgres、Docker-nginx、Docker-nexus、Docker-Redis、Docker-RabbitMQ、Docker-zookeeper、Docker-es、Docker-zipkin、Docker-ELK等;mybatis实践、spring实践、spring boot实践等常用集成;基于redis的分布式锁;基于shared-jdbc的分库分表,支持原生jdbc和Spring Boot Mybatis
Stars: ✭ 159 (-14.05%)
Mutual labels:  cache, spring
Ansible Role Redis
Ansible Role - Redis
Stars: ✭ 176 (-4.86%)
Mutual labels:  cache, memcached

Simple Spring Memcached

A drop-in library to enable memcached caching in Spring beans via annotations.

Most of documentation has been moved to github but still some docs are available only on google code.

Introduction

Distributed caching can be a big, hairy, intricate, and complex proposition when using it extensively.

Simple Spring Memcached (SSM) attempts to simplify implementation for several basic use cases.

(28-06-2019) New version 4.1.3 with Amazon ElastiCache, Spring 5.1/5.0/4.3 and Java based configuration support is available! SSM can also work as a cache back-end in Spring Cache (@Cacheable). Please check release notes.

This project enables caching in Spring-managed beans, by using Java 5 Annotations and Spring/AspectJ AOP on top of the spymemcached, xmemcached or aws-elasticache client. Using Simple Spring Memcached requires only a little bit of configuration and the addition of some specific annotations on the methods whose output or input is being cached.

Usage

If you are using maven, you can try it now:

<dependencies>
   <dependency>
     <groupId>com.google.code.simple-spring-memcached</groupId>
     <artifactId>xmemcached-provider</artifactId>
     <version>4.1.3</version>
   </dependency> 
</dependencies>

and define connection to memcached on localhost using java based configuration:

@Configuration
public class LocalSSMConfiguration extends AbstractSSMConfiguration {
    @Bean
    @Overwrite
    public CacheFactory defaultMemcachedClient() {
        final CacheConfiguration conf = new CacheConfiguration();
        conf.setConsistentHashing(true);
        final CacheFactory cf = new CacheFactory();
        cf.setCacheClientFactory(new com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl());
        cf.setAddressProvider(new DefaultAddressProvider("127.0.0.1:11211"));
        cf.setConfiguration(conf);
        return cf;
    }
} 

or in old fashion way using XML:

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">

  <import resource="simplesm-context.xml" />
  <aop:aspectj-autoproxy />

  <bean name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">
      <property name="cacheClientFactory">
            <bean class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl" />
      </property>
      <property name="addressProvider">
            <bean class="com.google.code.ssm.config.DefaultAddressProvider">
                 <property name="address" value="127.0.0.1:11211" />
            </bean>
      </property>
      <property name="configuration">
            <bean class="com.google.code.ssm.providers.CacheConfiguration">
                  <property name="consistentHashing" value="true" />
            </bean>
      </property>
   </bean>
</beans>

Now you can annotate method to cache result:

@ReadThroughSingleCache(namespace = "CplxObj", expiration = 3600)
public ComplexObject getComplexObjectFromDB(@ParameterValueKeyProvider Long complexObjectPk) {
  // ...
  return result;
}

If you already using Spring Cache you may use SSM as an another back-end.

Need more? Please read getting started guide.

Documentation

Project documentation is available on SSM wiki.
Javadocs of current release are hosted on github.io.
Source code from master branch is built and tested on:

  • codeship: Codeship Status for ragnor/simple-spring-memcached

Contact Us

If you have any questions, feel free to ask them on the Google Group. (UPDATE: Sorry, this link was bad up until 02 Aug '09, because I fat-fingered when creating the Google Group. I incorrectly misspelled it as 'simple-spring-memEcached'. So sorry about that!)

Also, let us know if you are using SSM in your project, and we will list it in on the Wiki.

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].