{"id":15013018,"url":"https://github.com/sourcemeta/jsonbinpack","last_synced_at":"2025-07-06T16:35:13.094Z","repository":{"id":48138345,"uuid":"401125682","full_name":"sourcemeta/jsonbinpack","owner":"sourcemeta","description":"A binary JSON serialization format based on JSON Schema 2020-12 with a strong focus on space-efficiency","archived":false,"fork":false,"pushed_at":"2025-02-12T18:46:46.000Z","size":20105,"stargazers_count":148,"open_issues_count":11,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T09:10:38.512Z","etag":null,"topics":["binary-serialization","data-serialization","json","json-schema","jsonschema","space-efficiency"],"latest_commit_sha":null,"homepage":"https://jsonbinpack.sourcemeta.com/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcemeta.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sourcemeta"}},"created_at":"2021-08-29T19:29:48.000Z","updated_at":"2025-03-21T05:59:14.000Z","dependencies_parsed_at":"2024-05-09T01:26:54.272Z","dependency_job_id":"fcf2a4cf-3d3f-4cc4-ba2b-d34fe7e6ae12","html_url":"https://github.com/sourcemeta/jsonbinpack","commit_stats":{"total_commits":877,"total_committers":2,"mean_commits":438.5,"dds":"0.0011402508551880963","last_synced_commit":"13f0ff3c8c46851175b98c065d05436ff0b775d2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonbinpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonbinpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonbinpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonbinpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcemeta","download_url":"https://codeload.github.com/sourcemeta/jsonbinpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-serialization","data-serialization","json","json-schema","jsonschema","space-efficiency"],"created_at":"2024-09-24T19:43:36.599Z","updated_at":"2025-04-05T10:07:38.230Z","avatar_url":"https://github.com/sourcemeta.png","language":"C++","readme":"**This is a work-in-progress. Please consider starring or watching the repository\nto stay up to date.**\n\n***\n\n![JSON BinPack](./assets/banner.png)\n\nJSON BinPack is an open-source binary JSON serialization format with a **strong\nfocus on space efficiency**. It supports schema-driven and schema-less modes to\nencode any [JSON](https://www.json.org) document given a matching [JSON Schema\n2020-12](http://json-schema.org) definition.\n\n![](./assets/example.png)\n\n- **Highly Space-efficient**: A reproducible benchmark study has proven JSON\n  BinPack to be space-efficient in comparison to 12 alternative binary\n  serialization formats in every considered case. Additionally, JSON BinPack\n  typically provides higher average size reduction than general purpose\n  compressors such as GZIP, LZMA and LZ4 with the highest compression levels.\n\n    [Take a look at the benchmark](https://benchmark.sourcemeta.com)\n\n- **Based on JSON Schema**: JSON BinPack adopts the industry-standard schema\n  language for JSON documents. Re-use the same schemas you already have in your\n  OpenAPI, AsyncAPI, RAML or other specifications. No need to learn more\n  domain-specific schema languages or attempt to translate between them.\n\n    [Learn more about JSON Schema](https://json-schema.org/)\n\n- **Optional Schema**: JSON BinPack is a hybrid serialization format that runs\n  in both schema-driven and schema-less modes. Thanks to JSON Schema, JSON\n  BinPack allows you to be as loose or specific as your use case demands, even\n  within the same document, without having to use different serialization\n  technologies.\n\n    [Read more about JSON Schema as a constraint system](https://modern-json-schema.com/json-schema-is-a-constraint-system)\n\nDocumentation\n-------------\n\nRefer to the project website for reference documentation:\n[https://jsonbinpack.sourcemeta.com](https://jsonbinpack.sourcemeta.com).\n\nDo you have any questions? Open a ticket on [GitHub\nDiscussions](https://github.com/sourcemeta/jsonbinpack/discussions)!\n\nFrequently Asked Questions\n--------------------------\n\n### How does JSON BinPack compare to compression formats like GZIP?\n\nOur [reproducible benchmark study](https://benchmark.sourcemeta.com) shows that\nthe semantic information provided by detailed schema definitions enables a\nserialization format such as JSON BinPack to often outperform general-purpose\ncompressors configured with even their highest supported compression levels,\nspecially for small and medium-sized JSON documents. For large JSON documents,\nyou can experiment combining JSON BinPack with a compression format to\npotentially achieve greater space-efficiency.\n\n### JSON BinPack is space-efficient, but what about runtime-efficiency?\n\nWhen transmitting data over the Internet, time is the bottleneck, making\ncomputation much cheaper in comparison. Leaving extremely low-powered devices\naside, trading more CPU cycles for better compression is a sensible choice.\nJSON BinPack particularly excels at improving network performance when\ntransmitting data through unreliable and low-bandwidth connections on mobile\nand IoT systems, and it is still optimized to deliver the best runtime\nefficiency possible.\n\nIf your use-case demands extreme runtime-efficiency or zero-copy serialization,\nsuch as in the case of intra-service or inter-process communication, we suggest\nyou consider alternative serialization formats such as\n[FlatBuffers](https://google.github.io/flatbuffers/) and [Cap'n\nProto](https://capnproto.org/).\n\n### How does JSON BinPack handle unknown fields?\n\nJSON BinPack serializes any instance that matches its JSON Schema definition.\nJSON Schema is an expressive constrain-based language that permits\nschema-writers to be as strict or loose on defining data as they wish. As a\nconsequence of adopting JSON Schema, JSON BinPack elegantly supports encoding\nfree-form data and unknown fields as long as the corresponding JSON Schema\ndefinition successfully validates the data.\n\nHowever, deserializing data that does not match the given JSON Schema\ndefinition is undefined behavior and will likely result in an exception being\nthrown.\n\n### How does JSON BinPack compare to [alternative]?\n\nWe maintain a [live benchmark](https://benchmark.sourcemeta.com/) comparing\nJSON BinPack to various popular alternatives, including Protocol Buffers, CBOR,\nMessagePack, Apache Avro, and more. We also published an [academic\npaper](https://arxiv.org/abs/2211.12799) discussing the benchmark results in\nmore detail. In summary, you can expect JSON BinPack to be as or more\nspace-efficient than every alternative in every tested case.\n\n### How does JSON BinPack support schema evolution?\n\nIn comparison to schema-driven alternatives like Protocol Buffers and Apache\nAvro that invented their own specialized schema language, JSON BinPack adopts a\npopular and industry-standard one: [JSON Schema](https://json-schema.org/).\nThis means that you can use JSON BinPack alongside any schema evolution tooling\nor approach from the wider JSON Schema ecosystem. A popular one from the\ndecentralised systems world is\n[Cambria](https://www.inkandswitch.com/cambria/).\n\n***\n\nDo you have further questions or feedback? Don't hesitate in reaching out on\n[GitHub\nDiscussions](https://github.com/sourcemeta/jsonbinpack/discussions)!\n\nResearch\n--------\n\nJSON BinPack is the result of extensive binary serialization research at the\nDepartment of Computer Science of University of Oxford. The project is led by\nJuan Cruz Viotti, a computer scientist with first-hand exposure to the problem\nof space-efficient network communication in the context of IoT and APIs, under\nthe supervision of Mital Kinderkhedia.\n\n- [JSON BinPack: A space-efficient schema-driven and schema-less binary\nserialization specification based on JSON\nSchema](https://www.jviotti.com/dissertation.pdf)\n\n    - Awarded the 2022 CAR Hoare Prize for the best performance on the project\n      in the MSc in Software Engineering\n    - Awarded the 2022 CAR Hoare Prize for the best performance in the\n      examination by coursework in the MSc in Software Engineering\n\n- [Benchmarking JSON BinPack](https://arxiv.org/abs/2211.12799)\n- [A benchmark of JSON-compatible binary serialization\n  specifications](https://arxiv.org/abs/2201.03051)\n- [A survey of JSON-compatible binary serialization\n  specification](https://arxiv.org/abs/2201.02089)\n","funding_links":["https://github.com/sponsors/sourcemeta"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta%2Fjsonbinpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcemeta%2Fjsonbinpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta%2Fjsonbinpack/lists"}