-
Notifications
You must be signed in to change notification settings - Fork 2
Investigate using Nippy for real back-ends #14
Comments
I would caution against Nippy given my past experience with it. Our managed dependencies literally have these two lines in them: ;; WARNING: do not update beyond 2.11.x (newer versions break all stored data)
[com.taoensso/nippy "2.11.1"] You might be interested in looking at CBOR instead. 😉 |
@greglook sorry for the aside but would you mind elaborating on those issues? Did you file an issue with Nippy I could look at? Thanks! The CBOR link doesn’t work by the way, maybe it’s private? |
Whoops, I typo'd the link - should be https://github.com/greglook/clj-cbor The issues we have with Nippy aren't really bugs in Nippy so much as problems with some of its fundamental design choices:
=> (require '[taoensso.nippy :as nippy])
=> (require '[clj-time.core :as time])
=> (time/now)
#<org.joda.time.DateTime@569ccb35 2018-11-02T18:01:40.278Z>
=> (nippy/freeze (time/now))
#whidbey/bin "TlBZAAYAAAAWb3JnLmpvZGEudGltZS5EYXRlVGltZaztAAVzcgAWb3JnLmpvZGEudGltZS5EYXRlVGltZbg8eGRqW935AgAAeHIAH29yZy5qb2RhLnRpbWUuYmFzZS5CYXNlRGF0ZVRpbWX///nhT10uowIAAkoAB2lNaWxsaXNMAAtpQ2hyb25vbG9neXQAGkxvcmcvam9kYS90aW1lL0Nocm9ub2xvZ3k7eHAAAAFm1ZaLznNyACdvcmcuam9kYS50aW1lLmNocm9uby5JU09DaHJvbm9sb2d5JFN0dWKpyBFmcTdQJwMAAHhwc3IAH29yZy5qb2RhLnRpbWUuRGF0ZVRpbWVab25lJFN0dWKmLwGafDIa4wMAAHhwdwUAA1VUQ3h4"
=> (io/copy *1 (io/file "now.nippy"))
Nippy's advantages are that it's very fast and it "just works" ... until things blow up later. I think it'd be okay as a transit codec, but I would not use it for a storage codec again. |
Interesting, thanks! EDIT Couldn't help myself but generate docs for |
Neat, thanks! I don't mean to bash on Nippy too hard - it is extremely efficient at representing the core set of types, and for many use-cases it's just fine. However, some of the idiosyncrasies above led to some unpleasant surprises after we'd been using it in production for a while. |
https://github.com/ptaoussanis/nippy seems like an easy off-the-shelf faster serialization story, even for the trivial dev stores.
The text was updated successfully, but these errors were encountered: