> I am trying to use Redis as a data structure cache for my clojure
> application. Does anybody have experience/code/ideas that can write/
> read a clojure complex data structure to the Redis cache.
[…]
> How can I store the above to Redis and read it back to recreate it?
Personally, I would use JSON, MesssagePack, Protocol Buffers, or
something else language independent to encode the data. This has two
advantages: one, someone else already worked out how to do it, and
ported it to Java or Clojure, and two, you can also access it from
some other language. (When, eventually, you find you need that.)
Daniel
--
♲ Made with 100 percent post-consumer electrons
What about storing it as a string? You can either use pr-str or
data.json/generate-string.
You can then read it back using read-string or the equivalent json fn.
Regards,
BG
> --
> 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
--
Baishampayan Ghose
b.ghose at gmail.com
Previously we were using YAML (json was in it's infancy when we opted for YAML).
A real pain in the ass... Now we use a couple of protocols callable from
every where to decipher messages in an unified way crossing languages
and representations (from/to low level representations, strings or persistent structures).
It's faster, shorter, much more transparent, easier to debug and elegant.
Luc
> Shoeb,
>
> What about storing it as a string? You can either use pr-str or
> data.json/generate-string.
>
> You can then read it back using read-string or the equivalent json fn.
>
> Regards,
> BG
>
> On Wed, Jan 4, 2012 at 12:00 PM, Shoeb Bhinderwala
> <shoeb.bh...@gmail.com> wrote:
> > I am trying to use Redis as a data structure cache for my clojure
> > application. Does anybody have experience/code/ideas that can write/
> > read a clojure complex data structure to the Redis cache.
> >
> > For example I have a list of maps as shown below:
>sing >
Softaddicts<lprefo...@softaddicts.ca> sent by ibisMail!
--
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
Timothy
--
Peter
--
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
The book _Clojure in Action_ has a section on data mapping and data
persistence using Redis. You can download the source code here:
http://www.manning.com/rathore/source-code.zip
(The relevant files are chapter12_redis_datamapper.clj and
chapter12_redis_persistence.clj)
M