All Projects → mihaicostin → hibernate-l2-memcached

mihaicostin / hibernate-l2-memcached

Licence: Apache-2.0 license
Hibernate second level cache implementation over memcached

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to hibernate-l2-memcached

Library-Spring
The library web application where you can borrow books. It's Spring MVC and Hibernate project.
Stars: ✭ 73 (+114.71%)
Mutual labels:  hibernate
memcached
Development repository for the memcached cookbook
Stars: ✭ 50 (+47.06%)
Mutual labels:  memcached
company-structure-spring-security-oauth2-cache
Example Spring Boot + Hibernate + OAuth2 + Redis/EhCache project for demonstration purposes of cache mechanism.
Stars: ✭ 11 (-67.65%)
Mutual labels:  hibernate
cache
Aplus Framework Cache Library
Stars: ✭ 18 (-47.06%)
Mutual labels:  memcached
springboot-rest-api-angularjs-https
REST API https with Spring Boot and Angular JS. Use MySQL, Hibernate and Spring Security.
Stars: ✭ 38 (+11.76%)
Mutual labels:  hibernate
Diber-backend
Delivery Service - Spring Boot / Spring Data Jpa / Hibernate / PostgreSQL / OAuth2 Application
Stars: ✭ 22 (-35.29%)
Mutual labels:  hibernate
jeecg
JEECG是一款基于代码生成器的J2EE快速开发平台,开源界“小普元”超越传统商业企业级开发平台。引领新的开发模式(Online Coding模式(自定义表单) - > 代码生成器模式 - > 手工MERGE智能开发), 可以帮助解决Java项目90%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。具备:表单配置能力(无需编码)、移动配置能力、工作流配置能力、报表配置能力(支持移动端)、插件开发能力(可插拔)
Stars: ✭ 2,090 (+6047.06%)
Mutual labels:  hibernate
spring-blog
A blogging full-stack web application project made with Spring Boot for Codeup students to use as a reference during the Capstone process.
Stars: ✭ 44 (+29.41%)
Mutual labels:  hibernate
springmvc
spring mvc study
Stars: ✭ 87 (+155.88%)
Mutual labels:  hibernate
docker-lemp
A single container LEMP complete fullstack with latest release of PHP7.4.33, 8.0.26 & 8.1.13/8.2RC and MySQL, nginx, PostgreSQL, phalcon, swoole, mailcatcher, beanstalkd, elasticsearch, memcached, redis, adminer and all you ever need; on top alpine3.15
Stars: ✭ 106 (+211.76%)
Mutual labels:  memcached
rust-memcache
memcache client for rust
Stars: ✭ 106 (+211.76%)
Mutual labels:  memcached
random-jpa
Create random test data for JPA/Hibernate entities.
Stars: ✭ 23 (-32.35%)
Mutual labels:  hibernate
memcached-spring-boot
Library that provides support for auto-configuration of Memcached cache in a Spring Boot application.
Stars: ✭ 68 (+100%)
Mutual labels:  memcached
Enyim.Caching
High performance Memcached client, incorporating both synchronous and asynchronous with various transcoders (Json.NET BSON, MessagePack, Protocol Buffers) on .NET
Stars: ✭ 18 (-47.06%)
Mutual labels:  memcached
sparql-proxy
SPARQL-proxy: provides cache, job control, and logging for any SPARQL endpoint
Stars: ✭ 26 (-23.53%)
Mutual labels:  memcached
E-commerce-
Spring + Hibernate
Stars: ✭ 32 (-5.88%)
Mutual labels:  hibernate
flipper
Feature Flipper, Feature Flags, Rollout Flags, Feature Toggles for Crystal
Stars: ✭ 21 (-38.24%)
Mutual labels:  memcached
aiomcache
Minimal asyncio memcached client
Stars: ✭ 129 (+279.41%)
Mutual labels:  memcached
libmemcached
Resurrection of libmemcached
Stars: ✭ 30 (-11.76%)
Mutual labels:  memcached
sequence
高效GUID产生算法(sequence),基于Snowflake实现64位自增ID算法.
Stars: ✭ 35 (+2.94%)
Mutual labels:  hibernate

Hibernate - Memcached

A library for using Memcached as a second level distributed cache in Hibernate.

  • Uses spymemcached client
  • Supports entity and query caching.

