<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Diego A. Carrasco Gubernatis | Personal Website (Posts about data science)</title><link>https://diegocarrasco.com/</link><description></description><atom:link href="https://diegocarrasco.com/categories/data-science.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:hi@diegocarrasco.com"&gt;Diego Carrasco G.&lt;/a&gt; </copyright><lastBuildDate>Tue, 13 Oct 2026 08:04:52 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Intro to Databases: Understanding OLAP, OLTP, Embeddable, and Standalone</title><link>https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/</link><dc:creator>Diego Carrasco G.</dc:creator><description>&lt;figure&gt;&lt;img src="https://diegocarrasco.com/images/social-images/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone.jpg"&gt;&lt;/figure&gt; &lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#tldr"&gt;TLDR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#introduction-to-databases"&gt;Introduction to Databases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#why-this-article"&gt;Why this article?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#what-is-olap"&gt;What is OLAP?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#what-is-oltp"&gt;What is OLTP?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#what-is-embeddable"&gt;What is Embeddable?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#what-is-standalone"&gt;What is Standalone?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#understanding-the-differences"&gt;Understanding the differences&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#olap-vs-oltp"&gt;OLAP vs OLTP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#embeddable-vs-standalone"&gt;Embeddable vs Standalone&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone/#references"&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="tldr"&gt;TLDR&lt;/h3&gt;
&lt;p&gt;Databases are essential if you work with computers, varying in type and purpose. OLAP and OLTP represent
different data processing approaches, while embeddable and standalone databases differ in their integration with applications. This article serves as an introductory guide to these concepts.&lt;/p&gt;
&lt;h3 id="introduction-to-databases"&gt;Introduction to Databases&lt;/h3&gt;
&lt;p&gt;If you have ever worked with computers, you have probably heard of databases. They are the (usually correct) way for 
storing and managing data efficiently. While some (of us) still use Spreadsheets as a database, there are many 
types 
of actual databases, each with its own purpose and advantages.&lt;/p&gt;
&lt;p&gt;Databases are used in almost every application, from 
simple blogs running WordPress to complex ERPs. They are used in banking, e-commerce, and even in your smartphone.&lt;/p&gt;
&lt;p&gt;That said, databases are pivotal in storing and managing data efficiently if you work with data. With various types 
available, understanding 
the basics, like OLAP, OLTP, embeddable, and standalone databases, is important, but regrettably not enough, for 
choosing the right 
database for your needs. but we need to start somewhere.&lt;/p&gt;
&lt;h3 id="why-this-article"&gt;Why this article?&lt;/h3&gt;
&lt;p&gt;A few weeks ago I found out about &lt;a href="https://duckdb.org/"&gt;DuckDB&lt;/a&gt;, an embeddable SQL OLAP database 
that can be used with Python (&lt;a href="https://duckdb.org/docs/api/overview"&gt;and many 
other&lt;/a&gt;). I was 
curious about its positioning as an OLAP database, and I found a mention to &lt;a href="https://hannes.muehleisen.org/publications/SIGMOD2019-demo-duckdb.pdf"&gt;this paper&lt;/a&gt; in &lt;a href="https://www.reddit.com/r/sqlite/comments/13np8ik/comment/jl6adp5/?utm_source=share&amp;amp;utm_medium=web3x&amp;amp;utm_name=web3xcss&amp;amp;utm_term=1&amp;amp;utm_content=share_button"&gt;Reddit&lt;/a&gt; where I found this graphic:&lt;/p&gt;
&lt;p&gt;&lt;img alt='Systems Landscape from the paper "DuckDB: an Embeddable Analytical Database"' src="https://diegocarrasco.com/images/db-landscpae-from-duckdb-paper.png"&gt;&lt;/p&gt;
&lt;p&gt;And I thought interesting to dive a bit deeper into the concepts of OLAP, OLTP, embeddable, and standalone databases.&lt;/p&gt;
&lt;p&gt;So here we are.&lt;/p&gt;
&lt;h3 id="what-is-olap"&gt;What is OLAP?&lt;/h3&gt;
&lt;p&gt;OLAP (&lt;strong&gt;Online Analytical Processing&lt;/strong&gt;) is a type of database designed for complex queries, data analysis, and reporting. It's often used in business intelligence and data warehousing, allowing users to analyze data from multiple perspectives.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;OLAP is an approach to answer multidimensional analytical (MDA) queries swiftly in computing. Typical applications of OLAP include business reporting for sales, marketing, management reporting, business process management (BPM), budgeting and forecasting, financial reporting and similar areas. OLAP tools enable users to analyze multidimensional data interactively from multiple perspectives.&lt;/p&gt;
&lt;p&gt;-- Automatic Summary from &lt;a href="https://en.wikipedia.org/wiki/Online_analytical_processing"&gt;Wikipedia&lt;/a&gt; using &lt;a href="https://github.com/dacog/Hugging-Face-Transformers-Language-Models-Exploration#summarize"&gt;this script&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An example of an OLAP database is a data warehouse that stores historical data from multiple sources. It allows users to analyze data from different perspectives, like sales by region, product, or time.&lt;/p&gt;
&lt;p&gt;Database that are in this category are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/redshift/"&gt;Amazon Redshift&lt;/a&gt;: A fully managed, petabyte-scale data warehouse service in the cloud.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.snowflake.com/"&gt;Snowflake&lt;/a&gt;: A cloud-based data platform that provides a data warehouse as a service designed for the cloud.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/bigquery"&gt;BigQuery&lt;/a&gt;: A serverless, highly scalable, and cost-effective cloud data warehouse designed for business agility.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://duckdb.org/"&gt;DuckDB&lt;/a&gt;: An embeddable SQL OLAP database that can be used with Python and many other languages.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://clickhouse.tech/"&gt;ClickHouse&lt;/a&gt;: An open-source OLAP database management system developed by Yandex. It is column-oriented and allows to generate analytical reports using SQL queries in real-time.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="what-is-oltp"&gt;What is OLTP?&lt;/h3&gt;
&lt;p&gt;OLTP (&lt;strong&gt;Online transaction processing&lt;/strong&gt;) databases are optimized for managing transaction-oriented applications, like e-commerce systems, banking, and 
reservation systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Online transaction processing (OLTP) is a type of database system used in transaction-oriented applications, such as many operational systems. "Online" refers to that such systems are expected to respond to user requests and process them in real-time (process transactions) The term is contrasted with online analytical processing ( OLAP) which instead focuses on data analysis.&lt;/p&gt;
&lt;p&gt;-- Automatic Summary from &lt;a href="https://en.wikipedia.org/wiki/Online_transaction_processing"&gt;Wikipedia&lt;/a&gt; using &lt;a href="https://github.com/dacog/Hugging-Face-Transformers-Language-Models-Exploration#summarize"&gt;this script&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An example of an OLTP database is a banking system that stores customer information and transactions. It allows users to perform transactions like deposits, withdrawals, and transfers.&lt;/p&gt;
&lt;p&gt;Database that are in this category are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mysql.com/"&gt;MySQL&lt;/a&gt; : An open-source relational database management system.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mariadb.org/"&gt;MariaDB&lt;/a&gt;: An open-source relational database management system, and a fork of MySQL before being acquired by 
  Oracle.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt;: An open-source object-relational database management system.&lt;/li&gt;
