All Projects → arangodb → Velocypack

arangodb / Velocypack

Licence: apache-2.0
A fast and compact format for serialization and storage

Programming Languages

cplusplus
227 projects

Projects that are alternatives of or similar to Velocypack

Yyjson
The fastest JSON library in C
Stars: ✭ 1,894 (+445.82%)
Mutual labels:  json, serialization, performance
Thorsserializer
C++ Serialization library for JSON
Stars: ✭ 241 (-30.55%)
Mutual labels:  json, serialization
Jsonapi Rb
Efficiently produce and consume JSON API documents.
Stars: ✭ 219 (-36.89%)
Mutual labels:  json, serialization
Play Json
The Play JSON library
Stars: ✭ 254 (-26.8%)
Mutual labels:  json, serialization
Dart Json Mapper
Serialize / Deserialize Dart Objects to / from JSON
Stars: ✭ 206 (-40.63%)
Mutual labels:  json, serialization
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (-40.06%)
Mutual labels:  json, serialization
Rz Go
Ripzap - Fast and 0 allocs leveled JSON logger for Go ⚡️. Dependency free.
Stars: ✭ 256 (-26.22%)
Mutual labels:  json, performance
Srsly
🦉 Modern high-performance serialization utilities for Python (JSON, MessagePack, Pickle)
Stars: ✭ 189 (-45.53%)
Mutual labels:  json, serialization
Surrealist
to_json but I wrote it myself
Stars: ✭ 271 (-21.9%)
Mutual labels:  json, serialization
Shineframe
高性能超轻量级C++开发库及服务器编程框架
Stars: ✭ 274 (-21.04%)
Mutual labels:  json, serialization
Kotlinx.serialization
Kotlin multiplatform / multi-format serialization
Stars: ✭ 3,550 (+923.05%)
Mutual labels:  json, serialization
Chronicle Wire
A Java Serialisation Library that supports multiple formats
Stars: ✭ 204 (-41.21%)
Mutual labels:  json, serialization
Jsonlab
JSONLab: a native JSON/UBJSON/MassagePack encoder/decoder for MATLAB/Octave
Stars: ✭ 202 (-41.79%)
Mutual labels:  json, serialization
Zio Json
Fast, secure JSON library with tight ZIO integration.
Stars: ✭ 218 (-37.18%)
Mutual labels:  json, performance
Rapidyaml
Rapid YAML - a library to parse and emit YAML, and do it fast.
Stars: ✭ 183 (-47.26%)
Mutual labels:  json, serialization
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (-30.26%)
Mutual labels:  json, serialization
Bebop
An extremely simple, fast, efficient, cross-platform serialization format
Stars: ✭ 305 (-12.1%)
Mutual labels:  json, serialization
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (-49.28%)
Mutual labels:  json, serialization
Jsons
🐍 A Python lib for (de)serializing Python objects to/from JSON
Stars: ✭ 178 (-48.7%)
Mutual labels:  json, serialization
Panko serializer
High Performance JSON Serialization for ActiveRecord & Ruby Objects
Stars: ✭ 266 (-23.34%)
Mutual labels:  serialization, performance

VelocyPack (VPack) - a fast and compact format for serialization and storage

TravisCI: Build Status AppVeyor: Build status Coveralls: Coverage Status

Motivation

These days, JSON (JavaScript Object Notation, see ECMA-404) is used in many cases where data has to be exchanged. Lots of protocols between different services use it, databases store JSON (document stores naturally, but others increasingly as well). It is popular, because it is simple, human-readable, and yet surprisingly versatile, despite its limitations.

At the same time there is a plethora of alternatives ranging from XML over Universal Binary JSON, MongoDB's BSON, MessagePack, BJSON (binary JSON), Apache Thrift till Google's protocol buffers and ArangoDB's shaped JSON.

When looking into this, we were surprised to find that none of these formats manages to combine compactness, platform independence, fast access to sub-objects and rapid conversion from and to JSON.

We have invented VPack because we need a binary format that

  • is self-contained, schemaless and platform independent
  • is compact
  • covers all of JSON plus dates, integers, binary data and arbitrary precision numbers
  • can be used in a database kernel to access sub-documents for example for indexes, so it must be possible to access sub-documents (array and object members) efficiently
  • can be transferred to JSON and from JSON rapidly
  • avoids too many memory allocations
  • gives flexibility to assemble objects, such that sub-objects reside in the database in an unchanged way
  • allows to use an external table for frequently used attribute names
  • quickly allows to read off the type and length of a given object from its first byte(s)

All this gives us the possibility to use the same byte sequence of data for transport, storage and (read-only) work. Using a single data format not only eliminates a lot of conversions but can also reduce runtime memory usage, as data does only need a single in-memory representation.

The other popular formats we looked at have all some deficiency with respect to the above list. To name but a few:

  • JSON itself lacks some data types (dates and binary data) and does not provide quick sub-value access without parsing. Parsing JSON is also quite a challenge performance-wise
  • XML is not compact and is not good with binary data, it also lacks quick sub-value access
  • BSON gets quite a lot right with respect to data types, but is seriously lacking w.r.t. sub-value access. Furthermore, it is not very compact and quite wasteful space-wise when storing array values
  • Apache Thrift and Google's Protocol Buffers are not schemaless and self-contained. Their transport format is a serialization that is not good for rapid sub-value access
  • MessagePack is probably the closest to our shopping list. It has has decent data types and is quite compact. However, we found that one can do better in terms of compactness for some cases. More important for us, MessagePack provides no quick sub-value access
  • Our own shaped JSON (used in ArangoDB as internal storage format) has very quick sub-value access, but the shape data is kept outside the actual data, so the shaped values are not self-contained. Furthermore, we have run into scalability issues on multi-core because of the shared data structures used for interpretation of the values

Any new data format must be backed by good C++ classes to allow

  • easy and fast parsing from JSON
  • easy and convenient buildup without too many memory allocations
  • fast access to data and its sub-objects (for arrays and objects)
  • flexible memory management
  • fast dumping to JSON

The VelocyPack format is an attempt to achieve all this, and our first experiments and usage attempts are very encouraging.

This repository contains a C++ library for building, manipulating and serializing VPack data. It is the reference implementation for the VelocyPack format. The library is written in good old C++11 so it should compile on most systems.

Specification

See the file VelocyPack.md for a detailed description of the VPack format.

Performance

See the file Performance.md for a thorough comparison to other formats like JSON itself, MessagePack and BSON. We look at file sizes as well as parsing and conversion performance.

Building the VPack library

The VPack library can be built on Linux, MacOS and Windows. It will likely compile and work on other platforms for which a recent version of cmake and a working C++11-enabled compiler are available.

See the file Install.md for compilation and installation instructions.

Using the VPack library

Please consult the file examples/API.md for usage examples, and the file examples/Embedding.md for information about how to embed the library into client applications.

Contributing

We welcome bug fixes and patches from 3rd party contributors!

Please follow the guidelines in CONTRIBUTING.md if you want to contribute to VelocyPack. Have a look for the tag help wanted in the issue tracker!

We also provide a golang version of VPack in the go-velocypack repository and a Java version in the java-velocypack.

Additionally, there is a third party VPack implementation for PHP.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].