[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Kaveh Shahbazian
> > Badger provides multi-key transactions, so any high level logic may use it. > > Already doing that. It requires you expose your own transactions that use Badger's one. > It will be sick if you build non-transactional storage on top of > transactional. > It is transactional. If transactions

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Sokolov Yura
> - The meaning and implementation of CAS at document level (and a transaction > involving multiple documents) might greatly differ from that of at a simple > key level and Badger provides multi-key transactions, so any high level logic may use it. > - It requires to expose badger transactions

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Kaveh Shahbazian
That's possible. Yet it will not help with implementing another database based on that key-value store. Because even if (I do not know how and doubt that) badger provides CAS capabilities, one can not simply use it directly because: - The meaning and implementation of CAS at document level (and

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Sokolov Yura
If you read Badgrer's README carefully (and if Badger's README tells the truth), you'll see that Badger's transactions are implemented with sort of CAS: - transaction remembersall version of all data it reads, - on commit it rechecks that all data read during transaction were not modified, - trans

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Kaveh Shahbazian
BTW CAS is now implemented and added employing a rev field inside the json document (and again this idea is from CouchDB!). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-27 Thread Kaveh Shahbazian
Indeed this JSON store is transactional and takes advantage of this feature provided by badger. But CAS is another story and is orthogonal to transactions. Even when using common RDBMSs we need some form of optimistic concurrency. Assume we are about to update the balance for an account. How to

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Sokolov Yura
CAS with presence of transactions... Why? Badger had CAS before they added transactions. Since you use Badger, I hope your storage is also transactional. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Kaveh Shahbazian
And I am in desperate need of bugs! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://grou

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Kaveh Shahbazian
Seven more examples added and other tiny improvements. Next step is to add CAS features. There are two main options for this: putting the CAS sequence/timestamp inside the document or as a separate value. Each one has their pros and cons. I am trying to find out which approach requires least ch