Le mer. 3 juil. 2019 à 20:02, <xxxxxx@ancell-ent.com> a écrit :
From: Amirouche Boubekki <xxxxxx@gmail.com>
Date: Tuesday, July 02, 2019 8:40 AM

Le mar. 2 juil. 2019 à 15:16, <xxxxxx@ancell-ent.com> a écrit :

OK; especially since it's my idea, I volunteer to create the API, and code an implementation.

You are welcome.

My last ideas:

- validating individual key operation as they happen in okvs-set! maybe okvs-delete!

Definitely both, and potentially beyond validating, to for example implement cascading deletes if the schema demands that.

- validating whole transactions

I haven't yet figured out anything we can do beside follow the SQL RDBMS model.

Note this is implemented by full fledged stored procedures, they'll need to be handed the transaction handle because they can and may need to do arbitrary database operations.  This has implementation implications for the 'no-transaction concept, it could turn what appears to be a single operation into multiple ones that all need to be wrapped in the same transaction.

Well, make a no-transaction operation into a multi-operation transactional operation would be missing the point of no-transaction.
'no-transaction imply not atomic.
 

A bit of searching revealed that Wiretiger doesn't seem to have nested transactions, but Oracle's Sleepycat Berkeley DB does, so the concept is not alien to KVSes.  Do we want to make any provisions for them?

I don't think we should.
 
  In terms of the API prior to the 'no-transaction update, it could be very simple by handing okvs-transaction-begin and okvs-in-transaction the existing outer transaction handle instead of the okvs database handle. 
 
If not, the SRFI should state it's an error to begin a transaction inside another.

I don't think we should specify that and leave the door open to implement it.
Similarly sqlite3 lsm extension has a notion of nested transaction [0]
which would require the use of some kind of transaction-state to implement.

[0] https://sqlite.org/src4/doc/trunk/www/lsmusr.wiki#database_transactions_and_mvcc
 

Also, it should not make impossible the use of multiple abstraction in the same okvs. 

Isn't that implemented by convention through prefixes?


Yes.
 
- Harold


FWIW, my plan was to not create the notion of stored procedures. At least, we should
not make it obligatory to use, since sandboxed eval can not be guaranteed. In the use
space I was considering that the okvs was fully controlled by a single POSIX processus,
possibly exposing REST endpoints, possibly a REPL of some sort to execute queries.

--
Amirouche ~ amz3 ~ https://hyper.dev