# Recommended serialization interface in Oct 2020: JLD, JLD2,

**URL:** <https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994>\
**Category:** New to Julia\
**Tags:** question, jld, jld2\
**Created:** [October 25, 2020, 7:00pm UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994 "2020-10-25T19:00:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [October 25, 2020, 7:00pm UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/1 "2020-10-25T19:00:45Z")

</div>

Obviously a corporation like Mathworks (for all its limitations) shines in its ability to define an official serialization interface: .mat (complexity of .mat versions aside)

Is there any plan to do the same for JLDx? eg “everybody just use JLD2 from now on”.

-edit-  
Just read [this](https://discourse.julialang.org/t/what-is-the-preferred-way-to-save-variables/21918), now I’m even more confused, lol

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 26, 2020, 1:13am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/2 "2020-10-26T01:13:38Z")

</div>

Sometimes its good to have an open community building a ton of alternatives, sometimes it’s not as good. I think this is a place where it hasn’t turned out so good and someone needs to sit down and consolidate it. The summary right now is:

- Julia’s serialization is the best, but cannot necessarily cross versions.
- HDF5 is stable and won’t change, but that means it supports the basics (arrays and such), and that’s pretty much what it will do.
- JLD2 is great and got new maintainers. That might mean it’s the thing to use from now on, but I haven’t tried it since it got the new crew.
- BSON has some architectural issues and is in a maintenance state where it won’t change much.
- JSON is pretty nice if it works for the types you’re using.
- Anything else I wouldn’t consider, or at least, it’s “use at your own risk” levels of maintenance and use by the community.

I’d probably just stick to JLD2 from now on.

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [October 26, 2020, 2:04am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/3 "2020-10-26T02:04:12Z")

</div>

Would it be possible to write a cross-version deserialization package using the new libjulia\_jll’s?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 26, 2020, 2:24am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/4 "2020-10-26T02:24:23Z")

</div>

That is a fantastic question…

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [October 26, 2020, 3:42am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/5 "2020-10-26T03:42:46Z")

</div>

JLD2 is great, especially with new maintainers.

With one caveat: unless you can lock all package versions in a Manifest.toml file, avoid serializing types that you don’t own or aren’t in base. Package updates can change things that will break your .jld2 file.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [October 26, 2020, 9:16am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/6 "2020-10-26T09:16:08Z")

</div>

If you want to store in binary and reliability, long-term restorability, and, perhaps, cross language readability are important in your context I would go with HDF5. Basically every programming language supports it and although it only supports “basic objects” I never found this to be a big issue.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 26, 2020, 9:49am UTC](https://discourse.julialang.org/t/recommended-serialization-interface-in-oct-2020-jld-jld2/48994/7 "2020-10-26T09:49:17Z")

</div>

> [@carstenbauer](#):
>
> although it only supports “basic objects” I never found this to be a big issue

Actually, I think of the need to convert to “basic” types (strings, numbers, arrays of them) as a feature for medium- to long-term data storage.

Anything more complex is coupled too closely to the current state of packages (and in the medium run, Julia) for comfort.
