Configuring Data Persistence With Cassandra
WSO2 DAS supports Apache Cassandra for its underlying Data Access Layer (DAL). In order to use the Cassandra DAL component, a pre-configured installation of Apache Cassandra (2.0.x or 2.1.x version) is required. The Cassandra implementation for the DAS DAL contains both the implementations of Analytics Record Store and Analytics File System.Â
The following sections describe both implementations of the Cassandra DAL component.
The Cassandra datasource does not support pagination or record count. Note that this does not affect the functions of the APIM Analytics, ESB Analytics and IS Analytics dashboards because all the records in these dashboards are indexed, and the record counts are obtained via the Apache Lucene functionality.
Enabling the Cassandra datasource provider
In order to use Cassandra as the record store/file system, the Cassandra datasource provider should be enabled as follows.
Open theÂ
<DAS_HOME>/repository/conf/datasources/analytics-datasources.xml
file. Â The Cassandra datasource provider is commented out by default as shown below.<!--<provider>org.wso2.carbon.datasource.reader.cassandra.CassandraDataSourceReader</provider>-->
Uncomment the Cassandra datasource provider as shown below.
<provider>org.wso2.carbon.datasource.reader.cassandra.CassandraDataSourceReader</provider>
Configurations for the Analytics Record Store
To configure Cassandra as the underlying datasource implementation for the Analytics Record Store, specify the Cassandra configurations in the <DAS_HOME>/repository/conf/analytics/analytics-config.xml
 file as shown in the example below.
<analytics-record-store name="EVENT_STORE"> <implementation>org.wso2.carbon.analytics.datasource.cassandra.CassandraAnalyticsRecordStore</implementation> <properties> <!-- the data source name mentioned in data sources configuration --> <property name="datasource">WSO2_ANALYTICS_DS_CASSANDRA</property> </properties> </analytics-record-store>
The properties of the above configuration are described below.
Property | Description |
---|---|
<implementation> | The implementation class of the Analytics Record Store relevant for Cassandra, which is org.wso2.carbon.analytics.datasource.cassandra.CassandraAnalyticsRecordStore . |
<property name="datasource"> | The Carbon datasource name of the CASSANDRA type that is used to find the associated Cassandra data source. |
Configurations for the Analytics File System
To configure Cassandra as the underlying datasource implementation for the Analytics File System, specify the Cassandra configurations in the <DAS_HOME>repository/conf/analytics/analytics-config.xml
 file as shown in the example below.
<analytics-file-system> <implementation>org.wso2.carbon.analytics.datasource.cassandra.CassandraAnalyticsFileSystem</implementation> <properties> <!-- the data source name mentioned in data sources configuration --> <property name="datasource">WSO2_ANALYTICS_DS_CASSANDRA</property> </properties> </analytics-file-system>
The properties of the above configuration are described below.
Property | Description |
---|---|
<implementation> | The implementation class of the Analytics File System relevant for Cassandra, which is org.wso2.carbon.analytics.datasource.cassandra.CassandraAnalyticsFileSystem . |
<property name="datasource"> | The Carbon datasource name of the CASSANDRA type that is used to find the associated Cassandra data source. |
Configuring the datasources
Datasources to connect to the above underlying Cassandra implementations should be defined as described below.Â
Configuring the datasource for the Analytics Record StoreÂ
Change the configurations of the WSO2_ANALYTICS_EVENT_STORE_DB
 datasource in the <DAS_HOME>/repository/conf/datasources/analytics-datasources.xml
 file accordingly. For information on the datasource configurations, see Configuring a Cassandra Datasource.
Configuring the datasource for the Analytics File System datasource
Change the configurations of the WSO2_ANALYTICS_FS_DB
 datasource in the <DAS_HOME>/repository/conf/datasources/analytics-datasources.xml
 file accordingly. For information on the datasource configurations, see Configuring a Cassandra Datasource.