> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
(If there's any interest, I'll wrap it up in a github project and push it to clojars.)
Redis isn't a hierarchical store, so its array/set operations would only benefit the most shallow of data structures.
-Steve
Have you looked at Cupboard (http://github.com/gcv/cupboard)? It tries
to make it easy to store native Clojure data structures, and it is as
ACID and transactional as the underlying Berkeley DB JE
implementation. If you have looked at it, I'd appreciate some feedback
as to where it fell short of your expectations. :)
I plan to start adding distributed storage support in the next few
months. The latest JE release has master-slave replication, which I
think will work well for Cupboard.
I've been looking at tools along these lines as well, and recently
looked at Redis for the same reasons. Right now, though, I'm focusing
my attention on Jackrabbit which is an implementation of the JSR170
repository specifications. It supports hierarchical data and lists.
I was looking for some way to save dynamic objects (basically runtime
defined maps) and this looks like it might work.
JSR170 defines a repository as:
"A content repository consists of one or more workspaces, each of
which contains a tree of items. An item is either a node or a
property. Each node may have zero or more child nodes and zero or more
child properties. There is a single root node per workspace, which has
no parent. All other nodes have one parent. Properties have one parent
(a node) and cannot have children; they are the leaves of the tree.
All of the actual content in the repository is stored within the
values of the properties."
The available property types cover what appear to be all the bases,
including references to other nodes to prevent cycles when
serializing. It can support annotated Java objects or use the Node
building capability directly and allows querying similar to XPath.
Since it is a Java project, using it from Clojure should be trivial to
use.
I doubt the memoize functions provided therein will be directly useful to you, but you may find a few lines of helpful code there. Best of luck with your experiment.
-Steve
On Dec 31 2009, 6:59 pm, jem <jere.mcdev...@gmail.com> wrote:
> Something else to look at might be the Apache Jackrabbit project athttp://jackrabbit.apache.org/.
Redis has limited data structures - flat un-nested lists and sets, and
plain strings. It doesn't have sets exactly - just keys and values.
Nothing nested at all, unless you serialize to strings. No indexes,
although you can hack up your own.
To be honest, Redis isn't that impressive versus what's in Clojure
already. It's an in-memory DB (so it's not much different from ref
+dosync) and it intermittently spits a snapshot to disk. If you can
live with an in-process DB, you could copy (and exceed) its features
including snapshot saving in a page of pure Clojure code, and beat it
on speed too.
Contrast MongoDB: slower because it bothers to save things, but still
around twice as fast as MySQL and much faster than CouchDB (cite: the
benchmarks page). Arbitrarily nested collections, indexes, atomic
updates (in place operations like inc and append, or atomic compare-
and-set), JSON syntax, typed data, replication (built in) and sharding
(via a broker process).
(MongoDB downsides: it grows files in a very greedy way to try and
minimize data fragmentation, and it needs a 64bit machine to store
more than about 2Gb.)
http://groups.google.com/group/clojure/browse_thread/thread/9628c622784ff45a#
cheers,
-t
On Jan 4, 2:40 am, Tom Hicks <hickstoh...@gmail.com> wrote:
> Have you looked at Neo4J? I have no experience with it but
> someone in the forum just announced a Clojure wrapper for it:
>
> http://groups.google.com/group/clojure/browse_thread/thread/9628c6227...
On Jan 2, 5:12 am, Gabi <bugspy...@gmail.com> wrote:
> I am interested in the idea: Completely stateless set of Clojure nodes
> (on many machines), operating on a central state stored in some
> datastore.
> If transactions could be managed somehow, I think it would be very
> compelling model for many applications.
Do you mean distributed transactions?
That's part of what it does, using the reader/printer representation.
Alternatives would include standard Java binary serialisation or 3rd party libraries (Hessian/Burlap?).
-Steve
/anders
On Jan 4, 1:40 am, Tom Hicks <hickstoh...@gmail.com> wrote:
> Have you looked at Neo4J? I have no experience with it but
> someone in the forum just announced a Clojure wrapper for it:
>
> http://groups.google.com/group/clojure/browse_thread/thread/9628c6227...
-Steve
As for *print-dup*, I guess there's a danger that stored values might become unreadable if any implementation structure classes were to get renamed in a future clojure release.
-Steve
On 5 Jan 2010, at 09:24, Gabi wrote: