• 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/2021.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* Provides HTTP REST/Websockets network endpoints with help of [facil.io](http://facil.io)
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  * [OSX](#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 platforms matrix
50
51|              | Linux              | macOS               | iOS                | Android            | Windows            |
52| ---          | ---                | ---                 | ---                | ---                | ---                |
53| C library    | :heavy_check_mark: | :heavy_check_mark:  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark:<sup>1</sup> |
54| NodeJS       | :heavy_check_mark: | :heavy_check_mark:  |                    |                    | :x:<sup>3</sup>    |
55| DartVM       | :heavy_check_mark: | :heavy_check_mark:<sup>2</sup> |         |                    | :x:<sup>3</sup>    |
56| Flutter      |                    |                     | :heavy_check_mark: | :heavy_check_mark: |                    |
57| React Native |                    |                     | :x:<sup>4</sup>    | :heavy_check_mark: |                    |
58| Swift        | :heavy_check_mark: | :heavy_check_mark:  | :heavy_check_mark: |                    |                    |
59| Java         | :heavy_check_mark: | :heavy_check_mark:  |                    | :heavy_check_mark: | :heavy_check_mark:<sup>2</sup> |
60
61
62<br> `[1]` No HTTP/Websocket support [#257](https://github.com/Softmotions/ejdb/issues/257)
63<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)
64<br> `[3]` Can be build, but needed a linkage with windows node/dart `libs`.
65<br> `[4]` Porting in progress [#273](https://github.com/Softmotions/ejdb/issues/273)
66
67
68## Native language bindings
69
70* [NodeJS](https://www.npmjs.com/package/ejdb2_node)
71* [Dart](https://pub.dartlang.org/packages/ejdb2_dart)
72* [Java](https://github.com/Softmotions/ejdb/blob/master/src/bindings/ejdb2_jni/README.md)
73* [Android support](#android)
74* [Swift | iOS](https://github.com/Softmotions/EJDB2Swift)
75* [React Native](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_react_native)
76* [Flutter](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_flutter)
77
78### Unofficial EJDB2 language bindings
79
80* .Net
81  * https://github.com/kmvi/ejdb2-csharp
82* Haskell
83  * https://github.com/cescobaz/ejdb2haskell
84  * https://hackage.haskell.org/package/ejdb2-binding
85* [Pharo](https://pharo.org)
86  * https://github.com/pharo-nosql/pharo-ejdb
87* Lua
88  * https://github.com/chriku/ejdb-lua
89
90## Status
91
92* **EJDB 2.0 core engine is well tested and used in various heavily loaded deployments**
93* Tested on `Linux` and `OSX` platforms. [Limited Windows support](./WINDOWS.md)
94* Old EJDB 1.x version can be found in separate [ejdb_1.x](https://github.com/Softmotions/ejdb/tree/ejdb_1.x) branch.
95  We are not maintaining ejdb 1.x.
96
97## Use cases
98
99* Softmotions trading robots platform
100* [Gimme - a social toy tokens exchange mobile application.](https://play.google.com/store/apps/details?id=com.softmotions.gimme) EJDB2 is used both on mobile and server sides.
101
102Are you using EJDB? [Let me know!](mailto:info@softmotions.com)
103
104## macOS / OSX
105
106EJDB2 code ported and tested on `High Sierra` / `Mojave` / `Catalina`
107
108See also [EJDB2 Swift binding](https://github.com/Softmotions/EJDB2Swift) for OSX, iOS and Linux
109
110```
111brew install ejdb
112```
113
114or
115
116```
117mkdir build && cd build
118cmake .. -DCMAKE_BUILD_TYPE=Release
119make install
120```
121
122## Linux
123### Ubuntu/Debian
124#### PPA repository
125
126```sh
127sudo add-apt-repository ppa:adamansky/ejdb2
128sudo apt-get update
129sudo apt-get install ejdb2
130```
131
132#### Building debian packages
133
134cmake v3.15 or higher required
135
136```sh
137mkdir build && cd build
138cmake .. -DCMAKE_BUILD_TYPE=Release -DPACKAGE_DEB=ON
139make package
140```
141
142#### RPM based Linux distributions
143```sh
144mkdir build && cd build
145cmake .. -DCMAKE_BUILD_TYPE=Release -DPACKAGE_RPM=ON
146make package
147```
148
149## Windows
150EJDB2 can be cross-compiled for windows
151
152**Note:** HTTP/Websocket network API is disabled and not supported
153on Windows until port of http://facil.io library (#257)
154
155Nodejs/Dart bindings not yet ported to Windows.
156
157**[Cross-compilation Guide for Windows](./WINDOWS.md)**
158