Java CI with Maven

Jump to

Maven dependency

To install it, you just need to add the following Maven dependency (check Versions for the right version for you):

<dependency>
    <groupId>com.github.mihaicostin</groupId>
    <artifactId>hibernate-l2-memcached</artifactId>
    <version>5.4.2.1</version>
</dependency>

https://mvnrepository.com/artifact/com.github.mihaicostin/hibernate-l2-memcached

Example config:

<property name="hibernate.cache.region.factory_class">com.mc.hibernate.memcached.MemcachedRegionFactory</property>
<property name="hibernate.memcached.operationTimeout">5000</property>
<property name="hibernate.memcached.connectionFactory">KetamaConnectionFactory</property>
<property name="hibernate.memcached.hashAlgorithm">FNV1_64_HASH</property>

If memcached authentication is required you can specify username and password:

<property name="hibernate.memcached.username">memcached-username</property>
<property name="hibernate.memcached.password">memcached-password</property>

If memcached are running on a remote server, e.g. on AWS ElastiCache, you can specify the connection URL:

<property name="hibernate.memcached.servers">cache.c3wd5k.cfg.euw1.cache.amazonaws.com:11211</property>

Configuration options

Targeting the memcached client (net.spy.memcached configurations)

Property Default Value
hibernate.memcached.servers localhost:11211
hibernate.memcached.operationQueueLength (default provided by net.spy.memcached.DefaultConnectionFactory)
hibernate.memcached.readBufferSize (default provided by net.spy.memcached.DefaultConnectionFactory)
hibernate.memcached.operationTimeout (default provided by net.spy.memcached.DefaultConnectionFactory)
hibernate.memcached.hashAlgorithm NATIVE_HASH
hibernate.memcached.connectionFactory DefaultConnectionFactory
hibernate.memcached.daemonMode false
hibernate.memcached.username -
hibernate.memcached.password -

Targeting the cache implementation (global or region specific)

Property Default Value
hibernate.memcached.cacheTimeSeconds 300
hibernate.memcached.clearSupported false
hibernate.memcached.memcacheClientFactory com.mc.hibernate.memcached.spymemcached.SpyMemcacheClientFactory
hibernate.memcached.dogpilePrevention false
hibernate.memcached.dogpilePrevention.expirationFactor 2
hibernate.memcached.keyStrategy com.mc.hibernate.memcached.keystrategy.Sha1KeyStrategy

In order to specify a property for a specific region add the region name right after memcached. ex: hibernate.memcached.myregion.cacheTimeSeconds

Versions

Use the version compatible with your hibernate version (ex: Version 5.2.1.x is developed for and compatible with hibernate 5.2.1.Final)

Hibernate 5.4.x

Hibernate 5.3.x

  • no support for hibernate 5.3.0 - 5.3.2
  • for hibernate 5.3.3 - 5.3.9 use v 5.4.2.0

Hibernate 5.2.x

  • v 5.2.17.0
    • Fix for Issue #16
    • hibernate-core dependency (as provided): 5.2.17.Final
  • v 5.2.10.0
    • Add a new cache property hibernate.memcached.cacheLockTimeout (defaults to 60.000 ms)
    • Update to latest spymemcached version
    • hibernate-core dependency (as provided): 5.2.10.Final
  • v 5.2.7.1
  • v 5.2.7.0
    • Support Hibernate 5.2.7.Final (PR by @akhalikov )
    • Update spymemcached to 2.12.2
    • Tested with 5.2.7.Final - 5.2.10.Final
  • v 5.2.1.0

Hibernate 5.1.x

  • v 5.1.5.1
  • v 5.1.5.0
    • Support for Hibernate 5.1.x (tested with 5.1.1.Final - 5.1.5.Final)

Hibernate 5.0.x

  • v 5.0.1.0
    • Support for Hibernate 5.0.x

Hibernate 4.3.x

  • v 4.3.11.0
    • Fix for Issue #9 (configure the cache with all available properties)
  • v 1.1.0
    • Memcached client now respects the region timeout property Issue #1
      <property name="hibernate.memcached.REGION.cacheTimeSeconds">10</property>
  • v 1.0.0
    • Compatible with hibernate 4.3.x

Known issues

Acknowledgements

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