• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

FDBLibTLS/H03-May-2022-

bindings/H03-May-2022-

build/H11-Apr-2019-

cmake/H11-Apr-2019-

design/H11-Apr-2019-

documentation/H03-May-2022-

fdbbackup/H03-May-2022-

fdbcli/H03-May-2022-

fdbclient/H03-May-2022-

fdbmonitor/H03-May-2022-

fdbrpc/H03-May-2022-

fdbserver/H03-May-2022-

fdbservice/H03-May-2022-

flow/H03-May-2022-

layers/H11-Apr-2019-

packaging/H03-May-2022-

recipes/H11-Apr-2019-

tests/H03-May-2022-

.clang-formatH A D11-Apr-20192 KiB

.gitignoreH A D11-Apr-20191.8 KiB

ACKNOWLEDGEMENTSH A D11-Apr-201922.6 KiB

CODE_OF_CONDUCT.mdH A D11-Apr-20193.2 KiB

CONTRIBUTING.mdH A D11-Apr-20195.2 KiB

LICENSEH A D11-Apr-201911.4 KiB

MakefileH A D11-Apr-20197 KiB

README.mdH A D11-Apr-201910.3 KiB

fdb.cluster.cmakeH A D11-Apr-201963

foundationdb.slnH A D11-Apr-201910.8 KiB

versions.targetH A D11-Apr-2019204

README.md

