Live data from Hacker News

Why is Snapshot Isolation not enough?

concurrencyfreaks.blogspot.com

31–35 of 35 posts

Re: Why is Snapshot Isolation not enough?

#31
post #29

Earlier quoted context omitted.

If you don't need your snapshot read-only queries to be linearizable, then you don't need MVCC for this: just take a consistent checkpoint every second or minute or hour. A simple way to implement low-frequency snapshots is what Redis made famous: fork the server process so all future updates in the parent are to CoW pages and read the snapshot from the child. (HyPer did this originally but I'm not sure they still do…

But those Redis snapshots are only used for regular back-ups, so completely unlike snapshot isolation in a relational database, right?

I was referring to using recent database snapshots for read-only queries. HyPer used the same snapshotting technique as Redis backups for this purpose:

https://cs.brown.edu/courses/cs227/archives/2012/papers/olap...

Re: Why is Snapshot Isolation not enough?

#32
post #4

It’s enough, just make sure you’re not trying to fly an airplane or prevent the detonation of nuclear weapons using a database, it’s the wrong tool for the job. If you’re storing doubly linked lists in a DB you’re doing it wrong. Updating doubly linked lists can be done at about 200 million ops/sec, single threaded, not sure why you need multiple threads updating the list at the same time, exactly what are you doing…

> If you’re storing doubly linked lists in a DB you’re doing it wrong. This was my reaction on finding that TFA's key example is a doubly-linked list. I've never implemented any kind of linked list in a database; nor have I ever come across someone else's schema that involved linked lists. The kinds of operation you do on linked lists (traverse, insert, append, delete) all involve sequences of row accesses that can't…

Relations form graphs, of which lists are a subset. It's very easy to end up with graphs [in SQL] that can be broken as in TFA.

Re: Why is Snapshot Isolation not enough?

#33
post #4

It’s enough, just make sure you’re not trying to fly an airplane or prevent the detonation of nuclear weapons using a database, it’s the wrong tool for the job. If you’re storing doubly linked lists in a DB you’re doing it wrong. Updating doubly linked lists can be done at about 200 million ops/sec, single threaded, not sure why you need multiple threads updating the list at the same time, exactly what are you doing…

>It’s enough, just make sure you’re not trying to fly an airplane or prevent the detonation of nuclear weapons My gripe with this kind of argument is that today, you aren't . You can write application-side duct tape to deal with any kind of wonky database situation, but the whole point of having a database with strong and easy-to-reason guarantees is that it makes future development easier.

He’s talking about performance and then using a database. It’s the wrong tool for the job.

Re: Why is Snapshot Isolation not enough?

#34
post #4

It’s enough, just make sure you’re not trying to fly an airplane or prevent the detonation of nuclear weapons using a database, it’s the wrong tool for the job. If you’re storing doubly linked lists in a DB you’re doing it wrong. Updating doubly linked lists can be done at about 200 million ops/sec, single threaded, not sure why you need multiple threads updating the list at the same time, exactly what are you doing…

It’s enough, just make sure you’re not trying to fly an airplane or prevent the detonation of nuclear weapons using a database, it’s the wrong tool for the job. Your intuition should be the opposite. You should always reach for correctness first and only sacrifice it after careful consideration when performance demands require it.

If your intuition is to put a doubly linked list in a database I don’t know what to say…

It’s so innerplatform effect that I’m at a loss for words.

Re: Why is Snapshot Isolation not enough?

#35
post #29

Earlier quoted context omitted.

But those Redis snapshots are only used for regular back-ups, so completely unlike snapshot isolation in a relational database, right?

I was referring to using recent database snapshots for read-only queries. HyPer used the same snapshotting technique as Redis backups for this purpose: https://cs.brown.edu/courses/cs227/archives/2012/papers/olap...

Ok, thanks. I was wondering because last year I spent a few hours poring through Redis documentation, trying to figure out how to get access to read-only snapshots...
Post reply on HN