Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Clojure library for working with Amazon SimpleDB
branch: service-url

This branch is 1 commit behind richhickey:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



A Clojure library for working with Amazon SimpleDB
, (docs)

Built on top of Amazon’s Java API for SimpleDB
, (javadocs)

The library lets you directly save and load Clojure data, and query using data. No strings! Stores using lexicographically-sortable representations. Can store strings, keywords, ints, longs, Dates, booleans and UUIDs, and can be extended to other primitives.

The dependencies can be downloaded from here


(use 'org.clojure.sdb)

(def aws-key "[...]")
(def aws-secret-key "[...]")
(def client (create-client aws-key aws-secret-key))

(put-attrs client "heroes" {:sdb/id "spiderman"
                            :power "spidery-things"
                            :secret-identity "Peter Parker"})

(put-attrs client "heroes" {:sdb/id "hulk"
                            :power "huge angry thing"
                            :secret-identity "Bruce Banner"})

(put-attrs client "heroes" {:sdb/id "venom"
                            :power "spidery-things"
                            :secret-identity "Eddie Brock"
                            :evil true})

(get-attrs client "heroes" "spiderman")
;; {:secret-identity "Peter Parker", :power "spidery-things", :sdb/id "spiderman"}

(query client '{:select [:secret-identity] :from "heroes" :where (= :evil true)})
;; ({:secret-identity "Eddie Brock", :sdb/id "venom"})

Local Use

It’s not always desirable to connect to a live server when using SimpleDB since you get charged (a small amount) for every transaction, and you won’t be able to develop while offline. To develop against a local SimpleDB mock, download and install SimpleDB-dev and configure your client to use an alternate service URL:

$ wget
$ unzip
$ python SimpleDB-Dev/src/ &

In your code:

(create-client my-sdb-key my-sdb-secret-key
               (.withServiceURL (com.amazonaws.sdb.AmazonSimpleDBConfig.)
Something went wrong with that request. Please try again.