|
1 | 1 | # ToroDB
|
2 | 2 |
|
3 |
| -ToroDB is an open source, document-oriented, JSON database that runs on top of PostgreSQL. JSON documents are stored relationally, not as a blob/jsonb. This leads to significant storage and I/O savings. It speaks natively the MongoDB protocol, meaning that it can be used with any mongo-compatible client. |
| 3 | +ToroDB is an open source project that turns your RDBMS into a |
| 4 | +MongoDB-compatible server, supporting the MongoDB query API and |
| 5 | +MongoDB's replication, but storing your data into a reliable and trusted |
| 6 | +ACID database. ToroDB currently supports PostgreSQL as a backend, but |
| 7 | +others will be added in the future. |
4 | 8 |
|
5 |
| -ToroDB follows a RERO (Release Early, Release Often) policy. Current version is considered a "developer preview" and hence is not suitable for production use. However, any feedback, contributions, help and/or patches are very welcome. Please join the [torodb-dev][8] mailing list for further discussion. |
| 9 | +ToroDB natively implements the MongoDB protocol, so you can use it with |
| 10 | +MongoDB tools and drivers, and features a document-to-relational mapping |
| 11 | +algorithm that transforms the JSON documents into relational tables. |
| 12 | +ToroDB also offers a native SQL layer and automatic data normalization |
| 13 | +and partitioning based on JSON documents' implicit schema. |
6 | 14 |
|
7 |
| -For more information, please see [ToroDB's website][1], this [latest presentation][7] or this [video recording of a presentation][11] about ToroDB. There's also a great [ToroDB introductory video][12] made by [Ernst-Georg Schmid][13], which explains how to start using ToroDB. |
| 15 | +ToroDB follows a RERO (Release Early, Release Often) policy. Current version is |
| 16 | +considered a "developer preview" and hence is not suitable for |
| 17 | +production use. Use at your own risk. However, any feedback, |
| 18 | +contributions, help and/or patches are very welcome. Please join the |
| 19 | +[torodb-dev][8] mailing list for further discussion. |
| 20 | + |
| 21 | +For more information, please see [ToroDB's website][1], this |
| 22 | +[latest presentation][7] or this [video recording of a presentation][11] about |
| 23 | +ToroDB. |
| 24 | + |
| 25 | + |
| 26 | +## Code QA |
| 27 | + * Master branch build status: [](https://travis-ci.org/torodb/torodb) |
| 28 | + * Devel branch build status : [](https://travis-ci.org/torodb/torodb) |
8 | 29 |
|
9 | 30 |
|
10 | 31 | ## Requisites
|
11 | 32 |
|
12 | 33 | ToroDB is written in Java and requires:
|
13 | 34 |
|
14 |
| -* A suitable JRE, version 6 or higher. It has been mainly tested with Oracle JRE 8. |
| 35 | +* A suitable JRE, version 7 or higher. It has been mainly tested with Oracle JRE 8. |
15 | 36 | * A [PostgreSQL][2] database, version 9.4 or higher. [Download][9].
|
16 | 37 |
|
17 | 38 |
|
18 | 39 | ## Download/Installation
|
19 | 40 |
|
20 |
| -### Download the compiled jar file |
| 41 | +### Download the compiled file |
21 | 42 |
|
22 |
| -You may download the [latest version][3] (v. 0.23) of ToroDB from ToroDB's maven repository. See below for instructions on how to run it. |
| 43 | +You may download the latest version (v. 0.40-alpha1) of ToroDB from |
| 44 | +[the release page](https://github.com/torodb/torodb/releases/latest) on the |
| 45 | +following packaging formats: |
| 46 | + * [tar.gz](https://github.com/torodb/torodb/archive/v0.40-alpha1.tar.gz) |
| 47 | + * [zip](https://github.com/torodb/torodb/archive/v0.40-alpha1.zip) |
| 48 | + |
| 49 | +See below for instructions on how to run it. |
| 50 | + |
| 51 | +You can also find binary files on [ToroDB's maven repository][3]. |
23 | 52 |
|
24 | 53 |
|
25 | 54 | ### Compile and install from sources
|
26 | 55 |
|
27 |
| -You may compile ToroDB yourself. All the project is written in Java and managed with Maven, so you need a javac and maven. |
| 56 | +To get the latest version, you may compile ToroDB yourself. All the project is written in Java and managed with Maven, so you need a javac and maven. |
28 | 57 |
|
29 | 58 | ToroDB is based on the [Mongo Wire Protocol library][5] (mongowp), which is another library built by [8Kdata][6] to help construct programs that speak the MongoDB protocol. You may also compile this library yourself, or let maven download it from the repository automatically.
|
30 | 59 |
|
31 |
| -Just run `mvn package` on the root directory and find the executable jar file in `torodb/target/torodb-0.23-jar-with-dependencies.jar`. |
| 60 | +Just run `mvn package -Passembler` on the root directory and execute it from |
| 61 | +`torodb/target/appassembler/bin` or choose your prefered packaging format from |
| 62 | +`torodb/target/dist/`. |
32 | 63 |
|
33 | 64 |
|
34 | 65 | ## Running ToroDB
|
35 | 66 |
|
36 |
| -Execute with `java -jar <path>/torodb.jar <arguments>`. If you run with `--help`, you will see the required and optional arguments to run ToroDB: |
37 |
| - |
38 |
| - --ask-for-password |
39 |
| - Force input of PostgreSQL's database user password. |
40 |
| - Default: false |
41 |
| - -c, --connections |
42 |
| - Number of connections to establish to the PostgreSQL database |
43 |
| - Default: 10 |
44 |
| - -d, --dbname |
45 |
| - PostgreSQL's database name to connect to (must exist) |
46 |
| - Default: torod |
47 |
| - -p, --dbport |
48 |
| - PostgreSQL's server port |
49 |
| - Default: 5432 |
50 |
| - --debug |
51 |
| - Change log level to DEBUG |
52 |
| - Default: false |
53 |
| - -h, --host |
54 |
| - PostgreSQL's server host (hostname or IP address) |
55 |
| - Default: localhost |
56 |
| - -P, --mongoport |
57 |
| - Port to listen on for Mongo wire protocol connections |
58 |
| - Default: 27017 |
59 |
| - --help, --usage |
60 |
| - Print this usage guide |
61 |
| - Default: false |
62 |
| - -u, --username |
63 |
| - PostgreSQL's database user name. Must be a superuser |
64 |
| - Default: postgres |
65 |
| - --verbose |
66 |
| - Change log level to INFO |
67 |
| - Default: false |
68 |
| - |
69 |
| -The database must exist, and the username must have superuser privileges. This will be changed in the future. |
70 |
| - |
71 |
| -Alternatively to the command line options, you may create a `~/.toropass` file, which follows the syntax of [PostgreSQL's pgpass][4] files. |
| 67 | +ToroDB needs either a configuration file or some command-line parameters |
| 68 | +to run. But it can also run without any of them if you follow some |
| 69 | +conventions. |
| 70 | + |
| 71 | +Before running ToroDB it is necessary to configure the RDBMS with the |
| 72 | +ToroDB user that will be responsible to create namespaces, required data |
| 73 | +types, tables and indexes. |
| 74 | + |
| 75 | +Create user torodb (this is default user name, see ToroDB configuration |
| 76 | +to use a different name): |
| 77 | + |
| 78 | + =# CREATE USER torodb WITH SUPERUSER PASSWORD '<your-password>'; |
| 79 | + |
| 80 | +Create the database torod (this is default database name, see ToroDB |
| 81 | +configuration to use a different name): |
| 82 | + |
| 83 | + =# CREATE DATABASE torod OWNER torodb; |
| 84 | + |
| 85 | +The script $TOROHOME/bin/torodb (or torodb.bat) will run ToroDB. ToroDB can be |
| 86 | +configured by a configuration file written in YAML or XML formats by |
| 87 | +passing arguments -c or -x, respectively, to the script |
| 88 | +$TOROHOME/bin/torodb. For example, to run ToroDB with configuration file |
| 89 | +torodb.yml, run: |
| 90 | + |
| 91 | + $ $TOROHOME/bin/torodb -c torodb.yml |
| 92 | + |
| 93 | +To print default configuration script in YAML or XML format use the |
| 94 | +arguments -l an -lx respectively. For example to generate default YAML |
| 95 | +configuration file: |
| 96 | + |
| 97 | + $ $TOROHOME/bin/torodb -l > torodb.yml |
| 98 | + |
| 99 | +ToroDB connects to the backend database using user torodb (that has been |
| 100 | +created in previous step). By default ToroDB reads the file |
| 101 | +$HOME/.toropass (file path can be configured in the configuration), if |
| 102 | +it exists, that stores the password in PostgreSQL's [.pgpass][4] syntax. The |
| 103 | +password can also be specified in clear text in the configuration file or |
| 104 | +will be asked at the prompt if the argument -W is issued. |
| 105 | + |
| 106 | +To get general help, pass --help argument: |
| 107 | + |
| 108 | + $ $TOROHOME/bin/torodb --help |
| 109 | + |
| 110 | +Use --help-param to get help on all available parameters of the |
| 111 | +configuration file: |
| 112 | + |
| 113 | + $ $TOROHOME/bin/torodb --help-param |
| 114 | + |
| 115 | +If you setup a .toropass, use torodb as the user and torod as the |
| 116 | +database, ToroDB will run without a configuration file (with the rest of |
| 117 | +the configuration values with their respective defaults). |
| 118 | + |
| 119 | +Once ToroDB is running, connect to it with a normal MongoDB client, |
| 120 | +like: |
| 121 | + |
| 122 | + $ mongo localhost:27018/torod |
72 | 123 |
|
73 | 124 |
|
74 | 125 | ## Are you a developer? Want to contribute? Questions about the source code?
|
75 | 126 |
|
76 | 127 | Please see [CONTRIBUTING][10].
|
77 | 128 |
|
78 | 129 |
|
79 |
| - |
80 | 130 | [1]: http://www.torodb.com
|
81 | 131 | [2]: http://www.postgresql.org
|
82 |
| -[3]: http://maven.torodb.com/jar/com/torodb/torodb/0.23/torodb.jar |
83 |
| -[4]: http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html |
| 132 | +[3]: https://oss.sonatype.org/content/groups/public/com/torodb/torodb/ |
| 133 | +[4]: http://www.postgresql.org/docs/9.4/static/libpq-pgpass.html |
84 | 134 | [5]: https://github.com/8kdata/mongowp
|
85 | 135 | [6]: http://www.8kdata.com
|
86 |
| -[7]: http://www.slideshare.net/8kdata/big-dataspain2014-torodbbridgebetweennosqlandrelational |
| 136 | +[7]: http://www.slideshare.net/8kdata/torodb-internals-how-to-create-a-nosql-database-on-top-of-sql-55275036 |
87 | 137 | [8]: https://groups.google.com/forum/#!forum/torodb-dev
|
88 | 138 | [9]: http://www.postgresql.org/download/
|
89 | 139 | [10]: https://github.com/torodb/torodb/blob/master/CONTRIBUTING.md
|
90 |
| -[11]: http://www.bigdataspain.org/2014/conference/new-open-source-database-a-bridge-between-the-nosql-and-relational-worlds |
91 |
| -[12]: https://youtu.be/kgge0ZZ_lUM |
92 |
| -[13]: https://twitter.com/e_g_schmid |
| 140 | +[11]: https://www.youtube.com/watch?v=C2XuOhLrblo |
0 commit comments