• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# EJDB 2.0
2
3[![Join Telegram](https://img.shields.io/badge/join-ejdb2%20telegram-0088cc.svg)](https://tlg.name/ejdb2)
4[![license](https://img.shields.io/github/license/Softmotions/ejdb.svg)](https://github.com/Softmotions/ejdb/blob/master/LICENSE)
5![maintained](https://img.shields.io/maintenance/yes/2022.svg)
6
7EJDB2 is an embeddable JSON database engine published under MIT license.
8
9[The Story of the IT-depression, birds and EJDB 2.0](https://medium.com/@adamansky/ejdb2-41670e80897c)
10
11* C11 API
12* Single file database
13* Online backups support
14* 500K library size for Android
15* [iOS](https://github.com/Softmotions/EJDB2Swift) / [Android](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_android/test) / [React Native](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_react_native) / [Flutter](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_flutter) integration
16* Simple but powerful query language (JQL) as well as support of the following standards:
17  * [rfc6902](https://tools.ietf.org/html/rfc6902) JSON Patch
18  * [rfc7386](https://tools.ietf.org/html/rfc7386) JSON Merge patch
19  * [rfc6901](https://tools.ietf.org/html/rfc6901) JSON Path
20* [Support of collection joins](#jql-collection-joins)
21* Powered by [iowow.io](http://iowow.io) - The persistent key/value storage engine
22* HTTP REST/Websockets endpoints powered by [IWNET](https://github.com/Softmotions/iwnet) and [BearSSL](https://github.com/Softmotions/BearSSL).
23* JSON documents are stored in using fast and compact [binn](https://github.com/liteserver/binn) binary format
24
25---
26* [Native language bindings](#native-language-bindings)
27* Supported platforms
28  * [macOS](#osx)
29  * [iOS](https://github.com/Softmotions/EJDB2Swift)
30  * [Linux](#linux)
31  * [Android](#android)
32  * [Windows](#windows)
33* **[JQL query language](#jql)**
34  * [Grammar](#jql-grammar)
35  * [Quick into](#jql-quick-introduction)
36  * [Data modification](#jql-data-modification)
37  * [Projections](#jql-projections)
38  * [Collection joins](#jql-collection-joins)
39  * [Sorting](#jql-sorting)
40  * [Query options](#jql-options)
41* [Indexes and performance](#jql-indexes-and-performance-tips)
42* [Network API](#http-restwebsocket-api-endpoint)
43  * [HTTP API](#http-api)
44  * [Websockets API](#websocket-api)
45* [C API](#c-api)
46* [License](#license)
47---
48
49[![EJDB2 Presentation](https://iowow.softmotions.com/articles/ejdb-presentation-cover.png)](https://iowow.softmotions.com/articles/ejdb/)
50
51## EJDB2 platforms matrix
52
53|              | Linux              | macOS               | iOS                | Android            | Windows            |
54| ---          | ---                | ---                 | ---                | ---                | ---                |
55| C library    | :heavy_check_mark: | :heavy_check_mark:  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark:<sup>1</sup> |
56| NodeJS       | :heavy_check_mark: | :heavy_check_mark:  |                    |                    | :x:<sup>3</sup>    |
57| DartVM       | :heavy_check_mark: | :heavy_check_mark:<sup>2</sup> |         |                    | :x:<sup>3</sup>    |
58| Flutter      |                    |                     | :heavy_check_mark: | :heavy_check_mark: |                    |
59| React Native |                    |                     | :x:<sup>4</sup>    | :heavy_check_mark: |                    |
60| Swift        | :heavy_check_mark: | :heavy_check_mark:  | :heavy_check_mark: |                    |                    |
61| Java         | :heavy_check_mark: | :heavy_check_mark:  |                    | :heavy_check_mark: | :heavy_check_mark:<sup>2</sup> |
62
63
64<br> `[1]` No HTTP/Websocket support [#257](https://github.com/Softmotions/ejdb/issues/257)
65<br> `[2]` Binaries are not distributed with dart `pub.` You can build it [manually](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_node#how-build-it-manually)
66<br> `[3]` Can be build, but needed a linkage with windows node/dart `libs`.
67<br> `[4]` Porting in progress [#273](https://github.com/Softmotions/ejdb/issues/273)
68
69## Native language bindings
70
71* [NodeJS](https://www.npmjs.com/package/ejdb2_node)
72* [Dart](https://pub.dartlang.org/packages/ejdb2_dart)
73* [Java](https://github.com/Softmotions/ejdb/blob/master/src/bindings/ejdb2_jni/README.md)
74* [Android support](#android)
75* [Swift | iOS](https://github.com/Softmotions/EJDB2Swift)
76* [React Native](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_react_native)
77* [Flutter](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_flutter)
78
79### Unofficial EJDB2 language bindings
80
81* Go
82  * https://github.com/memmaker/go-ejdb2
83* Rust
84  * https://crates.io/crates/ejdb2
85* .Net
86  * https://github.com/kmvi/ejdb2-csharp
87* Haskell
88  * https://github.com/cescobaz/ejdb2haskell
89  * https://hackage.haskell.org/package/ejdb2-binding
90* [Pharo](https://pharo.org)
91  * https://github.com/pharo-nosql/pharo-ejdb
92* Lua
93  * https://github.com/chriku/ejdb-lua
94
95## Status
96
97* **EJDB 2.0 core engine is well tested and used in various heavily loaded deployments**
98* Tested on `Linux`, `macOS` and `FreeBSD`. [Has limited Windows support](./WINDOWS.md)
99* Old EJDB 1.x version can be found in separate [ejdb_1.x](https://github.com/Softmotions/ejdb/tree/ejdb_1.x) branch.
100  We are not maintaining ejdb 1.x.
101
102## Used by
103
104* [Wirow video conferencing platform](https://github.com/wirow-io/wirow-server/)
105
106Are you using EJDB? [Let me know!](mailto:info@softmotions.com)
107
108## macOS
109
110EJDB2 code ported and tested on `High Sierra` / `Mojave` / `Catalina`
111
112[EJDB2 Swift binding](https://github.com/Softmotions/EJDB2Swift) for MacOS, iOS and Linux.
113Swift binding is outdated at now. Looking for contributors.
114
115```
116brew install ejdb
117```
118
119## Building from sources
120
121cmake v3.12 or higher required
122
123```
124git clone --recurse-submodules git@github.com:Softmotions/ejdb.git
125
126mkdir build && cd build
127cmake .. -DCMAKE_BUILD_TYPE=Release
128make install
129```
130
131## Linux
132
133#### Building debian packages
134
135```sh
136mkdir build && cd build
137cmake .. -DCMAKE_BUILD_TYPE=Release -DPACKAGE_DEB=ON
138make package
139```
140
141#### RPM based Linux distributions
142```sh
143mkdir build && cd build
144cmake .. -DCMAKE_BUILD_TYPE=Release -DPACKAGE_RPM=ON
145make package
146```
147
148## Windows
149EJDB2 can be cross-compiled for windows
150
151**Note:** HTTP/Websocket network API is disabled and not yet supported
152
153Nodejs/Dart bindings not yet ported to Windows.
154
155**[Cross-compilation Guide for Windows](./WINDOWS.md)**
156
157
158## IWSTART
159
160IWSTART is an automatic CMake initial project generator for C projects based on [iowow](https://github.com/Softmotions/iowow) / [iwnet](https://github.com/Softmotions/iwnet) / [ejdb2](https://github.com/Softmotions/ejdb) libs.
161
162https://github.com/Softmotions/iwstart
163