write-through when using SQL updates

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

write-through when using SQL updates

dsetrakyan
Igniters,

Do we support write-through to a 3rd party database when performing SQL
inserts and updates? If yes, how does the mapping between SQL and
CacheStore key-value API happen?

D.
Reply | Threaded
Open this post in threaded view
|

Re: write-through when using SQL updates

dmagda
Dmitriy,

According to the docs, INSERTS are transformed into cache.putIfAbsent or
cache.invokeAll operations:
https://apacheignite-sql.readme.io/docs/insert#section-description

UPDATES are turned into cache.invokeAll all the times:
https://apacheignite-sql.readme.io/docs/update#section-description

Once an SQL statement becomes a key-value operation(s) we should update
both RAM and a 3rd party database following a standard contract:
https://apacheignite.readme.io/docs/3rd-party-store

SQL experts, please confirm my understanding is correct.

--
Denis


On Sun, Apr 22, 2018 at 7:54 AM, Dmitriy Setrakyan <[hidden email]>
wrote:

> Igniters,
>
> Do we support write-through to a 3rd party database when performing SQL
> inserts and updates? If yes, how does the mapping between SQL and
> CacheStore key-value API happen?
>
> D.
>
Reply | Threaded
Open this post in threaded view
|

Re: write-through when using SQL updates

dsetrakyan
Denis, I get that we support it, but I still do not understand how. Given
an SQL table in Ignite with several columns, what is the key class and what
is the value class? Where do we document how SQL types map to key-value
types?

D.

On Sun, Apr 22, 2018 at 1:43 PM, Denis Magda <[hidden email]> wrote:

> Dmitriy,
>
> According to the docs, INSERTS are transformed into cache.putIfAbsent or
> cache.invokeAll operations:
> https://apacheignite-sql.readme.io/docs/insert#section-description
>
> UPDATES are turned into cache.invokeAll all the times:
> https://apacheignite-sql.readme.io/docs/update#section-description
>
> Once an SQL statement becomes a key-value operation(s) we should update
> both RAM and a 3rd party database following a standard contract:
> https://apacheignite.readme.io/docs/3rd-party-store
>
> SQL experts, please confirm my understanding is correct.
>
> --
> Denis
>
>
> On Sun, Apr 22, 2018 at 7:54 AM, Dmitriy Setrakyan <[hidden email]>
> wrote:
>
> > Igniters,
> >
> > Do we support write-through to a 3rd party database when performing SQL
> > inserts and updates? If yes, how does the mapping between SQL and
> > CacheStore key-value API happen?
> >
> > D.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: write-through when using SQL updates

dmagda
If a table is created with CREATE TABLE command then:

   - Ignite creates two custom binary types (one for the key and one for
   the value) the columns will be wrapped into. A primary key defines what
   goes into the key. It happens automatically unless...
   - You define names of existing business objects the columns will be
   mapped to. Use KEY_TYPE and VALUE_TYPE parameters for that.

Read more here:
https://apacheignite-sql.readme.io/docs/create-table#section-description

--
Denis

On Sun, Apr 22, 2018 at 9:58 PM, Dmitriy Setrakyan <[hidden email]>
wrote:

> Denis, I get that we support it, but I still do not understand how. Given
> an SQL table in Ignite with several columns, what is the key class and what
> is the value class? Where do we document how SQL types map to key-value
> types?
>
> D.
>
> On Sun, Apr 22, 2018 at 1:43 PM, Denis Magda <[hidden email]> wrote:
>
> > Dmitriy,
> >
> > According to the docs, INSERTS are transformed into cache.putIfAbsent or
> > cache.invokeAll operations:
> > https://apacheignite-sql.readme.io/docs/insert#section-description
> >
> > UPDATES are turned into cache.invokeAll all the times:
> > https://apacheignite-sql.readme.io/docs/update#section-description
> >
> > Once an SQL statement becomes a key-value operation(s) we should update
> > both RAM and a 3rd party database following a standard contract:
> > https://apacheignite.readme.io/docs/3rd-party-store
> >
> > SQL experts, please confirm my understanding is correct.
> >
> > --
> > Denis
> >
> >
> > On Sun, Apr 22, 2018 at 7:54 AM, Dmitriy Setrakyan <
> [hidden email]>
> > wrote:
> >
> > > Igniters,
> > >
> > > Do we support write-through to a 3rd party database when performing SQL
> > > inserts and updates? If yes, how does the mapping between SQL and
> > > CacheStore key-value API happen?
> > >
> > > D.
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: write-through when using SQL updates

dsetrakyan
On Sun, Apr 22, 2018 at 10:16 PM, Denis Magda <[hidden email]> wrote:

> If a table is created with CREATE TABLE command then:
>
>    - Ignite creates two custom binary types (one for the key and one for
>    the value) the columns will be wrapped into. A primary key defines what
>    goes into the key. It happens automatically unless...
>    - You define names of existing business objects the columns will be
>    mapped to. Use KEY_TYPE and VALUE_TYPE parameters for that.
>
> Read more here:
> https://apacheignite-sql.readme.io/docs/create-table#section-description


Finally, I see the documentation. We need a separate section for it with a
proper title. To the least, we will be able to provide a direct link to it
when people ask questions.

D.
Reply | Threaded
Open this post in threaded view
|

Re: write-through when using SQL updates

dmagda
Kind of this task was planned some time ago. In addition to what you're
putting out, users are asking for an example that shows how to blend
key-value and SQL APIs. I already have that example. Hopefully, we'll find
resources to get it done soon: IGNITE-7728
<https://issues.apache.org/jira/browse/IGNITE-7728>

--
Denis

On Sun, Apr 22, 2018 at 10:19 PM, Dmitriy Setrakyan <[hidden email]>
wrote:

> On Sun, Apr 22, 2018 at 10:16 PM, Denis Magda <[hidden email]> wrote:
>
> > If a table is created with CREATE TABLE command then:
> >
> >    - Ignite creates two custom binary types (one for the key and one for
> >    the value) the columns will be wrapped into. A primary key defines
> what
> >    goes into the key. It happens automatically unless...
> >    - You define names of existing business objects the columns will be
> >    mapped to. Use KEY_TYPE and VALUE_TYPE parameters for that.
> >
> > Read more here:
> > https://apacheignite-sql.readme.io/docs/create-table#section-description
>
>
> Finally, I see the documentation. We need a separate section for it with a
> proper title. To the least, we will be able to provide a direct link to it
> when people ask questions.
>
> D.
>