apache-arrow vs parquetjs
Data Serialization Libraries Comparison
1 Year
apache-arrowparquetjs
What's Data Serialization Libraries?

Data serialization libraries are essential in web development for efficiently encoding and decoding complex data structures into a format suitable for storage or transmission. They enable developers to work with large datasets in a performant manner, facilitating data interchange between systems. Apache Arrow and Parquet.js are two prominent libraries that serve different purposes in this domain. Apache Arrow focuses on in-memory columnar data representation, optimizing analytics workloads, while Parquet.js is designed for reading and writing Parquet files, a popular columnar storage format optimized for big data processing. Understanding their unique features and use cases is crucial for making informed decisions in data handling.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
apache-arrow539,08115,0575.31 MB4,51914 days agoApache-2.0
parquetjs42,108356219 kB82-MIT
Feature Comparison: apache-arrow vs parquetjs

Data Format

  • apache-arrow:

    Apache Arrow provides a standardized columnar memory format that allows for efficient analytics and data processing. It enables zero-copy reads for fast access to data, making it suitable for high-performance applications that need to process large datasets in memory.

  • parquetjs:

    Parquet.js utilizes the Parquet file format, which is a columnar storage format optimized for use with big data processing frameworks. It is designed to support efficient compression and encoding schemes, making it ideal for storing large amounts of data while minimizing storage costs.

Performance

  • apache-arrow:

    Apache Arrow is optimized for performance, allowing for fast data access and manipulation. Its columnar format enables vectorized processing, which can significantly speed up analytical queries and operations on large datasets, making it suitable for real-time analytics.

  • parquetjs:

    Parquet.js is optimized for reading and writing large datasets efficiently. It supports various compression algorithms, which help reduce the size of the data on disk and improve I/O performance when accessing data, making it suitable for big data applications.

Interoperability

  • apache-arrow:

    Apache Arrow is designed for interoperability between different data processing systems and languages. It provides a common data representation that can be used across various frameworks, such as Apache Spark, Pandas, and others, facilitating seamless data exchange.

  • parquetjs:

    Parquet.js is widely used in the big data ecosystem, and its compatibility with various data processing tools and languages makes it a popular choice for data storage. It can be easily integrated with systems like Apache Hive, Apache Spark, and others that support the Parquet format.

Use Cases

  • apache-arrow:

    Apache Arrow is ideal for applications that require high-performance analytics, such as data science and machine learning workloads. It is particularly useful when working with large in-memory datasets that need to be processed quickly and efficiently.

  • parquetjs:

    Parquet.js is best suited for scenarios where data needs to be stored in a columnar format for efficient querying and analysis. It is commonly used in data warehousing, ETL processes, and big data analytics, where large volumes of data need to be managed.

Ecosystem and Community

  • apache-arrow:

    Apache Arrow has a strong ecosystem and community support, with contributions from various organizations and developers. It is part of the Apache Software Foundation, which ensures ongoing development and maintenance, making it a reliable choice for long-term projects.

  • parquetjs:

    Parquet.js benefits from the popularity of the Parquet format in the big data community. It has a growing user base and is often updated to keep pace with advancements in data processing technologies, ensuring it remains relevant and effective.

How to Choose: apache-arrow vs parquetjs
  • apache-arrow:

    Choose Apache Arrow if you need a high-performance in-memory data format that allows for efficient analytics and data interchange between different systems. It is particularly useful for applications that require fast data processing and interoperability with various data processing frameworks.

  • parquetjs:

    Choose Parquet.js if your primary need is to read and write Parquet files, especially when dealing with large datasets in a big data context. It is ideal for applications that require efficient storage and retrieval of columnar data, making it suitable for data warehousing and analytics.

README for apache-arrow

Apache Arrow in JS

npm version

Arrow is a set of technologies that enable big data systems to process and transfer data quickly.

Install apache-arrow from NPM

npm install apache-arrow or yarn add apache-arrow

(read about how we package apache-arrow below)

Powering Columnar In-Memory Analytics

Apache Arrow is a columnar memory layout specification for encoding vectors and table-like containers of flat and nested data. The Arrow spec aligns columnar data in memory to minimize cache misses and take advantage of the latest SIMD (Single input multiple data) and GPU operations on modern processors.

Apache Arrow is the emerging standard for large in-memory columnar data (Spark, Pandas, Drill, Graphistry, ...). By standardizing on a common binary interchange format, big data systems can reduce the costs and friction associated with cross-system communication.

Get Started

Check out our API documentation to learn more about how to use Apache Arrow's JS implementation. You can also learn by example by checking out some of the following resources:

Cookbook

Get a table from an Arrow file on disk (in IPC format)

import { readFileSync } from 'fs';
import { tableFromIPC } from 'apache-arrow';

const arrow = readFileSync('simple.arrow');
const table = tableFromIPC(arrow);

console.table(table.toArray());

/*
 foo,  bar,  baz
   1,    1,   aa
null, null, null
   3, null, null
   4,    4,  bbb
   5,    5, cccc
*/

Create a Table when the Arrow file is split across buffers

import { readFileSync } from 'fs';
import { tableFromIPC } from 'apache-arrow';

const table = tableFromIPC([
    'latlong/schema.arrow',
    'latlong/records.arrow'
].map((file) => readFileSync(file)));

console.table([...table]);

