Search code examples
ignitegridgain

How to model one to many relationship in Gridgain or apache ignite to be scanned by a query


I have a simple question about to model one to many relationship between 2 object in apache ignite and to make it covered by scan query or sql query, any insights?

Is the SQL queries are consistent and atomic, I mean the read results are the latest consistent result or if there is ongoing write operations over the same rows, the read will be blocked till the write is done and vice versa? the write will be blocked till the read is done?


Solution

  • First question is too broad, are there any particular issues? If not, please refer to documentation and example.

    As for the locks, they are acquired on per-entry level, so there are no global locks and updates are not waiting for the whole query to finish. But note that queries do not enlist in transactions. This means that dirty reads in a query are possible if there is a transaction with multiple updates executed concurrently.