What is the Ignite equivalent of GridCacheProjection?

classic Classic list List threaded Threaded
5 messages Options
William Kemper William Kemper
Reply | Threaded
Open this post in threaded view
|

What is the Ignite equivalent of GridCacheProjection?

In the GridGain API one could use a GridCacheProjection (http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of 'view' of a cache. I don't see equivalent functionality in Ignite. I see that CacheInterceptor may be configured for a cache, but it does not seem to provide a 'view' into an existing cache in the same way a GridCacheProjection could.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: What is the Ignite equivalent of GridCacheProjection?

William,

There is no exact equivalent of GridCacheProjection in Ignite, but it provides an ability to create and destroy caches on the fly. So instead of creating a view on a bigger cache, you can create a separate cache for some subset of data.

Can you describe your use case in more details so that we can suggest correct solution?

-Val
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: What is the Ignite equivalent of GridCacheProjection?

In reply to this post by William Kemper
William Kemper wrote
In the GridGain API one could use a GridCacheProjection (
http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
'view' of a cache. I don't see equivalent functionality in Ignite. I see
that CacheInterceptor may be configured for a cache, but it does not seem
to provide a 'view' into an existing cache in the same way a
GridCacheProjection could.
One of the main reasons GridCacheProjection existed was because in GridGain you could not transact across  different caches. Therefore, users were forced to put different types of data into the same cache and then create GridCacheProjections to have different views on the same cache.

In Ignite you can transact and query across multiple caches, so there is no real need for a GridCacheProjection, since you can simply put different types of data into different caches.
William Kemper William Kemper
Reply | Threaded
Open this post in threaded view
|

Re: What is the Ignite equivalent of GridCacheProjection?

We weren't using the type projection. We were using a predicate to implement access control logic in a multiuser application. It was nice because it worked for all the methods in the cache API (including queries) and because gridgain would do all the heavy lifting for us. Is the feature on the roadmap?

On Wed, Jun 24, 2015 at 6:24 PM, dsetrakyan <[hidden email]> wrote:
William Kemper wrote
> In the GridGain API one could use a GridCacheProjection (
> http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
> 'view' of a cache. I don't see equivalent functionality in Ignite. I see
> that CacheInterceptor may be configured for a cache, but it does not seem
> to provide a 'view' into an existing cache in the same way a
> GridCacheProjection could.

One of the main reasons GridCacheProjection existed was because in GridGain
you could not transact across  different caches. Therefore, users were
forced to put different types of data into the same cache and then create
GridCacheProjections to have different views on the same cache.

In Ignite you can transact and query across multiple caches, so there is no
real need for a GridCacheProjection, since you can simply put different
types of data into different caches.



-----
D.
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p579.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: What is the Ignite equivalent of GridCacheProjection?

William,

You don't need a projection for you use case - just create a separate cache for each user. You can use Ignite.getOrCreateCache() method for this. This will give you the same functionality, but won't require any additional code to support multiple users (like having user ID in model classes and implementing projection filters). It will also be more performant in some cases. E.g., iterations are much faster, because you iterate through the data for particular user only instead of going through all entries applying the filter to each of them.

-Val

On Wed, Jun 24, 2015 at 8:43 PM, William Kemper <[hidden email]> wrote:
We weren't using the type projection. We were using a predicate to implement access control logic in a multiuser application. It was nice because it worked for all the methods in the cache API (including queries) and because gridgain would do all the heavy lifting for us. Is the feature on the roadmap?

On Wed, Jun 24, 2015 at 6:24 PM, dsetrakyan <[hidden email]> wrote:
William Kemper wrote
> In the GridGain API one could use a GridCacheProjection (
> http://doc.gridgain.org/latest/GridCacheProjection) to create a kind of
> 'view' of a cache. I don't see equivalent functionality in Ignite. I see
> that CacheInterceptor may be configured for a cache, but it does not seem
> to provide a 'view' into an existing cache in the same way a
> GridCacheProjection could.

One of the main reasons GridCacheProjection existed was because in GridGain
you could not transact across  different caches. Therefore, users were
forced to put different types of data into the same cache and then create
GridCacheProjections to have different views on the same cache.

In Ignite you can transact and query across multiple caches, so there is no
real need for a GridCacheProjection, since you can simply put different
types of data into different caches.



-----
D.
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-is-the-Ignite-equivalent-of-GridCacheProjection-tp577p579.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.