cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DuyHai Doan <doanduy...@gmail.com>
Subject Re: A question to 'paging' support in DataStax java driver
Date Mon, 09 May 2016 13:05:58 GMT
In a truly consistent world (should I say "snapshot isolation" world
instead), re-reading the same page should yield the same results no matter
how many new inserts have occurred since the last page read.

Caching previous page at app level can be a solution but not viable if the
amount of data is huge, also you'll need a cache layer and deal with cache
invalidation etc ...

The point is, providing snapshot isolation in a distributed system is hard
without some sort of synchronous coordination e.g. global lock (read
http://www.bailis.org/papers/hat-vldb2014.pdf)


On Mon, May 9, 2016 at 2:17 PM, Bhuvan Rawal <bhu1rawal@gmail.com> wrote:

> Hi Doan,
>
> What does it have to do being eventual consistency? Lets assume a scenario
> with complete consistency and we are at page X, and at the same time some
> inserts/updates happened at page X-2 and we jumped to that.
> User will see inconsistent page in that case as well, right? Also in such
> cases how would you design a user facing application (Cache previous pages
> at app level?)
>
> Regards,
> Bhuvan
>
> On Mon, May 9, 2016 at 4:18 PM, DuyHai Doan <doanduyhai@gmail.com> wrote:
>
>> "Is it possible to just return PagingState object without returning
>> data?" --> No
>>
>> Simply because before reading the actual data for each page of N rows,
>> you cannot know at which token value a page of data starts...
>>
>> And it is worst than that, with paging you don't have any isolation.
>> Let's suppose you keep in your application/web front-end the paging states
>> for page 1, 2 and 3. Since there are concurrent inserts on the cluster at
>> the same time, when you re-use the paging state 2 for example, you may not
>> get the same results as the previous read.
>>
>> And it is inevitable in an eventual consistent distributed DB world
>>
>> On Mon, May 9, 2016 at 12:25 PM, Lu, Boying <Boying.Lu@emc.com> wrote:
>>
>>> dHi, All,
>>>
>>>
>>>
>>> We are considering to use DataStax java driver in our codes. One
>>> important feature provided by the driver we want to use is ‘paging’.
>>>
>>> But according to the
>>> https://datastax.github.io/java-driver/3.0.0/manual/paging/, it seems
>>> that we can’t jump between pages.
>>>
>>>
>>>
>>> Is it possible to just return PagingState object without returning data?
>>> e.g.  If I want to jump to the page 5 from the page 1,
>>>
>>> I need to go through each page from page 1 to page 5,  Is it possible to
>>> just return the PagingState object of page 1, 2, 3 and 4 without
>>>
>>> actual data of each page? This can save some bandwidth at least.
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> Boying
>>>
>>>
>>>
>>>
>>>
>>
>>
>

Mime
View raw message