Home / Companies / Harper / Blog / Post Details
Content Deep Dive

Introducing Structon: Random-Access Binary Encoding for JavaScript

Blog post from Harper

Post Details
Company
Date Published
Author
Kris Zyp
Word Count
1,183
Company Posts That Month
12
Language
English
Hacker News Points
-
Post removed?
No
Summary

Harper's query evaluation process often requires efficient access to specific fields within large datasets, especially when handling multi-condition queries where only one condition can leverage an index scan. To address the inefficiencies of traditional data formats like JSON, MessagePack, and BSON, Harper employs a random-access encoding strategy using a binary format that allows direct field access via byte offsets. This method, previously integrated within msgpackr as a somewhat hidden feature, is now available as a standalone package called structon. Structon optimizes data storage and retrieval by sharing structure definitions across records with the same shape, reducing redundancy and improving read performance, particularly in scenarios involving filtered queries or large-scale data operations. This new approach facilitates compact data storage and faster field access without requiring full deserialization, and it supports seamless integration with existing encoders such as msgpackr and cbor-x. The package is designed to maintain compatibility with data encoded using previous methods and offers improved persistence of structure definitions for consistent performance across process restarts.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.