Sybase RAP Load Adapter Sample

This sample provides StreamBase sample applications for creating, loading to, and reading from Sybase RAP.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Chronicle list.

  • Click OK.

StreamBase Studio creates a single project containing the sample files.

Sample Location

By default, the sample files are installed in:

On Windows

C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\chronicle-sybase\

On UNIX

/opt/streambase/sample/adapter/chronicle-sybase/

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace. StreamBase Systems recommends that you use the workspace copy of the sample, especially on UNIX, where you may not have write access to /opt/streambase. In the default installation, the path to this sample in your Studio workspace is:

UNIX:       
  ~/streambase-studio-n.m-workspace/sample_chronicle-sybase
Windows XP:
  C:\Documents and Settings\username\My Documents\
      StreamBase Studio n.m Workspace\sample_chronicle-sybase
Windows 7 and Windows Vista:
  C:\Users\username\Documents\StreamBase Studio n.m Workspace\
      sample_chronicle-sybase

This Sample's Files

Included in this sample is:

  • A sample TAQ-like schema that can be used for testing or a starting point of a real application.

  • A sample application to create the necessary Sybase IQ tables for the sample schema.

  • A sample application that loads Sybase RAP.

  • A sample feed simulation that can be used for testing.

  • A sample application that can be used for read testing. This application includes rate and latency measuring features.

The Sybase JDBC driver is not included in this sample, and needs to be obtained from Sybase.

Summary

The pieces provided with the sample are intended to provide a starting point for customers to load data quickly and efficiently and do various real time and historical queries on the data. StreamBase applications read data from Sybase RAP via the Chronicle connection.

Note that Sybase RAP can be thought of as a packaging integration of Sybase IQ and a special configuration of Sybase ASE that is essentially a memory only configuration. In this sense, there really are two different databases to load and read from. The in-memory ASE is intended to be used for any real time requirements, while the IQ is intended for persistent (that is, historical) requirements.

For Sybase RAP3 users: RAP3 uses separate disk-based CSV files to load both ASE and IQ. A series of Sybase-supplied scripts are used to accomplish this. The StreamBase CSV writer adapter is used as the bulk load adapter for Sybase RAP3. See the Sybase RAP3 documentation on how to configure their load scripts and where the StreamBase CSV writer adapter should put the output files. RAP3 users can use the loadRAP3.sbapp as an add-on module in the sybase-load.sbapp application.

In addition to using the traditional CSV file loading, “Sybase RAP – The Trading Edition” offers the option to use a new Sybase bulk load API. This API is intended for financial services environments and has some characteristics worth noting:

  • Limited data type support (string, int, decimal, date, datetime, null).

  • Limited tuple size (around 1400 bytes depending on routing configuration).

  • Error reporting is limited: tuples can be sent successfully even if no RAP instance is available.

  • The StreamBase RAP loader is only supported on 64-bit Linux.

The bulk load API uses a Sybase proprietary multicast protocol and can load both IQ and ASE. The StreamBase Sybase RAP loader is an embedded adapter that uses the Sybase C-based RAP Loader API. The adapter configuration basically just needs to two directories that the Sybase RAP Loader API requires. See the Sybase RAP documentation for configuring RAP load publishers and subscribers.