[VoltDB] : Overview and Installation

VoltDB is an in-memory operational database

Fast flows of real-time data from people, social, mobile, devices and sensors are transforming the business landscape.

VoltDB is built to power the next generation of data-intensive applications that rely on fast, smart data.

Ideal for fast data pipelines that ingest, enrich and export streaming data

* Real-time analytics
* Real-time decisions
* Modern architecture, familiar tools – SQL and JSON support for fast, reliable programming and easy data interaction
* Build fast data applications and deploy them on premises or in the cloud
* VoltDB is the only open source in-memory NewSQL database

VoltDB Unversity for learning : http://voltdb.com/community/voltdb-university

Installation :-
————

Download the required rpm/tar from the below link

VoltDB Enterprise downloads : http://voltdb.com/download/enterprise-download

[root@dbversity.com 3]# ll -lhtr
total 75M
-rw-r–r– 1 root root 75M Nov 17 03:23 LINUX-voltdb-ent-4.8.tar.gz
[root@dbversity.com 3]# 
[root@dbversity.com 3]# 
[root@dbversity.com 3]# 
[root@dbversity.com 3]# tar -zxvf LINUX-voltdb-ent-4.8.tar.gz 
voltdb-ent-4.8/
voltdb-ent-4.8/voltdb/
voltdb-ent-4.8/voltdb/libvoltdb-4.8.so
voltdb-ent-4.8/voltdb/license.xml
voltdb-ent-4.8/voltdb/libjzmq.so
voltdb-ent-4.8/voltdb/log4j.properties
voltdb-ent-4.8/voltdb/voltdbclient-4.8.jar

— blah blah blah —-
voltdb-ent-4.8/version.txt
voltdb-ent-4.8/lib/extension/voltdb-rabbitmq.jar
[root@dbversity.com 3]#

[root@dbversity.com 3]# ll -lhtr
drwxrwxr-x 10 507 mongod 4.0K Oct 17 18:01 voltdb-ent-4.8
-rw-r–r– 1 root root 75M Nov 17 03:23 LINUX-voltdb-ent-4.8.tar.gz
[root@dbversity.com 3]#
[root@dbversity.com 3]# cd voltdb-ent-4.8
[root@dbversity.com voltdb-ent-4.8]# 
[root@dbversity.com voltdb-ent-4.8]# ll -lhtr
total 208K
-rw-rw-r– 1 507 mongod 124K Oct 17 18:01 README.thirdparty
drwxrwxr-x 3 507 mongod 4.0K Oct 17 18:01 third_party
-rw-rw-r– 1 507 mongod 4 Oct 17 18:01 version.txt
drwxrwxr-x 4 507 mongod 4.0K Oct 17 18:01 lib
drwxrwxr-x 7 507 mongod 4.0K Oct 17 18:01 examples
drwxrwxr-x 4 507 mongod 4.0K Oct 17 18:01 doc
drwxrwxr-x 2 507 mongod 4.0K Oct 17 18:01 bin
drwxrwxr-x 6 507 mongod 4.0K Oct 17 18:01 tools
-rw-rw-r– 1 507 mongod 39K Oct 17 18:01 README.thirdparty.ent
-rw-rw-r– 1 507 mongod 2.2K Oct 17 18:01 README
drwxrwxr-x 2 507 mongod 4.0K Oct 17 18:01 management
-rw-rw-r– 1 507 mongod 1.2K Oct 17 18:01 LICENSE
drwxrwxr-x 2 507 mongod 4.0K Oct 17 18:01 voltdb
[root@dbversity.com voltdb-ent-4.8]#

Append VoltDB env variables as below.

[root@dbversity.com bin]# sed -i ‘$a\export VOLTDB_HOME=/data/3/voltdb-ent-4.8’ ~/.bashrc
[root@dbversity.com bin]# sed -i ‘$a\export PATH=$PATH:$VOLTDB_HOME/bin’ ~/.bashrc 
[root@dbversity.com bin]# 
[root@dbversity.com bin]# grep ‘VOLTDB_’ ~/.bashrc 
export VOLTDB_HOME=/data/3/voltdb-ent-4.8
export PATH=$PATH:$VOLTDB_HOME/bin
[root@dbversity.com bin]#
[root@dbversity.com bin]# source ~/.bashrc 
[root@dbversity.com bin]# 
[root@dbversity.com bin]# env | grep ‘VOLTDB_’
VOLTDB_HOME=/data/3/voltdb-ent-4.8
[root@dbversity.com bin]#

[root@dbversity.com bin]# voltdb –version
voltdb version 4.8
[root@dbversity.com bin]#
Creating the Database

