Menu
Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.3
Developing Drivers for Data Stores Without SQL

SimbaEngine X SDK Documentation > SQL Engine Features > Introduction to the Simba SQLEngine

Introduction to the Simba SQLEngine

The Simba SQLEngine is a self-contained SQL parser and execution engine that you can use in your custom driver to convert SQL queries and commands into a format that your data store understands. This component allows you to add SQL processing capability to a non-SQL-capable data store, making your data available to common reporting tools through standard interfaces. The Simba SQLEngine can also expose support for Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL) SQL statement, if your data store supports this functionality.

The Simba SQLEngine consumes SQL-92 queries, parses them, and creates an optimized execution plan, then allows your DSI implementation to take over part or all of the execution, and finally executes the plan against the DSI implementation. To use the Simba SQLEngine, your DSI implementation must translate your data store schema into a view with tables and columns.

Simba SQLEngine Architecture

The Simba SQLEngine is available in the C++ and Java version of the SimbaEngine SDK.  You can  create ODBC drivers and pure-Java JDBC drivers for data sources that do not support SQL.  You can also use a C# development environment to write the data access portion of your driver, and then use CLI to link with the C++ SimbaEngine SDK.

Note:

To write a custom driver for client-server deployment, you must use the C++ Simba SQLEngine.

The Simba SQLEngine does not expose another API. It is designed to be enclosed between two instances of the DSI. The top end of the Simba SQLEngine is compatible with the SimbaODBC, SimbaJDBC, or SimbaServer DSI specification. Your driver code can link directly to the C++ Simba SQLEngine to create a stand-alone ODBC driver or a server, or it can link directly to the Java Simba SQLEngine to create a stand-alone JDBC driver.

The bottom end of Simba SQLEngine is compatible with another part of the DSI specification, which calls into a DSI implementation that connects to a non-SQL data store.

At a high level, the Simba SQLEngine is composed of the Preparation component, the Execution component, and the Execution tree. The Preparation component contains the SQL parser. It also validates the SQL by ensuring that data store objects such as tables and columns exist. Once the SQL statement is prepared, it is handed to the Execution component. The Execution component provides the environment for executing the execution tree and retrieving the result set.

This architecture is illustrated in the following diagrams:

Figure 3. Architecture of the C++ Simba SQLEngine

Figure 4. Architecture of the Java Simba SQLEngine

Optimizing Queries with the Simba SQLEngine

The Simba SQLEngine contains several features that allow you to optimize queries and improve performance in your custom driver.

If your data store implements indexes or a similar functionality, or if it is able to find specific data rows very quickly, then Simba SQLEngine can use this functionality to optimize operations such as filtering and sorting. Your data store does not have to implement indexes according to the Indexed Sequential Access Method (ISAM) model. As long as the data store can seek to specific data rows as if it was using an index (that is, faster than the Simba SQLEngine could step through the data itself), then Simba SQLEngine can use that functionality as if it was a real index. For more information on using Indexes, see Support for Indexes.

If your data store has high performance features that enable fast processing of some queries or commands, you can tell the Simba SQLEngine to pass these sections of the command directly to the data store. This feature is called Collaborative Query Execution. For more information on Collaborative Query Execution, see Overview of Collaborative Query Execution.

Simba SQLEngine also uses table cardinality and other metadata to optimize the query before execution. If indexes and table cardinality are not available, Simba SQLEngine will still work, but it will be slower because it will not be able to perform the more advanced optimizations.

 

Related Links

Overview of Collaborative Query Execution

SQL Engine Memory Management

Data Manipulation Language (DML)

Data Definition Language (DDL)

Support for Indexes

Sample Index Implementation

Custom Scalar and Aggregate Functions

Stored Procedures