Github repo network here: https://github.com/richhickey/sdb/network
I ask because I have some ideas for some changes and enhancements to the library, some of which would be breaking (potentially from both an API and data format standpoint). It seems like having a dialogue with anyone that is actively using it would be productive, if only to ensure that I'm not headed towards the weeds. Beyond that, a collective attempt to coordinate the direction of the project would be good (rather than simply letting off-by-one forks of it proliferate on github).
Cheers,
- Chas
--
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
> I don't know, but if you introduce breaking changes, you'd better name it version 2.0.
;-)
It'd actually be nice to establish a stable groupId and artifactId for the project (rather than the constantly-shifting `org.clojars.github-username-here`), which in conjunction with breaking changes, would warrant dropping back to v0.x.y until those changes have proven themselves.
- Chas
To talk in terms of entities is perhaps too much structure for the
simpledb.
I would suggest a way to define serialization and
deserialization per attribute per domain in code. This would mean that
there is no encoding of the type of an attribute in its name or value
in the storage. get-attr and put-attr take the domain as an argument,
which can be used to lookup the proper serialization and
deserialization function per attribute.
This approach would do away with storing type information into
simpledb. It is also possible to provide this functionality on top of
the existing simpledb library or the library with the suggested
improvements.
Or, if you wanted to avoid storing any type indicators in SDB, you could explicitly map formats to attribute names (which would then be used on a per-domain basis):
(def config {:sdb-client (AmazonSimpleDBClient. …)
:encode (fn [[k v]]
[(str k)
(case k
(:mls :asking-price) (encode-integer v)
(:address :agent-name) (str v)
:listing-date (encode-date v)
(str v))])
:decode …})
If the above is common usage, a helper function that takes a simple map of attribute names -> value types and returns a corresponding configuration object would be nice.
Is that what you were describing?
Thanks for the input. Some comments inline:
On Feb 27, 2011, at 1:06 PM, Mark Rathwell wrote:
> If you have time, I posted a gist containing a data access library I built on top of Rich's sdb library (data.clj), and the modifications I made to his sdb library (sdb.clj) for consistent reads, etc. This is some of the first real clojure code I wrote, so not the prettiest, but maybe you can see some of the pain points I had using the current sdb library.
>
> To summarize:
>
> - Whether or not to add asynchronous client support
Using the async client within Clojure doesn't make sense IMO. We can make any call asynchronous (at least, as the AWS library defines 'asynchronous') by wrapping it in a future.
> - Not a nice generic way of building up select dsl maps
> - I believe the select dsl 'where' clause only handles up to two predicates
I'll attempt to verify and potentially resolve that when I dig into the implementation work.
> - How to account for nil / blank values
That's a tough one. As you might have seen, I'm strongly leaning towards eliminating the type tags in formatted values, which would make representing nil pretty difficult.
Is this really a desired feature to begin with? As it stands, distinguishing between a nil value and no entry for a key requires using `find` -- in my experience, that has made it very uncommon for nil values to be used at all.
> - Automatically sync domains with a specified list
Definitely next layer up. Really, it's just (dorun (map (partial sdb/create-domain client) […coll of domain names…])).
> Certainly some of this belongs above the level of the sdb library, but some of it should be handled there.
Thanks for the example. Talking about "entities" is a little disorienting for me, at least insofar as maps coming out of SDB *are* Clojure entities. It'd be interesting to see what would reasonably be required to make persisting records to SDB more satisfying than record in, map out. Presumably, there are people that are working on this problem for use with more traditional databases; I'd hope that those results could be adapted to use SDB as just another data source.
- Chas
That's a tough one. As you might have seen, I'm strongly leaning towards eliminating the type tags in formatted values, which would make representing nil pretty difficult.
> - How to account for nil / blank values
Is this really a desired feature to begin with? As it stands, distinguishing between a nil value and no entry for a key requires using `find` -- in my experience, that has made it very uncommon for nil values to be used at all.
https://github.com/cemerick/rummage
It addresses all of the issues I note in the quoted google doc, and hopefully pushes things forward some w.r.t. data encoding issues and such.
Feedback and suggestions most welcome.
Thanks,
- Chas