&lt;li&gt;Oracle: A relational database management system developed by Oracle Corporation.&lt;/li&gt;
&lt;li&gt;SQL Server: A relational database management system developed by Microsoft.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sqlite.org/index.html"&gt;SQLite&lt;/a&gt;: A relational database management system that is embedded into the end program.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="what-is-embeddable"&gt;What is Embeddable?&lt;/h3&gt;
&lt;p&gt;Embeddable databases can be directly integrated into an application's software. They run within the application’s process, making them ideal for desktop applications, small-scale web applications, or for use in portable devices.&lt;/p&gt;
&lt;p&gt;Database that are in this category are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.sqlite.org/index.html"&gt;SQLite&lt;/a&gt;: A relational database management system that is embedded into the end program.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://duckdb.org/"&gt;DuckDB&lt;/a&gt;: An embeddable SQL OLAP database that can be used with Python and many other languages.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.h2database.com/html/main.html"&gt;H2&lt;/a&gt;: An embeddable RDBMS written in Java.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebirdsql.org/"&gt;Firebird&lt;/a&gt;: An open-source SQL relational database management system.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://hsqldb.org/"&gt;HSQLDB&lt;/a&gt;: An open-source relational database management system written in Java.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="what-is-standalone"&gt;What is Standalone?&lt;/h3&gt;
&lt;p&gt;Standalone databases operate separately from the application. They require their server process and are accessed over a network. This type is suitable for large-scale applications that require robust database management systems.&lt;/p&gt;
&lt;p&gt;Database that are in this category are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mysql.com/"&gt;MySQL&lt;/a&gt; : An open-source relational database management system.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mariadb.org/"&gt;MariaDB&lt;/a&gt;: An open-source relational database management system, and a fork of MySQL before being acquired by 
  Oracle.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt;: An open-source object-relational database management system.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="understanding-the-differences"&gt;Understanding the differences&lt;/h3&gt;
