# Is serialization a safe option for data storage?

**URL:** <https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872>\
**Category:** General Usage\
**Tags:** question, data, serialization\
**Created:** [May 15, 2023, 10:26am UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872 "2023-05-15T10:26:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnldlg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnldlg/32/209465_2.png) [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Post date:** [May 15, 2023, 10:26am UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872/1 "2023-05-15T10:26:08Z")

</div>

In my code i last used text files to pass parameters and these parameters are finally processed and used in `structs`.  
I was wondering if I could save these `structs` directly to reduce the overhead in the code. One method I found [here](https://discourse.julialang.org/t/how-to-save-and-read-a-structure/71031) was [serialization](https://docs.julialang.org/en/v1/stdlib/Serialization/#Serialization.serialize). Is this a safe way to store data? Could it be that the data is no longer retrievable in higher versions of Julia, or is serialization a unified/unique algorithm?

Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 15, 2023, 10:38am UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872/2 "2023-05-15T10:38:21Z")

</div>

Looks like you already linked to the answer?

> The data format can change in minor (1.x) Julia releases, but files written by prior 1.x versions will remain readable.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 15, 2023, 12:06pm UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872/3 "2023-05-15T12:06:25Z")

</div>

You will be able to reliably read serialized files in newer Julia versions as long as you only save Base data types — nothing from installed packages.

Well, package types will also be readable as long as they don’t change, but you cannot count on that. It’s not generally possible to update Julia and keep the same Manifest with package versions.  
If you save your own structs, then make sure struct definitions remain unchanged afterwards.
