Advice on dealing with very large datasets - HDF5, Python












1












$begingroup$


I've recently started working on an application for visualization of really big datasets. While reading online it became apparent that most people use HDF5 for storing big, multi-dimensional datasets as it offers the versatility to allow many dimensions, has no file size limits and is transferable between OSs.



My question is how to best deal with very large files. I am working with datasets that have 3-dimensions, all of which have large number of components (example size: 62,500 x 500,000 x 3,500, 32-bit int) which is a little problematic. HDF5 is theoretically able to deal with this, however, I've discovered it is really slow to write the data into the file and subsequently slow to retrieve it. Because the number of items is very large, data must be compressed otherwise it becomes insanely large on the HDD, however compression requires chunking and chunking is quite tricky to get right... I receive my data in (1 x 500,000 x 3500) chunks so it makes sense to write it one row at a time so with those dimensions and I ensure that chunks have dimensions (1 x n_values x 3500) to speed-up writing and data retrieval and have relatively small size (< 1Mb) for quick compression/decompression.



Does anyone have any experience in how to efficiently write to HDF5 files when the size of each dimension is v. large? Are there any tricks that could help?



I should also mention that I mostly work in Python, however, would be happy to do it in another language. I've tried increasing the chunk cache via the h5py_cache library.










share|improve this question







New contributor




munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$

















    1












    $begingroup$


    I've recently started working on an application for visualization of really big datasets. While reading online it became apparent that most people use HDF5 for storing big, multi-dimensional datasets as it offers the versatility to allow many dimensions, has no file size limits and is transferable between OSs.



    My question is how to best deal with very large files. I am working with datasets that have 3-dimensions, all of which have large number of components (example size: 62,500 x 500,000 x 3,500, 32-bit int) which is a little problematic. HDF5 is theoretically able to deal with this, however, I've discovered it is really slow to write the data into the file and subsequently slow to retrieve it. Because the number of items is very large, data must be compressed otherwise it becomes insanely large on the HDD, however compression requires chunking and chunking is quite tricky to get right... I receive my data in (1 x 500,000 x 3500) chunks so it makes sense to write it one row at a time so with those dimensions and I ensure that chunks have dimensions (1 x n_values x 3500) to speed-up writing and data retrieval and have relatively small size (< 1Mb) for quick compression/decompression.



    Does anyone have any experience in how to efficiently write to HDF5 files when the size of each dimension is v. large? Are there any tricks that could help?



    I should also mention that I mostly work in Python, however, would be happy to do it in another language. I've tried increasing the chunk cache via the h5py_cache library.










    share|improve this question







    New contributor




    munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$















      1












      1








      1





      $begingroup$


      I've recently started working on an application for visualization of really big datasets. While reading online it became apparent that most people use HDF5 for storing big, multi-dimensional datasets as it offers the versatility to allow many dimensions, has no file size limits and is transferable between OSs.



      My question is how to best deal with very large files. I am working with datasets that have 3-dimensions, all of which have large number of components (example size: 62,500 x 500,000 x 3,500, 32-bit int) which is a little problematic. HDF5 is theoretically able to deal with this, however, I've discovered it is really slow to write the data into the file and subsequently slow to retrieve it. Because the number of items is very large, data must be compressed otherwise it becomes insanely large on the HDD, however compression requires chunking and chunking is quite tricky to get right... I receive my data in (1 x 500,000 x 3500) chunks so it makes sense to write it one row at a time so with those dimensions and I ensure that chunks have dimensions (1 x n_values x 3500) to speed-up writing and data retrieval and have relatively small size (< 1Mb) for quick compression/decompression.



      Does anyone have any experience in how to efficiently write to HDF5 files when the size of each dimension is v. large? Are there any tricks that could help?



      I should also mention that I mostly work in Python, however, would be happy to do it in another language. I've tried increasing the chunk cache via the h5py_cache library.










      share|improve this question







      New contributor




      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      I've recently started working on an application for visualization of really big datasets. While reading online it became apparent that most people use HDF5 for storing big, multi-dimensional datasets as it offers the versatility to allow many dimensions, has no file size limits and is transferable between OSs.



      My question is how to best deal with very large files. I am working with datasets that have 3-dimensions, all of which have large number of components (example size: 62,500 x 500,000 x 3,500, 32-bit int) which is a little problematic. HDF5 is theoretically able to deal with this, however, I've discovered it is really slow to write the data into the file and subsequently slow to retrieve it. Because the number of items is very large, data must be compressed otherwise it becomes insanely large on the HDD, however compression requires chunking and chunking is quite tricky to get right... I receive my data in (1 x 500,000 x 3500) chunks so it makes sense to write it one row at a time so with those dimensions and I ensure that chunks have dimensions (1 x n_values x 3500) to speed-up writing and data retrieval and have relatively small size (< 1Mb) for quick compression/decompression.



      Does anyone have any experience in how to efficiently write to HDF5 files when the size of each dimension is v. large? Are there any tricks that could help?



      I should also mention that I mostly work in Python, however, would be happy to do it in another language. I've tried increasing the chunk cache via the h5py_cache library.







      python bigdata hierarchical-data-format






      share|improve this question







      New contributor




      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 12 hours ago









      munieq11munieq11

      61




      61




      New contributor




      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      munieq11 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "557"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          munieq11 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47748%2fadvice-on-dealing-with-very-large-datasets-hdf5-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          munieq11 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          munieq11 is a new contributor. Be nice, and check out our Code of Conduct.













          munieq11 is a new contributor. Be nice, and check out our Code of Conduct.












          munieq11 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47748%2fadvice-on-dealing-with-very-large-datasets-hdf5-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to label and detect the document text images

          Vallis Paradisi

          Tabula Rosettana