In VoltDB you define your database schema using SQL data definition language (DDL) statements just like other SQL databases. So, if we want to create a database table for the places where we live, the DDL schema might look like the following:

Compiling the Application Catalog
Once you have the schema defined, you can create an application catalog. The application catalog is one way VoltDB achieves the performance it does, by pre-compiling important aspects of the database — such as stored procedures and partitioning information — into a single file.

Although we are not interested in performance right now, we still need to create the application catalog before we can start the database. You create the application catalog by compiling the schema:
[root@dbversity.com voltdb-ent-4.8]# vi dbversity_tbl.sql
CREATE TABLE dbversity (
TOWN VARCHAR(64),
TYPE VARCHAR(64),
STATE VARCHAR(2)
);
~
“dbversity_tbl.sql” [New] 5L, 92C written
[root@dbversity.com voltdb-ent-4.8]#

[root@dbversity.com voltdb-ent-4.8]# voltdb compile dbversity_tbl.sql

——————————————
Successfully created catalog.jar
Includes schema: dbversity_tbl.sql

[MP][WRITE] DBVERSITY.insert
INSERT INTO DBVERSITY VALUES (?, ?, ?);

——————————————

Catalog contains 1 built-in CRUD procedures.
Simple insert, update, delete, upsert and select procedures are created
automatically for convenience.

——————————————

Full catalog report can be found at file:///data/3/voltdb-ent-4.8/catalog-report.html
or can be viewed at “http://localhost:8080” when the server is running.

——————————————

[root@dbversity.com voltdb-ent-4.8]#
In this simplest case, the voltdb compile command requires only one argument: the name of the schema DDL file. By default, it creates the catalog as catalog.jar as above.
If you want to name your catalog file, you can use the -o or –output flag, like so:
[root@dbversity.com voltdb-ent-4.8]# voltdb compile -o dbversity.jar dbversity_tbl.sql
——————————————
Successfully created dbversity.jar
Includes schema: dbversity_tbl.sql

[MP][WRITE] DBVERSITY.insert
INSERT INTO DBVERSITY VALUES (?, ?, ?);

[root@dbversity.com voltdb-ent-4.8]#
Starting the Database
——————–
Once you create the application catalog, you are ready to start the database. Again, there are several options available when starting a VoltDB database, which we will discuss later. But for now, we can use the simplest command to start the database using the default options on the current machine with the following command:

[root@dbversity.com voltdb-ent-4.8]# voltdb create dbversity.jar 
Initializing VoltDB…

_ __ ____ ____ ____ 
| | / /___ / / /_/ __ \/ __ )
| | / / __ \/ / __/ / / / __ |
| |/ / /_/ / / /_/ /_/ / /_/ / 
|___/\____/_/\__/_____/_____/

——————————–

Build: 4.8 voltdb-4.8-0-g895def8-local Enterprise Edition
Connecting to VoltDB cluster as the leader…
Host id of this node is: 0

Initializing the database and command logs. This may take a moment…
Server completed initialization.

You can see process that are running for VoltDB database below.

