ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Ozerov <voze...@gridgain.com>
Subject DML usability: routing single column to several object fields
Date Thu, 16 Feb 2017 12:33:31 GMT

Consider the following pattern which is typically used by users when
working through cache API and quering data through SQL at the same time:

class Person {
    long id;

    String name;

cache.put(*id*, new Person(*id*, name));

SELECT *id*, name FROM person;

Notice that ID is stored twice per cache record - once for key, and once
for value. This pattern is very convenient for users - loose some little
space due to duplication on the one hand, but have self-contained value
with all necessary data on the other. In fact virtually all production
systems I saw followed this approach and had some minor duplication.

It seems this approach doesn't work well with DML and upcoming DDL. When
executing INSERT INTO Person VALUES (:id, :name), I specify two attributes
which must update three cache fields.

In order to preserve usability of native cache API when DML is involved, we
need ability to map certain attribute to several Object properties.
Probably this can be achieved with additional field property which defines
that it belongs to a group mapped to an attribute. May be existing aliases
could be used for this.

Or we can ignore the problem sacrificing cache API usability a bit in case

Any ideas on whether we need it, and how to design public API?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message