It's definitely a tradeoff. In my experience, it's well worth it. For
messaging, I use a union of the possible message schemas. I wrote a library
(https://github.com/deercreeklabs/capsule) that makes messaging (events and
RPC) simple and easy. It uses Lancaster / Avro over WebSockets.
Unfortunately, it is not yet documented for public use. I hope to get to
that early in the new year.

For persisting data in storage, I store the fingerprint64 of the schema
along with the data, then have a lookup table of fingerprint64 to schemas.
Again, this works very well for me. Your mileage may vary.

Avro's compact size and Lancaster's speed make it very nice for messaging
and data storage. I also value having the data types validated at
serialization time. I love dynamic typing, but believe that types should be
checked at boundaries (messaging, storage, etc.). Lancaster makes it easy
to do that.

Chad Harrington
chad.harring...@gmail.com


On Sun, Nov 18, 2018 at 9:59 PM Gerard Klijs <ger...@openweb.nl> wrote:

> The big penalty for the smaller size is that you need the scheme in order
> to deserialize the message. This can make some uses much more complex. For
> example when sending multiple types of messages, the client somehow needs
> to know which schema is used.
> How Avro is used with the Confluent Schema registry this is solved by
> having a way to globally register schema's, and encode the global id in the
> message.
> It looks similar to https://github.com/damballa/abracad which hasn't been
> updated in a while, but I use it in a pet project to use Avro from Closure.
> I might try replacing it.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to