Isolation levels


(Jacob Bogers) #1

hi,
I am comming from the oracle database space and i have a question about "isolaton levels"

In order of low to highest degree of isolation

  • READ UNCOMMITTED
  • READ COMMITTED
  • REPEATABLE READ
  • SERIALIZABLE

Which one(s) (plural?) supported by elastic
Regards

Jacob


(Christian Dahlqvist) #2

Elasticsearch does not support transactions, so I believe the answer is none.


(Jacob Bogers) #3

Thank you for answer,
One more question, so I can potentially read a partially changed document? at least document reads are atomic?


(Christian Dahlqvist) #4

Yes, you will not get partially changed documents, but could get different version depending on which shard you query.


(Jacob Bogers) #5

Great, aslong as the read is atomic (on document level) I am happy)).
Is there an atomic "read and update"??

Example of what I want to do:
Let say you want to decrease a balance (bankaccount maybe) but it should only happen if the balance will not go below zero. I am thinking of solving the problem in 2 ways

  1. Can I create a mapping with a constraint (a type whos value must be >= 0)
  2. A way to do conditional update based on a read in one atomic action.

Cheers
Jacob.


(Jacob Bogers) #6

Oh sorry, I see that constraining the values of a float cannot be part of a "type" (or maybe it can?)

Regards
Jacob


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.