CUBRID: A FOSS RDBMS to Realise Your Next Big Idea

CUBRID is a free and open source relational database management engine. The power of CUBRID lies in its capability to support enterprise level features. It provides certain novel features in the form of object-oriented database element relations, a native middleware broker, and data caching with high performance. Moreover, it has production quality compatibility with many popular databases such as MySQL.

Databases are an integral part of any software application. The persistence that the databases bring in to the applications enable efficient retrievability of relevant data from non-volatile storage. There are a large number of databases such as MySQL, MariaDB, CouchDB, etc. This article provides an overview of a powerful enterprise-ready database management engine, termed CUBRID (pronounced ‘cube-rid’).

The first appearance of CUBRID was in November 2008. The latest stable release is CUBRID 10.1, which was released in July 2017. It is written in the C language and supports two major operating systems—GNU/Linux and Windows.

Advertisement

The major features of CUBRID are:

Free and open source

Powerful

Offers enterprise features

CUBRID is completely free of cost. As it is open source, you can choose to customise it to your specific requirements. Its enterprise features are listed below.

High availability: The high availability of CUBRID is attributed to its powerful Heartbeat native engine. It works very accurately and has automatic fail-over technology, built in.

High performance optimised for Web services: CUBRID has support for multi-threaded and multi-server architecture. It has native broker middleware. The intensive caching feature that CUBRID offers is excellent.

Figure 1: CUBRID’s features

Getting started with CUBRIDThis section details the steps required to get started with the CUBRID database management engine. The overall process is illustrated in Figure 3. Step 1: The first step is to download and install the CUBRID engine. The official Web page provides download links for both GNU/Linux and Windows (https://www.cubrid.org/downloads/os-select/64-bit/engine). You can download the latest stable release of CUBRID 10.1 and execute the installer.

Step 2: After successful installation, you can start the CUBRID service by executing the following command in a terminal:

<span style="color: #000000;">cubrid service start</span>

Step 3: Once the CUBRID service is started, you can create and start using the databases. Two sample commands are shown below:

Step 4: The next step is to connect to the database using CSQL. The command for doing that is as follows:

<span style="color: #000000;">csql –user PUBLIC osfytest</span>

Step 5: After the completion of all the above steps, you can run the required SQL queries.

CUBRID vs MySQLAs MySQL is a leading open source database management system (DBMS), you may get asked about their relative merits. First and foremost, CUBRID is not derived from MySQL. It is a separate RDBMS tool which has around 20 years of development history, as mentioned earlier.

Regarding performance, the official CUBRID documentation claims that it is faster than MySQL in scenarios when there are many concurrent requests. Unlike some other RDBMSs, CUBRID has no separate enterprise licence. It has only one flavour, which is under GPL version 2 or higher. Hence, CUBRID is completely free with all its enterprise level features.

Figure 2: CUBRID’s enterprise features

CUBRID language supportCUBRID supports many popular programming languages. It does so by providing language-specific APIs (Application Programming Interfaces). CUBRID is written in C and hence there is a native C driver. This driver is referred to as CCI. Apart from this, CUBRID has support for the following programming languages:

Java

PHP

Ruby

Python

Perl

Node.js

ADO.NET driver for .NET programming languages

In this article, examples with two popular programming languages — Java and Python — are given.

A simple CUBRID example with JavaThis section introduces you to a compact and standalone Java program that interacts with CUBRID. For this program to work, you should have already installed CUBRID, having followed the steps mentioned earlier, and it requires the JDBC driver as well. If your system doesn’t have it, then do install it. The installer is available at https://www.cubrid.org/downloads/os-select/64-bit/drivers/jdbc–

It can be easily inferred from the code that connecting and handling CUBRID is very similar to other databases. So, if you have programmed for other databases in Java, you don’t need to learn anything extraordinary in order to work with CUBRID.

An example in PythonTo manipulate the CUBRID database with Python, you need CUBRIDdb, which is the Python extension package. The CUBRID Python driver can be installed in various ways. The easiest of them is to go with easy_install. The simple command for performing this task is shown below:

The complete information about handling CUBRID with Python is available at https://www.python.org/dev/peps/pep-0249/.

GUI tools for CUBRIDThere are various graphical user interface tools available for handling CUBRID in an easier manner. These are listed in Table 1.

Figure 3: Getting started with CUBRID

CUBRID HAWhat ‘HA’ refers to is ‘high availability’. This is a feature that enables uninterrupted service in scenarios when there is failure in either the hardware, software or the network. CUBRID HA includes more than one server system. These are used to provide uninterrupted services when an individual server fails. CUBRID HA synchronises databases among multiple servers. This feature can be enabled for mission-critical applications when there is a need for 24/7 availability of service. More information on CUBRID HA is available at https://www.cubrid.org/manual/en/10.1/ha.html.

If you want to contribute to CUBRID RDBMS, then check out the source from https://github.com/CUBRID. Based on your expertise, you can get involved in contributing to the development of drivers, tools, content management systems (CMS), etc. Even as just a user, you can report bugs by opening issues in JIRA or by simply sending an email to bug@cubrid.org. CUBRID is an actively maintained relational database engine. Recent updates on it are available at https://www.cubrid.org/blog.

The author is an assistant professor of computer science at, School of Engineering and Technology, Pondicherry Central University, with over 10 years of experience in both academia and industry. He has been awarded the Best Teacher Award three times in 2010, 2011 and 2013.

POPULAR CATEGORY

Open Source For You is Asia's leading IT publication focused on open source technologies. Launched in February 2003 (as Linux For You), the magazine aims to help techies avail the benefits of open source software and solutions. Techies that connect with the magazine include software developers, IT managers, CIOs, hackers, etc. A free DVD, which contains the latest open source software and Linux distributions/OS, accompanies each issue of Open Source For You. The magazine is also associated with different events and online webinars on open source and related technologies.