[root@dbversity.com voltdb-ent-4.8]# ps -ef | grep volt | grep -v grep
root 32156 8254 0 06:06 pts/2 00:00:00 python /data/3/voltdb-ent-4.8/bin/voltdb create dbversity.jar
root 32161 32156 20 06:06 pts/2 00:01:00 /usr/java/jdk1.7.0_71/bin/java -Xmx2048m -server -Djava.awt.headless=true -Dsun.net.inetaddr.ttl=300 -Dsun.net.inetaddr.negative.ttl=3600 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseTLAB -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCondCardMark -Dsun.rmi.dgc.server.gcInterval=9223372036854775807 -Dsun.rmi.dgc.client.gcInterval=9223372036854775807 -XX:CMSWaitDuration=120000 -XX:CMSMaxAbortablePrecleanTime=120000 -XX:+ExplicitGCInvokesConcurrent -XX:+CMSScavengeBeforeRemark -XX:+CMSClassUnloadingEnabled -XX:PermSize=64m -Dlog4j.configuration=file:///data/3/voltdb-ent-4.8/voltdb/log4j.xml -Djava.library.path=/data/3/voltdb-ent-4.8/voltdb -classpath /data/3/voltdb-ent-4.8/voltdb/voltdb-4.8.jar:/data/3/voltdb-ent-4.8/lib/log4j-1.2.16.jar:/data/3/voltdb-ent-4.8/lib/kafka_2.8.0-0.8.1.jar:/data/3/voltdb-ent-4.8/lib/scala-library.jar:/data/3/voltdb-ent-4.8/lib/servlet-api-2.5.jar:/data/3/voltdb-ent-4.8/lib/jsch-0.1.51.jar:/data/3/voltdb-ent-4.8/lib/commons-cli-1.2.jar:/data/3/voltdb-ent-4.8/lib/tomcat-juli.jar:/data/3/voltdb-ent-4.8/lib/jetty-util-7.6.1.v20120215.jar:/data/3/voltdb-ent-4.8/lib/jetty-server-7.6.1.v20120215.jar:/data/3/voltdb-ent-4.8/lib/jna.jar:/data/3/voltdb-ent-4.8/lib/slf4j-api-1.6.2.jar:/data/3/voltdb-ent-4.8/lib/jetty-http-7.6.1.v20120215.jar:/data/3/voltdb-ent-4.8/lib/jetty-continuation-7.6.1.v20120215.jar:/data/3/voltdb-ent-4.8/lib/avro-1.7.7.jar:/data/3/voltdb-ent-4.8/lib/jline-2.10.jar:/data/3/voltdb-ent-4.8/lib/super-csv-2.1.0.jar:/data/3/voltdb-ent-4.8/lib/snappy-java-1.1.0.1.jar:/data/3/voltdb-ent-4.8/lib/httpcore-4.3.2.jar:/data/3/voltdb-ent-4.8/lib/jetty-io-7.6.1.v20120215.jar:/data/3/voltdb-ent-4.8/lib/groovy-all-2.1.7-indy.jar:/data/3/voltdb-ent-4.8/lib/commons-logging-1.1.3.jar:/data/3/voltdb-ent-4.8/lib/commons-codec-1.6.jar:/data/3/voltdb-ent-4.8/lib/httpcore-nio-4.3.2.jar:/data/3/voltdb-ent-4.8/lib/httpclient-4.3.2.jar:/data/3/voltdb-ent-4.8/lib/zmq-2.1.11.jar:/data/3/voltdb-ent-4.8/lib/tomcat-jdbc.jar:/data/3/voltdb-ent-4.8/lib/jackson-core-asl-1.9.13.jar:/data/3/voltdb-ent-4.8/lib/metrics-core-2.2.0.jar:/data/3/voltdb-ent-4.8/lib/protobuf-java-2.4.1.jar:/data/3/voltdb-ent-4.8/lib/slf4j-nop-1.6.2.jar:/data/3/voltdb-ent-4.8/lib/commons-lang3-3.0.jar:/data/3/voltdb-ent-4.8/lib/httpasyncclient-4.0.1.jar:/data/3/voltdb-ent-4.8/lib/jackson-mapper-asl-1.9.13.jar:/data/3/voltdb-ent-4.8/lib/extension/voltdb-rabbitmq.jar org.voltdb.VoltDB create catalog dbversity.jar host localhost:3021
[root@dbversity.com voltdb-ent-4.8]#

The voltdb create command tells VoltDB to create a new, empty database. The argument tells VoltDB which application catalog to use when creating the database.

Using SQL Queries
—————–

Congratulations! You have created your first VoltDB database. Of course, an empty database is not terribly useful. So the first thing you will want to do is create and retrieve a few records to prove to yourself that the database is running as you expect.

VoltDB supports all of the standard SQL query statements, such as INSERT, UPDATE, DELETE, and SELECT. You can invoke queries programmatically, through standard interfaces such as JDBC and JSON, or you can include them in stored procedures that are compiled and included in the application catalog.

But for now, we’ll just try some ad hoc queries using the sqlcmd command line interface that VoltDB provides. Create a new terminal window and issue the sqlcmd command from the shell prompt:
[root@dbversity.com log]# sqlcmd
SQL Command :: localhost:21212
1> 
2>

[root@dbversity.com log]# sqlcmd
SQL Command :: localhost:21212
1> insert into dbversity values (‘MongoDB’,’NoSQL’,’NY’);
(Returned 1 rows in 0.49s)

2> insert into dbversity values (‘PostgreSQL’,’RDBMS’,’CA’);
(Returned 1 rows in 0.01s)

3> insert into dbversity values (‘VoltDB’,’NewSQL’,’OH’);
(Returned 1 rows in 0.01s)

4> 
5> select * from dbversity;
DATABASE TYPE STATE 
———– ——- ——
MongoDB NoSQL NY 
PostgreSQL RDBMS CA 
VoltDB NewSQL OH

(Returned 3 rows in 0.05s)
6> 
7> 

 

  • Ask Question