Introduction
Unfortunately, a single database can’t be all things at all times. A system optimized for transactions is fundamentally different from one optimized for queries – from the way, the data is stored to the manner in which it’s processed. This necessitates the existence of two different types of data processing tools. OLTP (OnLine Transactional Processing) and OLAP (OnLine Analytical Processing).
What is the Difference Between OLTP and OLAP?
OLTP is a type of data processing focused on handling real-time transactions. It’s used for business applications like order entry, invoicing, banking transactions, etc. Older data is rarely touched. (How often do you check your bank transactions from 5 years ago?).
OLAP is designed for complex, heavy querying of data; trawling through large volumes to gain facts and insights. It’s used for business intelligence purposes like analytics and reporting, often working on data aggregated from OLTP systems. Historical data is much more relevant in this context as you look for trends and patterns over time.
RavenDB for OLTP
RavenDB is an OLTP database, so the focus is on processing transactions. Its queries ar optimized (for an OLTP database), and it does have features for analysis and reporting, for example, MapReduce and facets for specific scenarios such as orders by customers.
But RavenDB isn’t designed for real queries like complex analysis of large data sets. For that, you want a specialized tool.
(Before getting to that, it’s worth mentioning another advantage of splitting the data processing roles: it allows you to perform queries on a separate database, one that isn’t serving your customers and doesn’t interfere with your local database performance.)
How Can You Export Data From an OLTP Database?
To get data from an OLTP database like RavenDB into another service, you use a process called ETL (Extract Transform Load):
- Extract the data you want to send from your database.
- Transform it into the format you want by aggregating, normalizing, censoring, etc.
- Load it to the other service.
You Can ETL to SQL for Analysis, But
RavenDB is a document database. And no matter how much it's optimized, queries can be more efficient on an equally optimized SQL database. Therefore for heavy queries, you might consider using RavenDB’s SQL ETL feature to push your data to a SQL reporting database.
Doing so was standard procedure in the past, but it’s no longer the ideal solution.
We’re now in the era of the cloud, with access to virtually unlimited power and scalability, and the ability to store large amounts of data relatively cheaply. On the cloud, OLAP services offer many advantages.
Advantages of OLAP on the Cloud
- SQL databases on the cloud are expensive to operate, especially with a lot of data. OLAP services utilize data formats that can be more highly compressed and queried more efficiently.
- Storage is very cheap on the cloud. If you know which data you’ll be querying most and take advantage of intelligent tiering, you can make it even cheaper.
- You can push data from multiple locations to a single point for processing.
- Data can come from multiple sources, for example, different OLTP databases.
- Multiple locations and sources can upload data at the same time.
- You can leave the complexities of pushing/uploading data from multiple sources to the cloud provider rather than handling them yourself.
- It’s easy to control who can access what data, for example, by giving upload only permissions to locations being pushed from.
- Your data is stored on the cloud where it will only be read from, not modified. This means you can safely expire old data from your OLTP database.
Examples of cloud OLAP services are Athena on AWS, Data Lake on Azure, Big Query GCP, or Presto for other platforms.
How Can You Synchronize Data From OLTP to OLAP on the Cloud?
This starts with an ETL process; the data must be extracted from the OLTP database, transformed into a format appropriate to the OLAP service, then uploaded onto cloud storage e.g. AWS. Once on the cloud, it can be ingested into OLAP services like Athena.
Column-Based vs Row-Based File Formats
As mentioned, OLAP services use a different data format to that of SQL databases. OLAP services use a column-oriented format while SQL databases are row-oriented.
Row-oriented file formats organize data by records, so the values of each record are stored together. In contrast, columnar file formats organize data by field, so the values of each field are stored together.


Join the conversation! Your thoughts help the community grow.