The object we're mapping to in the cache isn't the complete object - it's
basically the tostring of an object after it's been formatted for the user. 
So if you had an object called foo with fields id, bar1, bar2, and bar3, and
the user requested that object with just the id and bar2 field, in json
format, we might return something like this:

"{
    \"foo\": {
        \"id\": 12345678,
        \"bar2\": \"hello world\"
    }
}"

And the object in the cache would literally be that string, which we would
only pull out of the cache if the user requested that object with the same
fields and the same formatting.  We might even have the same object in the
cache multiple times, say someone else requested id, bar2, and bar3 field:

"{
    \"foo\": {
        \"id\": 12345678,
        \"bar2\": \"hello world\"
        \"bar3\": \"hello world2\"
    }
}"

That would be a separate cache entry, and we could hit either of those in
the cache depending on which fields are specified on the request.  And if
that object gets updated, we'd want to invalidate both of those entries in
the cache.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Secondary-Key-for-ignite-cache-tp9242p9271.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to