Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Scaling Oracle Data, Part 2: Simple Deployment of Tarantool

DZone's Guide to

Scaling Oracle Data, Part 2: Simple Deployment of Tarantool

Learn how to replicate an Oracle client with Oracle CDC so that the Oracle data can be read/written in Tarantool and replication can be done both ways.

· Database Zone ·
Free Resource

Discover Tarantool's unique features which include powerful stored procedures, SQL support, smart cache, and the speed of 1 million ACID transactions on a single CPU core!

Image title

This is the second installment of a two-part series about Oracle. Part 1 can be found here.

You can replicate an Oracle client using Oracle CDC or a third-party product. This data from Oracle can be both read and written in Tarantool — and the replication can be done both ways. Melding these two technologies together so perfectly, I’ll let you decide whether we call it "Orantool" or "Taracle."

I took the simplest variant: a large Oracle table without in-memory, which won't fit entirely in the buffer cache, and I ran the simplest version of asynchronous replication — Oracle data read in Tarantool. After that, I simultaneously launched two heavy queries: in Oracle (with the basic database) and in Tarantool (with the replicated one).

A few more important points...

Tarantool and Oracle exist well on different computers, but your Tarantool server requires OCI to be installed. You'll also need a tarantool dev package (which are available for each OS in Tarantool's GitHub).

Testing "Orantool"

Test server configuration:

  • VPS: 2 CPUs with clock speeds of 2300 MHz, 16GB RAM, and a 50GB SSD

  • OS/technology: Ubuntu 16.04, x86_64, English/virtual machine

  • DBMS: Tarantool 1.8

I used Oracle test tables from the proprietary Tarantool ORA package (please contact us for this). First, I created the appropriate spaces in Tarantool. Spaces are analogs of tables and tuples are analogs of records in RDBMSes (read more about the Tarantool data model here).

Then, I did asynchronous replication using the aforementioned ORA package.

SQL> select sum (credit_limit) from credits where country in (select id from countries where name like 'R%');

Elapsed: 00:05:22.13 (5 minutes, 22.13 seconds)

For Tarantool, you will have to code in Lua, but savvy Oraclers will master this easily. I note only one important point: I didn't find the option to display the execution time of an SQL query, so I implemented it like this in my Lua file:

function do_sql(str)
local t = fiber.time64()
local r = box.sql.execute(str)
t = fiber.time64() - t
return { time = t, result = r }

end

Here, str is our request and it is completely analogous to the one we were testing with Oracle. The data model here, of course, is different, but the query syntax is similar. See this tutorial to learn more about SQL in Tarantool.

The request was executed in parallel with the similar Oracle database query (as I mentioned, without in-memory, which is important). Here, the query execution time was 1.02 seconds — compared to 5 minutes, 22.13 seconds in ORA. These gains are massive! And you can implement anything you’d like using this combination without the usual risks because your various internet and mobile services can use Tarantool, while your Oracle relational database remains in a protected perimeter for your business apps.

Do you have questions about your project? Visit Tarantool to connect with actual developers for answers.

Discover Tarantool's unique features such as powerful stored procedures, SQL support, smart cache, and the speed of 1 million ACID transactions on a single CPU.

Topics:
oracle ,tarantool ,dbms ,database ,cache ,in-memory ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}