1<img alt="FoundationDB logo" src="documentation/FDB_logo.png?raw=true" width="400">
2
3FoundationDB is a distributed database designed to handle large volumes of structured data across clusters of commodity servers. It organizes data as an ordered key-value store and employs ACID transactions for all operations. It is especially well-suited for read/write workloads but also has excellent performance for write-intensive workloads. Users interact with the database using API language binding.
4
5To learn more about FoundationDB, visit [foundationdb.org](https://www.foundationdb.org/)
6
7## Documentation
8
9Documentation can be found online at <https://apple.github.io/foundationdb/>. The documentation covers details of API usage, background information on design philosophy, and extensive usage examples. Docs are built from the [source in this repo](documentation/sphinx/source).
10
11## Forums
12
13[The FoundationDB Forums](https://forums.foundationdb.org/) are the home for most of the discussion and communication about the FoundationDB project. We welcome your participation!  We want FoundationDB to be a great project to be a part of and, as part of that, have established a [Code of Conduct](CODE_OF_CONDUCT.md) to establish what constitutes permissible modes of interaction.
14
15## Contributing
16
17Contributing to FoundationDB can be in contributions to the code base, sharing your experience and insights in the community on the Forums, or contributing to projects that make use of FoundationDB. Please see the [contributing guide](CONTRIBUTING.md) for more specifics.
18
19## Getting Started
20
21### Binary downloads
22
23Developers interested in using the FoundationDB store for an application can get started easily by downloading and installing a binary package. Please see the [downloads page](https://www.foundationdb.org/download/) for a list of available packages.
24
25
26### Compiling from source
27
28Developers on a OS for which there is no binary package, or who would like to start hacking on the code can get started by compiling from source.
29
30Currently there are two build systems: a collection of Makefiles and a
31CMake-based. Both of them should work for most users and CMake will eventually
32become the only build system available.
33
34## Makefile
35
36#### MacOS
37
381. Check out this repo on your Mac.
391. Install the Xcode command-line tools.
401. Download version 1.67.0 of [Boost](https://sourceforge.net/projects/boost/files/boost/1.67.0/).
411. Set the `BOOSTDIR` environment variable to the location containing this boost installation.
421. Install [Mono](http://www.mono-project.com/download/stable/).
431. Install a [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html). FoundationDB currently builds with Java 8.
441. Navigate to the directory where you checked out the foundationdb repo.
451. Run `make`.
46
47#### Linux
48
491. Install [Docker](https://www.docker.com/).
501. Check out the foundationdb repo.
511. Run the docker image interactively [Docker Run](https://docs.docker.com/engine/reference/run/#general-form) with the directory containing the foundationdb repo mounted [Docker Mounts](https://docs.docker.com/storage/volumes/).
52
53    ```shell
54    docker run -it -v '/local/dir/path/foundationdb:/docker/dir/path/foundationdb' foundationdb/foundationdb-build:latest
55    ```
56
571. Navigate to the container's mounted directory which contains the foundationdb repo.
58
59    ```shell
60    cd /docker/dir/path/foundationdb
61    ```
62
631. Run `make`.
64
65This will build the fdbserver binary and the python bindings. If you want to build our other bindings, you will need to install a runtime for the language whose binding you want to build. Each binding has an `.mk` file which provides specific targets for that binding.
66
67## CMake
68
69FoundationDB is currently in the process of migrating the build system to cmake.
70The CMake build system is currently used by several developers. However, most of
71the testing and packaging infrastructure still uses the old VisualStudio+Make
72based build system.
73
74To build with CMake, generally the following is required (works on Linux and
75Mac OS - for Windows see below):
76
771. Check out this repository.
781. Install cmake Version 3.12 or higher [CMake](https://cmake.org/)
791. Download version 1.67 of [Boost](https://sourceforge.net/projects/boost/files/boost/1.67.0/).
801. Unpack boost (you don't need to compile it)
811. Install [Mono](http://www.mono-project.com/download/stable/).
821. Install a [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html). FoundationDB currently builds with Java 8.
831. Create a build directory (you can have the build directory anywhere you
84   like): `mkdir build`
851. `cd build`
861. `cmake -DBOOST_ROOT=<PATH_TO_BOOST> <PATH_TO_FOUNDATIONDB_DIRECTORY>`
871. `make`
88
89CMake will try to find its dependencies. However, for LibreSSL this can be often
90problematic (especially if OpenSSL is installed as well). For that we recommend
91passing the argument `-DLibreSSL_ROOT` to cmake. So, for example, if you
92LibreSSL is installed under /usr/local/libressl-2.8.3, you should call cmake like
93this:
94
95```
96cmake -DLibreSSL_ROOT=/usr/local/libressl-2.8.3/ ../foundationdb
97```
98
99FoundationDB will build just fine without LibreSSL, however, the resulting
100binaries won't support TLS connections.
101
102### Language Bindings
103
104The language bindings that are supported by cmake will have a corresponding
105`README.md` file in the corresponding `bindings/lang` directory.
106
107Generally, cmake will build all language bindings for which it can find all
108necessary dependencies. After each successful cmake run, cmake will tell you
109which language bindings it is going to build.
110
111
112### Generating compile_commands.json
113
114CMake can build a compilation database for you. However, the default generated
115one is not too useful as it operates on the generated files. When running make,
116the build system will create another `compile_commands.json` file in the source
117directory. This can than be used for tools like
118[CCLS](https://github.com/MaskRay/ccls),
119[CQuery](https://github.com/cquery-project/cquery), etc. This way you can get
120code-completion and code navigation in flow. It is not yet perfect (it will show
121a few errors) but we are constantly working on improving the development experience.
122
123### Using IDEs
124
125CMake  has built in support for a number of popular IDEs. However, because flow
126files are precompiled with the actor compiler, an IDE will not be very useful as
127a user will only be presented with the generated code - which is not what she
128wants to edit and get IDE features for.
129
130The good news is, that it is possible to generate project files for editing
131flow with a supported IDE. There is a cmake option called `OPEN_FOR_IDE` which
132will generate a project which can be opened in an IDE for editing. You won't be
133able to build this project, but you will be able to edit the files and get most
134edit and navigation features your IDE supports.
135
136For example, if you want to use XCode to make changes to FoundationDB you can
137create a XCode-project with the following command:
138
139```sh
140cmake -G Xcode -DOPEN_FOR_IDE=ON <FDB_SOURCE_DIRECTORY>
141```
142
143You should create a second build-directory which you will use for building
144(probably with make or ninja) and debugging.
145
146### Linux
147
148There are no special requirements for Linux. However, we are currently working
149on a Docker-based build as well.
150
151If you want to create a package you have to tell cmake what platform it is for.
152And then you can build by simply calling `cpack`. So for debian, call:
153
154```
155cmake -DINSTALL_LAYOUT=DEB  <FDB_SOURCE_DIR>
156make
157cpack
158```
159
160For RPM simply replace `DEB` with `RPM`.
161
162### MacOS
163
164The build under MacOS will work the same way as on Linux. To get LibreSSL and boost you
165can use [Hombrew](https://brew.sh/). LibreSSL will not be installed in
166`/usr/local` instead it will stay in `/usr/local/Cellar`. So the cmake command
167will look somethink like this:
168
169```sh
170cmake -DLibreSSL_ROOT=/usr/local/Cellar/libressl/2.8.3 <PATH_TO_FOUNDATIONDB_SOURCE>
171```
172
173To generate a installable package, you have to call CMake with the corresponding
174arguments and then use cpack to generate the package:
175
176```sh
177cmake -DINSTALL_LAYOUT=OSX  <FDB_SOURCE_DIR>
178make
179cpack
180```
181
182### Windows
183
184Under Windows, the build instructions are very similar, with the main difference
185that Visual Studio is used to compile.
186
1871. Install Visual Studio 2017 (Community Edition is tested)
1881. Install cmake Version 3.12 or higher [CMake](https://cmake.org/)
1891. Download version 1.67 of [Boost](https://sourceforge.net/projects/boost/files/boost/1.67.0/).
1901. Unpack boost (you don't need to compile it)
1911. Install [Mono](http://www.mono-project.com/download/stable/).
1921. Install a [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html). FoundationDB currently builds with Java 8.
1931. Set `JAVA_HOME` to the unpacked location and JAVA_COMPILE to
194   `$JAVA_HOME/bin/javac`.
1951. Install [Python](https://www.python.org/downloads/) if it is not already installed by Visual Studio.
1961. (Optional) Install [WIX](http://wixtoolset.org/). Without it Visual Studio
197   won't build the Windows installer.
1981. Create a build directory (you can have the build directory anywhere you
199   like): `mkdir build`
2001. `cd build`
2011. `cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=<PATH_TO_BOOST> <PATH_TO_FOUNDATIONDB_DIRECTORY>`
2021. This should succeed. In which case you can build using msbuild:
203   `msbuild /p:Configuration=Release foundationdb.sln`. You can also open the resulting
204   solution in Visual Studio and compile from there. However, be aware that
205   using Visual Studio for development is currently not supported as Visual
206   Studio will only know about the generated files. `msbuild` is located at
207   `c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe` for Visual Studio 15.
208
209If you want TLS support to be enabled under Windows you currently have to build
210and install LibreSSL yourself as the newer LibreSSL versions are not provided
211for download from the LibreSSL homepage. To build LibreSSL:
212
2131. Download and unpack libressl (>= 2.8.2)
2142. `cd libressl-2.8.2`
2153. `mkdir build`
2164. `cd build`
2175. `cmake -G "Visual Studio 15 2017 Win64" ..`
2186. Open the generated `LibreSSL.sln` in Visual Studio as administrator (this is
219   necessary for the install)
2207. Build the `INSTALL` project in `Release` mode
221
222This will install LibreSSL under `C:\Program Files\LibreSSL`. After that `cmake`
223will automatically find it and build with TLS support.
224
225If you installed WIX before running `cmake` you should find the
226`FDBInstaller.msi` in your build directory under `packaging/msi`.
227