Big Data Management: Difference between revisions

From Stat DS Computing Wiki
Undo revision 773 by Ajshen (talk)
Tag: Undo
Undo revision 742 by Ajshen (talk)
Tag: Undo
Line 1: Line 1:
[[Category:Beginner's_Guide_Reproducibility|02]]
[[Category:Beginner's_Guide_Scaling|02]]


{{ReproducibilitySidebar}}
{{ScalingSidebar}}


'''Dependencies''' are any external software, libraries, or packages that your research workflow requires to execute. For example, data analysis in Python often relies on the NumPy or Pandas packages, while R workflows might rely heavily on the Tidyverse ecosystem.
As your research experiments scale up in size, effective data management and storage become just as important as computational efficiency. Working with large datasets—ranging from hundreds of gigabytes to several terabytes—requires specialized tools to move, store, and read/write data efficiently without bottlenecking your workflow or filling up the cluster.  


As your projects grow, it is critical to keep track of exactly which dependencies—and '''which specific versions''' of those dependencies—are being used. Unclear or insufficient dependency management is a leading cause of code breaking over time and is a major barrier to other researchers (or future you) reproducing your results.
This page covers basic procedures, best practices, and tools for handling large amounts of data on remote servers.
 
This page covers basic procedures, best practices, and tools for managing dependencies and encapsulating your computational environments.


<div style="background-color: #fff3cd; border-left: 5px solid #ffc107; padding: 15px; margin-bottom: 20px; margin-top: 15px; overflow: hidden;">
<div style="background-color: #fff3cd; border-left: 5px solid #ffc107; padding: 15px; margin-bottom: 20px; margin-top: 15px; overflow: hidden;">
'''Important: Project Isolation'''<br>
'''Important: Storage Quotas and Scratch Space'''<br>
A common beginner mistake is installing all packages globally into your computer's base environment. You should strive to create a '''separate, isolated environment''' for every distinct research project. This prevents version conflicts (e.g., Project A needs Python 3.9 but Project B requires Python 3.11) and makes it much easier to document your work.
Unlike your personal laptop, department and shared servers usually have strict storage quotas in your personal `/home` directory. It is therefore important to budget available space accordingly and adhere to best practices (such as regular cleanup of temporary files) when using these servers.
</div>
</div>


== 1. Virtual Environments ==
== 1. Moving Data ==
Virtual environments are lightweight, self-contained directories that contain a specific installation of a programming language and its packages. They are the first line of defense for reproducible code on your local machine.
Transferring gigabytes or terabytes of data over standard internet connections can be slow and prone to interruption. The tools below are designed to move data reliably between your local machine, the department servers, and external clusters.


<div style="background-color: #f8f9fa; border-left: 4px solid #6c757d; padding: 15px; margin-bottom: 10px;">
<div style="background-color: #f8f9fa; border-left: 4px solid #6c757d; padding: 15px; margin-bottom: 10px;">
'''[[Virtual Environment Introduction]]'''<br>
'''[[Command Line Data Transfer]]'''<br>
Introduces the core concepts of virtual environments for dependency management. Covers how to set up isolated workspaces using common tools like <code>venv</code> or <code>conda</code> for your analysis scripts.
Introduces basic Linux tools like <code>scp</code>, <code>rsync</code>, and <code>wget</code>. Ideal for moving small to medium-sized datasets or downloading data directly from the web to the server.
</div>
</div>
== 2. Containerization ==
While virtual environments handle software packages, they do not capture the underlying operating system or system-level libraries. Containers solve this by packaging your code along with the ''entire'' system environment it needs to run, ensuring perfect reproducibility across different machines and servers.


<div style="background-color: #f8f9fa; border-left: 4px solid #005A9C; padding: 15px; margin-bottom: 10px;">
<div style="background-color: #f8f9fa; border-left: 4px solid #005A9C; padding: 15px; margin-bottom: 10px;">
'''[[Introduction to containers]] & [[Docker, and why-you-should-use-it-for-your-research|Why Use Docker]]'''<br>
'''[[Globus]]'''<br>
A conceptual overview of what containers are, how they differ from traditional virtual machines, and why Docker has become an essential tool for robust research workflows.
A graphical, web-based application for moving and sharing massive files within and between institutions. Globus handles network interruptions automatically and is highly recommended for terabyte-scale transfers.
</div>
</div>
== 2. File Formats and I/O ==
When dealing with large data, traditional text formats like <code>.csv</code> take too long to read into memory and take up too much disk space. Transitioning to binary or columnar formats is a critical step in scaling up your research.


<div style="background-color: #f8f9fa; border-left: 4px solid #75AADB; padding: 15px; margin-bottom: 10px;">
<div style="background-color: #f8f9fa; border-left: 4px solid #75AADB; padding: 15px; margin-bottom: 10px;">
'''[[Tutorials|Docker Basic Tutorial]]'''<br>
'''[[Efficient Data Formats]] (TBW)'''<br>
A hands-on guide to building your first container. Learn how to write a basic <code>Dockerfile</code>, build an image, and execute your code inside an isolated container environment.
An overview of high-performance file formats like Parquet, Feather, and HDF5. Explains how to read and write these formats in R and Python to drastically speed up your load times.
</div>
</div>


<div style="background-color: #f8f9fa; border-left: 4px solid #6f42c1; padding: 15px; margin-bottom: 10px;">
<div style="background-color: #f8f9fa; border-left: 4px solid #6f42c1; padding: 15px; margin-bottom: 10px;">
'''[[Running Docker locally and on Hydras]]'''<br>
'''[[Data Compression on Linux]] (TBW)'''<br>
Specific instructions for scaling up your containerized workflows. Covers how to test your Docker containers locally and subsequently deploy them on the department's Hydra computing clusters.
How to use <code>tar</code>, <code>gzip</code>, and <code>zip</code> on the command line to compress large directories of files before transferring or archiving them.
</div>
 
== 3. Out-of-Memory Processing ==
Sometimes, a dataset is simply too large to load into the RAM of even our largest servers. These tools allow you to query and manipulate datasets that exceed available memory.
 
<div style="background-color: #f8f9fa; border-left: 4px solid #dc3545; padding: 15px; margin-bottom: 10px;">
'''[[Out-of-Memory Data Manipulation]] (TBW)'''<br>
An introduction to modern tools like DuckDB, Apache Arrow, or Dask. Learn how to filter, mutate, and aggregate massive datasets on disk before loading the smaller, processed results into RAM for statistical modeling.
</div>
</div>

Revision as of 02:03, 29 June 2026


Scaling Checklist
Back to Beginner's Guide

As your research experiments scale up in size, effective data management and storage become just as important as computational efficiency. Working with large datasets—ranging from hundreds of gigabytes to several terabytes—requires specialized tools to move, store, and read/write data efficiently without bottlenecking your workflow or filling up the cluster.

This page covers basic procedures, best practices, and tools for handling large amounts of data on remote servers.

Important: Storage Quotas and Scratch Space
Unlike your personal laptop, department and shared servers usually have strict storage quotas in your personal `/home` directory. It is therefore important to budget available space accordingly and adhere to best practices (such as regular cleanup of temporary files) when using these servers.

1. Moving Data

Transferring gigabytes or terabytes of data over standard internet connections can be slow and prone to interruption. The tools below are designed to move data reliably between your local machine, the department servers, and external clusters.

Command Line Data Transfer
Introduces basic Linux tools like scp, rsync, and wget. Ideal for moving small to medium-sized datasets or downloading data directly from the web to the server.

Globus
A graphical, web-based application for moving and sharing massive files within and between institutions. Globus handles network interruptions automatically and is highly recommended for terabyte-scale transfers.

2. File Formats and I/O

When dealing with large data, traditional text formats like .csv take too long to read into memory and take up too much disk space. Transitioning to binary or columnar formats is a critical step in scaling up your research.

Efficient Data Formats (TBW)
An overview of high-performance file formats like Parquet, Feather, and HDF5. Explains how to read and write these formats in R and Python to drastically speed up your load times.

Data Compression on Linux (TBW)
How to use tar, gzip, and zip on the command line to compress large directories of files before transferring or archiving them.

3. Out-of-Memory Processing

Sometimes, a dataset is simply too large to load into the RAM of even our largest servers. These tools allow you to query and manipulate datasets that exceed available memory.

Out-of-Memory Data Manipulation (TBW)
An introduction to modern tools like DuckDB, Apache Arrow, or Dask. Learn how to filter, mutate, and aggregate massive datasets on disk before loading the smaller, processed results into RAM for statistical modeling.