Get Started
Download, Execute and Go!
YottaDB is available free of charge. Install YottaDB on your Linux machine, or use a Docker container, and begin working today!
Install YottaDB using the Install Script
Install prerequisite packages
Install the following packages:
# Ubuntu/Debian apt-get install -y --no-install-recommends file binutils libelf-dev libicu-dev nano wget ca-certificates # RHEL/Rocky Linux yum install -y file binutils findutils elfutils-libelf libicu wget procps-ng nano gzip ca-certificates
Install YottaDB
Download the YottaDB installer script in a temporary directory, e.g.:
mkdir /tmp/tmp ; wget -P /tmp/tmp https://download.yottadb.com/ydbinstall.sh
Make the file executable:
cd /tmp/tmp ; chmod +x ydbinstall.sh
Install YottaDB (typical installation):
sudo ./ydbinstall.sh --utf8 default --verbose
To list all options:
./ydbinstall.sh --help
After installing YottaDB set environment variables and create a default environment in $HOME/.yottadb
source $(pkg-config --variable=prefix yottadb)/ydb_env_set
Accessing YottaDB from different languages is as described below, except that you will be using $HOME/.yottadb instead of /data
Use a Docker Container
Docker Hub has prebuilt YottaDB images. You must have at least Docker 17.05.
The Docker image supports volumes, for persistence and for sharing code and routines between host and container, by mounting a local directory to /data in the container. For example, to use the directory ydb-data as the volume:
docker run -it --rm -v $(pwd)/ydb-data:/data download.yottadb.com/yottadb/yottadb-debian:latest-master
If you want to access the database from multiple containers (e.g., to add containers with a tool such as Kubernetes), they will need to share IPC resources and pids. So use a command such as:
docker run -it --rm -v $(pwd)/ydb-data:/data --hostname=ydbcontainer --ipc=host --pid=host download.yottadb.com/yottadb/yottadb-debian:latest-master
Access from C
Download the sayhelloC.C program, compile it, and run it to set a database node:
root@b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloC.c ... root@b311fdd583e:/data# gcc $(pkg-config --libs --cflags yottadb) -o sayhelloC sayhelloC.c -lyottadb root@b311fdd583e:/data# ./sayhelloC root@b311fdd583e:/data#
Access from Go
Download the sayhelloGo.go program, compile it, and run it to set a database node:
root@b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloGo.go ... root@b311fdd583e:/data# go build sayhelloGo.go root@b311fdd583e:/data# ./sayhelloGo root@b311fdd583e:/data#
Access from Lua
Install the YottaDB Lua wrapper. Download the sayhelloLua.lua program and run it to set a database node:
root@b311fdd583e:/data# git clone https://github.com/anet-be/lua-yottadb.git root@b311fdd583e:/data# cd lua-yottadb root@b311fdd583e:/data/lua-yottadb# sed -i 's/5.3/5.4/g' Makefile root@b311fdd583e:/data/lua-yottadb# make install root@b311fdd583e:/data/lua-yottadb# cd .. root@b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloLua.lua ... root@b311fdd583e:/data# lua sayhelloLua.lua
Access from M
Download the sayhelloM.m program to the r/ subdirectory and run it. It does not need a separate compilation step:
root@b311fdd583e:/data# wget -P r/ https://docs.yottadb.com/AcculturationGuide/sayhelloM.m ... root@b311fdd583e:/data# yottadb -run sayhelloM root@b311fdd583e:/data#
Access from node.js
Install the YottaDB node.js wrapper with npm install nodem. Download the sayhelloNode.js program and run it to set a database node :
root@b311fdd583e:/data# npm install nodem ... root@b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloNode.js ... root@b311fdd583e:/data# node sayhelloNode.js root@b311fdd583e:/data#
Access from Perl
Install the YottaDB Perl extension with cpan YottaDB. Download the sayhelloPerl.pl program, make it executable and run it. It does not need a separate compilation step:
root@b311fdd583e:/data# cpan YottaDB # Note: hit ENTER when prompted ... root@b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloPerl.pl ... root@b311fdd583e:/data# chmod +x sayhelloPerl.pl root@b311fdd583e:/data# ./sayhelloPerl.pl root@b311fdd583e:/data#
Access from Python
Install the YottaDB Python package with pip install yottadb. Download the sayhelloPython.py program, and run it.
root@8b311fdd583e:/data# pip install yottadb ... root@8b311fdd583e:/data# wget https://docs.yottadb.com/AcculturationGuide/sayhelloPython.py ... root@8b311fdd583e:/data# python3 sayhelloPython.py root@8b311fdd583e:/data#
Access from Rust
Create a directory for the sayhello_rust.rs program with a dependency on YottaDB, and run it (cargo run automatically compiles the program):
root@b311fdd583e:/data# export USER=$(whoami) root@b311fdd583e:/data# cargo new sayhello_rust root@b311fdd583e:/data# cd sayhello_rust root@b311fdd583e:/data/sayhelloRust# echo 'yottadb = "2.0.0"' >> Cargo.toml root@b311fdd583e:/data/sayhelloRust# wget https://docs.yottadb.com/AcculturationGuide/sayhello_rust.rs -O src/main.rs ... root@b311fdd583e:/data/sayhelloRust# cargo run ... root@b311fdd583e:/data/sayhelloRust# cd - root@b311fdd583e:/data#
Results
Dump the database to see updates from programs in multiple languages. The MUPIP program is the YottaDB system administration tool.
root@b311fdd583e:/data# mupip extract -select=hello -stdout YottaDB MUPIP EXTRACT /opt/yottadb/current/mupip extract -select=hello -stdout UTF-8 10-MAY-2022 09:36:29 ZWR ^hello("C")="Hello, world!" ^hello("Go")="สวัสดีชาวโลก" ^hello("M")="Привіт Світ" ^hello("Node.js")="مرحبا بالعالم" ^hello("Perl")="Grüẞ Gott Welt" ^hello("Python")="नमस्ते दुनिया" ^hello("Rust")="ハローワールド" %YDB-I-RECORDSTAT, ^hello: Key cnt: 7 max subsc len: 16 max rec len: 37 max node len: 48 %YDB-I-RECORDSTAT, TOTAL: Key cnt: 7 max subsc len: 16 max rec len: 37 max node len: 48 root@b311fdd583e:/data#
Note: mg-dbx provides another way to access YottaDB from Go, node.js, PHP, Python, and Ruby. Thanks, Chris Munt!
Dig in with the Acculturation Guide
Since it’s easier to learn by doing, the Acculturation Guide is a series of guided, self-paced, hands-on exercises using virtual machines to get you going with database configuration, journaling, replication, backup, and more.
Documentation
- C: Programming in C in the Multi-Language Programmer’s Guide
- Go: yottadb package at Go doc and also Programming in Go in the Multi-Language Programmer’s Guide
- Lua: Programming in Lua in the Multi-Language Programmer’s Guide
- M Programmers: M Programmer’s Guide
- Node.js: Programming in Node.js in the Multi-Language Programmer’s Guide
- Perl: Programming in Perl in the Multi-Language Programmer’s Guide
- Python: Programming in Python in the Multi-Language Programmer’s Guide
- Rust: Rust/YottaDB Documentation and also Programming in Rust in the Multi-Language Programmer’s Guide
For Supported hardware & operating systems, check the Platforms section of the Release Notes for the latest release.
Explore All YottaDB Projects at GitLab
As all YottaDB software is 100% free / open source, you will find all our work on Gitlab.