[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] problem with sqlite constraints and orm



I'd say the best option for a unikernel database right now is to
choose one that has a remote binary protocol and access it over TCP.
Examples include Redis or PostgreSQL for this (and probably many more
like CouchDB or Mongo do the same).

There's an interesting ongoing effort to port existing databases into
a unikernel by Martin Lucina, so we should be able to run them in a
separate address space shortly.  For now though, a database in a Linux
VM with the frontend as a unikernel client makes most sense.  What
sort of database access patterns do you anticipate?

-anil

> On 1 Apr 2015, at 22:22, Martin DeMello <martindemello@xxxxxxxxx> wrote:
> 
> Is there a more current option people are using for working with a
> database? I'd be happy to poke at the orm code in the longer term, but
> I also want to get on with writing my actual app :)
> 
> martin
> 
> On Wed, Apr 1, 2015 at 12:53 AM, Thomas Gazagnaire
> <thomas@xxxxxxxxxxxxxx> wrote:
>> Hi Martin,
>> 
>> I haven't touched at the code of mirage/orm for a very long time (2.5y!) but
>> I'm not very surprised you can still find bugs in it: the code is quite
>> fragile (too much camlp4 for its own good) and (mainly) works only because
>> of the relatively large test-suite. But patches are always very welcome!
>> 
>> Thanks,
>> Thomas
>> 
>> 
>> On 30 Mar 2015, at 12:20, Martin DeMello <martindemello@xxxxxxxxx> wrote:
>> 
>> Problem demonstrated below: violating a unique constraint in sqlite3 seems
>> to leave things in an inconsistent state.
>> 
>> Also, tangentially, I discovered this while trying to maintain my own id on
>> a table because my app is serving json objects over a rest api, and I need
>> some sort of unique id for clients to be able to send updates to existing
>> objects. If there were a way to have the autogenerated sql __id__ column be
>> a record field, that would be extremely useful.
>> 
>> martin
>> 
>> $ cat db.ml
>> type item = {
>>  id: int;
>> } with orm (
>>  unique: item<id>
>> )
>> 
>> let db_name = "test.db"
>> 
>> $ cat init_db.ml
>> open Db
>> 
>> let _ =
>>  let db = item_init Db.db_name in
>>  let item = {
>>    id = 1;
>>  } in
>>  item_save db item
>> 
>> 
>> $ ./init_db.native
>> $ ./init_db.native
>> Fatal error: exception Sqlite3.Error("CONSTRAINT")
>> 
>> $ sqlite3 test.db
>> sqlite> select * from item;
>> __id__      id
>> ----------  ----------
>> 1           1
>> 2
>> sqlite> delete from item;
>> Error: no such function: SYNC_CACHE_item
>> 
>> _______________________________________________
>> MirageOS-devel mailing list
>> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
>> 
>> 
> 
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
> 


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.