On Jun 22, 12:57 pm, Timothy Baldridge <tbaldri...@gmail.com> wrote:
> Greetings,
>
> I've recently started learning Clojure. For the past year or so I've
> been using CouchDB, and am very happy with the MVCC disk storage
> system it uses. Has anyone tried marrying the two system systems to
> create a truly persistent data primitive where any "updates" to a map
> is written to the disk?
>
> To me this seams like a awesome opportunity for Clojure. If we could
> create maps/vectors/whatever and read/"write" to them and have their
> contents somehow stored in on disk, complete with transactional style
> support, clojure could basically have a built-in database system that
> could be used in countless situations.
>
> So has anyone tried this? If not, I may just give it a whirl, and
> others would be welcome to help.

Yep, I've tried it. It can be done, but it's not simple.

What you seem to want is orthogonal persistence, which remains an
active area of research. You can do much more limited forms of
persistence, but there are always a bunch of knotty problems you have
to solve. The on-disk representation of the values is never the same
as the in-memory representation, so you have to decide on a marshaling
scheme; that's a whole design project in itself. Efficiency
considerations for persistent storage are never the same as for in-RAM
storage, so you have to make a bunch of decisions and tradeoffs about
how to keep RAM and disk synchronized without throwing efficiency out
the window.

There are a zillion considerations about how you intend to use the
store that influence the tradeoffs you make about how to store and
marshal things--do you want to suport concurrent access to stores? How
much and what kind of concurrency? Do you want ACID guarantees? How
big do you want the stores to get? Do you want replication? Sharding?
What kind? Do you want to optimize for availability? Consistency? Fast
reads? Fast writes? Embedded use? Client/server applications? Big flat
stores of data that are not much interconnected? Highly-structured,
graphlike data? And on and on.

There are a ton of variables, each of which involves a bunch of
tradeoffs, and they can be combined a zillion different ways to yield
different and more complicated tradeoffs. That's why there are a
zillion persistence solutions around, and none of them is particularly
simple.

-- 
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

Reply via email to