LucidDB and Mondrian
For OLAP applications, LucidDB works well when run in tandem with Mondrian, an open-source pure-Java OLAP engine which supports the MDX query language. In fact, since both are built on Java technology, they can be run together in the same J2EE application server for high performance (single JVM sharing the same memory, with no remote procedure calls) and convenient management (just one server).
But for getting started, you may learn more by setting up and running the two components separately. Here's how.
- Set up LucidDB as described in LucidDbGettingStarted, and start the server listening on the default port.
- Run sqllineClient and execute the following commands to prepare a schema and user for use by Mondrian:
create schema foodmart; create user "foodmart" identified by 'foodmart' default schema foodmart; grant execute on specific procedure applib.estimate_statistics_for_schema_no_samplingrate to "foodmart";
- Download Mondrian as described in the first section of the installation instructions.
- NOTE: In Mondrian 3.2 there's a target for LucidDB in loadFoodmart.sh
- For section 2, Set up test data in a non-embedded database, use the following information to configure FoodMartLoader:
- JDBC driver jar: luciddb/plugin/LucidDbClient.jar
- JDBC driver class: org.luciddb.jdbc.LucidDbClientDriver
- Below is an example script for running FoodMartLoader against LucidDB on Linux (to be run from the directory where you unpacked Mondrian; you'll need to adjust the path to luciddb's installation for LucidDbClient.jar). For a faster and easier way to replicate FoodMart or any other Mondrian-fronted database into LucidDB, see LucidDbMondrianReplication. Also, LucidDbAggregateDesigner can be used to automatically build aggregate tables within LucidDB.
export CP=lib/commons-dbcp.jar:lib/commons-collections.jar:lib/commons-pool.jar export CP=$CP:lib/eigenbase-properties.jar:lib/eigenbase-resgen.jar:lib/eigenbase-xom.jar export CP=$CP:lib/javacup.jar:lib/mondrian.jar export CP=$CP:lib/log4j.jar export CP=$CP:testsrc/main export CP=$CP:classes export CP=$CP:testclasses export CP=$CP:/path/to/luciddb/plugin/LucidDbClient.jar java -Xms500m -Xmx500m -cp $CP -Dlog4j.configuration=log4j.xml mondrian.test.loader.MondrianFoodMartLoader -tables -data -indexes -inputFile="demo/FoodMartCreateData.sql" -jdbcDrivers=org.luciddb.jdbc.LucidDbClientDriver -outputJdbcURL="jdbc:luciddb:http://localhost" -outputJdbcUser=FOODMART
- After running FoodMartLoader, run sqllineClient -n foodmart to log in to LucidDB as the foodmart user; execute this command to collect optimizer statistics on the loaded data:
- Follow the deployment instructions in section 3, Deploy and run the web application with a non-embedded database, making the necessary changes for the LucidDB JDBC driver.
- You should now be able to execute MDX queries via a web browser, with Mondrian as a middleman executing SQL against LucidDB to fetch data. Check luciddb/trace/Trace.log to see the SQL statements executed in response to your queries.
For a tighter integration option, see LucidDbAsManagedBean.
To find out how to replace FOODMART with your own data, read the LucidDbEtlTutorial.