Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We have decided to go with <a href="http://bsonspec.org/" rel="nofollow">BSON</a> over <a href="http://www.rabbitmq.com/" rel="nofollow">RabbitMQ</a>. </p> <p>We like BSON's support for heterogeneous collections and the lack of the need to specify the format of messages up-front. We don't mind that it has poor space usage characteristics and likely poorer serialization performance than other message formats since the messaging portion of our application is not anticipated to be the bottleneck. It doesn't look like a nice Clojure interface has been written to let you directly manipulate BSON objects, but hopefully that won't be an issue. I will revise this entry if we decide that BSON won't work out for us.</p> <p>We chose RabbitMQ mainly because we already have experience with it and are using it in a system that demands high throughput and availability.</p> <p>If messaging does become a bottleneck, we will look first to BERT (we rejected it because it currently does not appear to have Java support), then to MessagePack (rejected because it appears that there isn't a large community of Java developers using it), then to Avro (rejected because it requires you to define your message format up-front), then Protocol Buffers (rejected because of the extra code generation step and lack of heterogeneous collections) and then Thrift (rejected for the reasons mentioned for Protocol Buffers).</p> <p>We may want to go with a plain RPC scheme rather than using a message queue since our messaging style is essentially synchronous point-to-point.</p> <p>Thanks for your input everyone!</p> <p>Update: Here is the <code>project.clj</code> and <code>core.clj</code> that shows how to convert Clojure maps to BSON and back:</p> <pre>;;;; project.clj (defproject bson-demo "0.0.1" :description "BSON Demo" :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contrib "1.2.0"] [org.mongodb/mongo-java-driver "2.1"]] :dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]] :main core) ;;;; core.clj (ns core (:gen-class) (:import [org.bson BasicBSONObject BSONEncoder BSONDecoder])) (defonce *encoder* (BSONEncoder.)) (defonce *decoder* (BSONDecoder.)) ;; XXX Does not accept keyword arguments. Convert clojure.lang.Keyword in map to java.lang.String first. (defn map-to-bson [m] (->> m (BasicBSONObject.) (.encode *encoder*))) (defn bson-to-map [^BasicBSONObject b] (->> (.readObject *decoder* b) (.toMap) (into {}))) (defn -main [] (let [m {"foo" "bar"}] (prn (bson-to-map (map-to-bson m)))))</pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload