Would it be easy to implement an in-memory database in clojure that allows concurrent access?
It sounds pretty easy, as most of the features are already provided by Clojure. I'm not sure though about the "locking granularity". Of course you don't pessimistically lock in Clojure, but if you have a relation that is "protected" by a Ref, then concurrently adding two rows to that relation will make one of the two transaction replay, although the added rows could be completely independent (unless there are unique constraints, for example, which, now that I think about it, are present in every real-world table in the form of primary keys). Furthermore, if you have constraints that involve other relations, say foreign key constraints, then the locking granularity gets even coarser, spanning all relations involved, and thus affecting every mutating access to any one of those relations. Is there a way to make this more fine-grained and still use the existing clojure data structures? Or is this for some reason not a problem in reality? Has anyone actually implemented something like this in Clojure? You'd think that many companies have a database that contains their clients in relations like "Person", "Company", etc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---