&lt;h4 id="olap-vs-oltp"&gt;OLAP vs OLTP&lt;/h4&gt;
&lt;p&gt;OLAP and OLTP are two different approaches to data processing. OLAP is used for complex queries and data analysis, while OLTP is used for transaction-oriented applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Transaction-oriented&lt;/strong&gt; means that the database is optimized for handling transactions, which are a set of operations that must be executed as a whole. For example, when you buy something online, the transaction is the whole process of adding the item to the cart, entering your payment information, and confirming the purchase.&lt;/p&gt;
&lt;p&gt;OLAP databases are optimized for complex queries and data analysis. They are used in business 
intelligence 
and data warehousing, allowing users to analyze data from multiple perspectives.&lt;/p&gt;
&lt;h4 id="embeddable-vs-standalone"&gt;Embeddable vs Standalone&lt;/h4&gt;
&lt;p&gt;Embeddable databases can be directly integrated into an application's software. They run within the application’s 
process, making them ideal for desktop applications, small-scale web applications, or for use in portable devices. 
But they also have a sweet spot in data science and machine learning applications, where they can be used to store 
data without the need for a separate database server. &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;div class="alert alert-info d-flex align-items-center  ml-3" role="alert" style="width: auto; max-width: 50%;"&gt;
        &lt;i class="fa fa-sticky-note fa-2x mr-3"&gt;&lt;/i&gt;
    &lt;div&gt;After playing with it for a bit, I realized that DuckDB may not perform as quickly 
when handling a few thousand rows of data and big json columns. However, it offers user-friendly data access, seamless 
integration with pandas and PyCharm, and is excellent for experimentation. Nevertheless, I eventually switched to using PostgreSQL. &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Standalone databases operate separately from the application. They require their server process and are accessed 
over a network. This type is suitable for large-scale applications that require robust database management systems. 
In data science and machine learning applications, they are used for storing large amounts of data, and you can also 
run them using Docker, if you want to avoid the whole setup process.&lt;/p&gt;
&lt;p&gt;With embeddable databases, you can store data in a single file, which is easier to manage and move around, and you 
just need to install the database driver to use it. With standalone databases, you need to install the database 
server, the client and everything in between.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Understanding these basic database concepts is crucial but not enough for selecting the right database type for your 
specific 
needs. Each type offers unique advantages depending on the application's requirements and your use case.&lt;/p&gt;
&lt;h3 id="references"&gt;References&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Introduction to OLAP: &lt;a href="https://www.olap.com/learn-bi-olap/olap-definition/"&gt;OLAP Basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Understanding OLTP: &lt;a href="https://www.techopedia.com/definition/24404/online-transaction-processing-oltp"&gt;OLTP Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Embeddable vs Standalone Databases: &lt;a href="https://www.databasestar.com/embeddable-vs-standalone-databases/"&gt;Database Types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.reddit.com/r/sqlite/comments/13np8ik/comment/jl6adp5/?utm_source=share&amp;amp;utm_medium=web3x&amp;amp;utm_name=web3xcss&amp;amp;utm_term=1&amp;amp;utm_content=share_button"&gt;Reddit comment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hannes.muehleisen.org/publications/SIGMOD2019-demo-duckdb.pdf"&gt;Paper PDF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://duckdb.org/"&gt;duckDB Site&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><category>data science</category><category>Databases</category><category>Embeddable Databases</category><category>OLAP</category><category>OLTP</category><category>technical</category><guid>intro-to-databases-understanding-olap-OLTP-embeddable-and-standalone</guid><pubDate>Tue, 16 Jan 2024 08:00:00 GMT</pubDate></item></channel></rss>