/*
        origin_lat,         origin_lon
35.393089294433594,  -97.6007308959961
35.393089294433594,  -97.6007308959961
35.393089294433594,  -97.6007308959961
29.533695220947266, -98.46977996826172
29.533695220947266, -98.46977996826172
*/

Create a Table from JavaScript arrays

import { tableFromArrays } from 'apache-arrow';

const LENGTH = 2000;

const rainAmounts = Float32Array.from(
    { length: LENGTH },
    () => Number((Math.random() * 20).toFixed(1)));

const rainDates = Array.from(
    { length: LENGTH },
    (_, i) => new Date(Date.now() - 1000 * 60 * 60 * 24 * i));

const rainfall = tableFromArrays({
    precipitation: rainAmounts,
    date: rainDates
});

console.table([...rainfall]);

Load data with fetch

import { tableFromIPC } from "apache-arrow";

const table = await tableFromIPC(fetch("/simple.arrow"));

console.table([...table]);

Vectors look like JS Arrays

You can create vector from JavaScript typed arrays with makeVector and from JavaScript arrays with vectorFromArray. makeVector is a lot faster and does not require a copy.

import { makeVector } from "apache-arrow";

const LENGTH = 2000;

const rainAmounts = Float32Array.from(
    { length: LENGTH },
    () => Number((Math.random() * 20).toFixed(1)));

const vector = makeVector(rainAmounts);

const typed = vector.toArray()

assert(typed instanceof Float32Array);

for (let i = -1, n = vector.length; ++i < n;) {
    assert(vector.get(i) === typed[i]);
}

String vectors

Strings can be encoded as UTF-8 or dictionary encoded UTF-8. Dictionary encoding encodes repeated values more efficiently. You can create a dictionary encoded string conveniently with vectorFromArray or efficiently with makeVector.

import { makeVector, vectorFromArray, Dictionary, Uint8, Utf8 } from "apache-arrow";

const utf8Vector = vectorFromArray(['foo', 'bar', 'baz'], new Utf8);

const dictionaryVector1 = vectorFromArray(
    ['foo', 'bar', 'baz', 'foo', 'bar']
);

const dictionaryVector2 = makeVector({
    data: [0, 1, 2, 0, 1],  // indexes into the dictionary
    dictionary: utf8Vector,
    type: new Dictionary(new Utf8, new Uint8)
});

Getting involved

See DEVELOP.md

Even if you do not plan to contribute to Apache Arrow itself or Arrow integrations in other projects, we'd be happy to have you involved:

We prefer to receive contributions in the form of GitHub pull requests. Please send pull requests against the github.com/apache/arrow repository.

If you are looking for some ideas on what to contribute, check out the GitHub issues for the Apache Arrow project. Comment on the issue and/or contact dev@arrow.apache.org with your questions and ideas.

If you’d like to report a bug but don’t have time to fix it, you can still post it on GitHub issues, or email the mailing list dev@arrow.apache.org

Packaging

apache-arrow is written in TypeScript, but the project is compiled to multiple JS versions and common module formats.

The base apache-arrow package includes all the compilation targets for convenience, but if you're conscientious about your node_modules footprint, we got you.

The targets are also published under the @apache-arrow namespace:

npm install apache-arrow # <-- combined es2015/CommonJS/ESModules/UMD + esnext/UMD
npm install @apache-arrow/ts # standalone TypeScript package
npm install @apache-arrow/es5-cjs # standalone es5/CommonJS package
npm install @apache-arrow/es5-esm # standalone es5/ESModules package
npm install @apache-arrow/es5-umd # standalone es5/UMD package
npm install @apache-arrow/es2015-cjs # standalone es2015/CommonJS package
npm install @apache-arrow/es2015-esm # standalone es2015/ESModules package
npm install @apache-arrow/es2015-umd # standalone es2015/UMD package
npm install @apache-arrow/esnext-cjs # standalone esNext/CommonJS package
npm install @apache-arrow/esnext-esm # standalone esNext/ESModules package
npm install @apache-arrow/esnext-umd # standalone esNext/UMD package

Why we package like this

The JS community is a diverse group with a varied list of target environments and tool chains. Publishing multiple packages accommodates projects of all stripes.

If you think we missed a compilation target and it's a blocker for adoption, please open an issue.

Supported Browsers and Platforms

The bundles we compile support moderns browser released in the last 5 years. This includes supported versions of Firefox, Chrome, Edge, and Safari. We do not actively support Internet Explorer. Apache Arrow also works on maintained versions of Node.

People

Full list of broader Apache Arrow committers.

  • Brian Hulette, committer
  • Paul Taylor, committer
  • Dominik Moritz, committer

Powered By Apache Arrow in JS

Full list of broader Apache Arrow projects & organizations.

Open Source Projects

  • Apache Arrow -- Parent project for Powering Columnar In-Memory Analytics, including affiliated open source projects
  • Perspective -- Perspective is an interactive analytics and data visualization component well-suited for large and/or streaming datasets. Perspective leverages Arrow C++ compiled to WebAssembly.
  • Falcon is a visualization tool for linked interactions across multiple aggregate visualizations of millions or billions of records.
  • Vega is an ecosystem of tools for interactive visualizations on the web. The Vega team implemented an Arrow loader.
  • Arquero is a library for query processing and transformation of array-backed data tables.
  • OmniSci is a GPU database. Its JavaScript connector returns Arrow dataframes.

License

Apache 2.0