[
https://issues.apache.org/jira/browse/USERGRID-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Johnson updated USERGRID-1007:
------------------------------------
Description:
How will a cache help improve performance?
* Reduce load on Tomcat, ES and C* caused by permissons calculation.
Do we need a distributed cache?
* YES: Todd says we tried non-distributed cache (w/EhCache) and the caching was
not effective (bad hit/mss ratio).
Implementation ideas:
* Use Cassandra column family implementation
* Use Hazelcast cache
* Use EhCache configured for distributed operation
How much should we expect performance to improve? How can we test this?
* JUnit + metrics collection in our cache implementation
Simplest approach seems to be Cassandra. Here's a design:
h1. Core Persistence Cache module
Provides AppScope caches
Can invalidate all caches within a CacheScope (which extends ApplicationScope)
{code}
public interface SegmentedCache<K,V> {
/** Put value into segment with ttl */
void put( CacheScope scope, K key, V value, long ttl );
/** Get value from segment */
V get( CacheScope segment, K key );
/** Delete all cache data of all types and of all scopes */
void invalidate();
/** Delete all cache data within specified segment */
void invalidate( CacheScope segment );
}
{code}
Caches are stored in Cassandra Usergrid_Cache column family:
Row-key is applicationId
Column key is toString() of K key
Value is serialized V value object
h1. In REST module
We provide an implementation of the Shiro CacheManager and Cache interfaces
that are backed by the Cache module.
When any EntityManager revoke or grant method is called we invalidate the cache
for the associated application scope.
was:
How will a cache help improve performance?
* Reduce load on Tomcat, ES and C* caused by permissons calculation.
Do we need a distributed cache?
* YES: Todd says we tried non-distributed cache (w/EhCache) and the caching was
not effective (bad hit/mss ratio).
Implementation ideas:
* Use Cassandra column family implementation
* Use Hazelcast cache
* Use EhCache configured for distributed operation
How much should we expect performance to improve? How can we test this?
* JUnit + metrics collection in our cache implementation
Simplest approach seems to be Cassandra. Here's a design:
# Core Persistence Cache module
Provides AppScope caches
Can invalidate all caches within a CacheScope (which extends ApplicationScope)
{code}
public interface SegmentedCache<K,V> {
/** Put value into segment with ttl */
void put( CacheScope scope, K key, V value, long ttl );
/** Get value from segment */
V get( CacheScope segment, K key );
/** Delete all cache data of all types and of all scopes */
void invalidate();
/** Delete all cache data within specified segment */
void invalidate( CacheScope segment );
}
{code}
Caches are stored in Cassandra Usergrid_Cache column family:
Row-key is applicationId
Column key is toString() of K key
Value is serialized V value object
# In REST module
We provide an implementation of the Shiro CacheManager and Cache interfaces
that are backed by the Cache module.
When any EntityManager revoke or grant method is called we invalidate the cache
for the associated application scope.
> Implement a cache for Shiro & permissions
> -----------------------------------------
>
> Key: USERGRID-1007
> URL: https://issues.apache.org/jira/browse/USERGRID-1007
> Project: Usergrid
> Issue Type: Story
> Reporter: Jeffrey
> Assignee: David Johnson
>
> How will a cache help improve performance?
> * Reduce load on Tomcat, ES and C* caused by permissons calculation.
>
> Do we need a distributed cache?
> * YES: Todd says we tried non-distributed cache (w/EhCache) and the caching
> was not effective (bad hit/mss ratio).
> Implementation ideas:
> * Use Cassandra column family implementation
> * Use Hazelcast cache
> * Use EhCache configured for distributed operation
> How much should we expect performance to improve? How can we test this?
> * JUnit + metrics collection in our cache implementation
> Simplest approach seems to be Cassandra. Here's a design:
> h1. Core Persistence Cache module
> Provides AppScope caches
> Can invalidate all caches within a CacheScope (which extends ApplicationScope)
> {code}
> public interface SegmentedCache<K,V> {
> /** Put value into segment with ttl */
> void put( CacheScope scope, K key, V value, long ttl );
> /** Get value from segment */
> V get( CacheScope segment, K key );
> /** Delete all cache data of all types and of all scopes */
> void invalidate();
> /** Delete all cache data within specified segment */
> void invalidate( CacheScope segment );
> }
> {code}
> Caches are stored in Cassandra Usergrid_Cache column family:
> Row-key is applicationId
> Column key is toString() of K key
> Value is serialized V value object
> h1. In REST module
> We provide an implementation of the Shiro CacheManager and Cache interfaces
> that are backed by the Cache module.
> When any EntityManager revoke or grant method is called we invalidate the
> cache for the associated application scope.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)