# A question about JLD2

**URL:** <https://discourse.julialang.org/t/a-question-about-jld2/15292>\
**Category:** General Usage\
**Created:** [September 21, 2018, 4:02pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292 "2018-09-21T16:02:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_McBane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sean_mcbane/32/4580_2.png) [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Post date:** [September 21, 2018, 4:02pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292/1 "2018-09-21T16:02:27Z")

</div>

I am developing a generic package implementing a parallel algorithm and I want to provide generic IO routines for user types. I know that JLD2 may have breakage between Julia releases because the serialization of types is not guaranteed to be backwards-compatible. However, I would like to guarantee that if a user’s types are raw arrays then they will be able to read back in the stored data. Does JLD2 guarantee this? I can always allow a method for data storage that provides a custom serialization function to convert a user type to a raw array and then use JLD2 as backend to write that array.

---

<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:** [September 21, 2018, 4:39pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292/2 "2018-09-21T16:39:46Z")

</div>

> [@Sean\_McBane](#):
>
> because the serialization of types is not guaranteed to be backwards-compatible

AFAIK JLD2 does not uses Julia’s serialization, but a subset of HDF5, so it should be OK.

> [@Sean\_McBane](#):
>
> if a user’s types are raw arrays then they will be able to read back in the stored data

If by “raw arrays”, you mean commonly used primitive bitstypes like defined in `Base` like `Int32` and `Float64`, you should be fine.

---

<div class="post-metadata">

**Author:** ![Sean\_McBane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sean_mcbane/32/4580_2.png) [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Post date:** [September 21, 2018, 4:47pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292/3 "2018-09-21T16:47:26Z")

</div>

Yeah, that’s what I was getting at. How does JLD2 serialize arbitrary Julia types using only the HDF5 standard?

---

<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:** [September 21, 2018, 4:51pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292/4 "2018-09-21T16:51:43Z")

</div>

AFAIK it has its own format, but takes advantage of HDF5 features when it can.
