Why Odoo’s XML-RPC API is a Natural Fit for OLTP, But a Mismatch for OLAP

XML-RPC API

At its core, architecture is about choosing the right tool for the right job. Whether you’re optimizing high-throughput transactions, analyzing business trends, or integrating third-party systems, it’s crucial to understand the strengths and limitations of the interface you’re using.

This article explores why Odoo’s XML-RPC API is highly effective for OLTP (Online Transaction Processing) workloads but poorly suited for OLAP (Online Analytical Processing).


What Is XML-RPC?

XML-RPC is a remote procedure call protocol that uses XML to encode requests and HTTP as the transport mechanism. It’s stateless, synchronous, and designed for simplicity. Odoo, a popular open-source ERP system, exposes its business logic through XML-RPC endpoints, allowing clients to interact with its data models and workflows.

Think of XML-RPC as: One small operation at a time, wrapped in verbose XML, transmitted over HTTP.


OLTP: Online Transaction Processing

OLTP systems support day-to-day business operations. These involve frequent, small, and concurrent transactions such as:

  • Creating an invoice
  • Updating customer details
  • Confirming an order

Why Odoo XML-RPC Works Well for OLTP

  • Atomic Record Operations: The API allows you to perform create, read, write, and delete operations on individual records.
  • Real-Time Execution: Each call is synchronous and returns immediate feedback.
  • Business Logic and Permissions: Odoo ensures validation and access control are enforced automatically.
  • Secure and Stateless: Every call includes authentication, making it suitable for distributed systems.

For example, a customer order submitted from a frontend can be processed through multiple XML-RPC calls—from cart creation to invoice generation—all in real time.


OLAP: Online Analytical Processing

OLAP focuses on analyzing large volumes of data for business intelligence, reporting, and forecasting. Common tasks include:

  • Aggregating sales data
  • Generating monthly reports
  • Building analytical dashboards

Why Odoo XML-RPC Falls Short for OLAP

  • High Overhead: Each call involves XML serialization, HTTP transmission, and ORM processing.
  • Limited Query Support: No native support for joins, aggregates, or complex expressions.
  • Manual Pagination: Lacks efficient streaming or batching mechanisms.
  • Blocking Requests: Each call is synchronous and cannot be easily parallelized.
  • ORM Bottleneck: All queries go through business logic layers not optimized for bulk reads.
  • Computed Fields Overhead: Odoo models often include computed fields that are dynamically calculated on access, which adds unnecessary CPU cost during large data exports—a burden irrelevant to analytical use cases.

Alternatives for OLAP Workloads

To perform OLAP-style analysis, consider the following approaches:

1. Read Replicas

Configure a read-only replica of the PostgreSQL backend. Use SQL clients or BI tools to query it directly, bypassing the ORM.

2. ETL Pipelines

Extract data using PostgreSQL, transform it, and load it into a data warehouse (e.g., Redshift, Snowflake, BigQuery).

3. Data Lakes

Dump large datasets to object storage (e.g., S3) and use serverless engines like Presto or Athena to query them.


Summary

XML-RPC Strengths (OLTP)

  • Great for record-level create/read/update/delete operations
  • Enforces business rules and user permissions
  • Real-time and synchronous for interactive applications
  • Secure, stateless, and easy to integrate

XML-RPC Weaknesses (OLAP)

  • Inefficient for large-scale data reads
  • No support for advanced queries or aggregation
  • Lacks streaming, batching, and parallel execution
  • Slows down significantly with growing dataset size
  • Triggers unnecessary computation of dynamic fields irrelevant to analytics

Conclusion

Odoo’s XML-RPC API is a robust interface for transactional systems. It excels at real-time, record-level operations and adheres to business rules and security policies. However, it is not designed for the high-throughput, aggregate-driven workloads typical of OLAP systems.

For analytics, it is best to replicate or extract data to a dedicated analytics platform and avoid using XML-RPC for anything beyond operational queries.

Use each tool for what it was designed to do, and your system will be faster, more scalable, and easier to maintain.