Oracle Retail9 min readBy Priyanshu Pandey

Building Custom APIs on Top of Oracle RMS

Patterns and anti-patterns for exposing Oracle RMS data to modern web and mobile applications using REST APIs and ORDS.

Phase 9 · RMS Development & Customization

How to expose your heavy, legacy retail database to modern, lightweight microservices.

9 min read📅Aug 23, 2026✍️Priyanshu Pandey📚Oracle RMS Series
MODERNIZING RMS

The Challenge

Oracle RMS is a massive Oracle database. Modern E-commerce platforms, mobile apps, and microservices don't want to connect directly to an Oracle database via JDBC. They want lightweight, stateless REST APIs returning JSON.

Furthermore, if your high-traffic mobile app directly queries the ITEM_LOC_SOH table to check inventory 10,000 times a second, your RMS database will crash, taking down the entire enterprise.

ORDS

ORDS (Oracle REST Data Services)

The absolute best way to expose custom APIs directly from an Oracle Database is ORDS (Oracle REST Data Services).

ORDS bridges the gap between REST and SQL/PLSQL. It allows you to write a SQL query or a PL/SQL block, and instantly map it to a URI (e.g., GET /api/inventory/items/1001/locations/999).

Building an ORDS Endpoint for RMS

  1. Create a Custom View: Never expose base tables. Create a custom view (e.g., CUST_INV_API_V) that joins ITEM_MASTER, STORE, and ITEM_LOC_SOH to return exactly the fields the mobile app needs.
  2. Define the ORDS Module: Use the ORDS PL/SQL API to define a module, a URI template, and bind variables.
  3. Write the Handler:
ORDS GET Handler Definition
SQL
BEGIN
  ORDS.DEFINE_HANDLER(
      p_module_name    => 'retail.api',
      p_pattern        => 'inventory/:item/:loc',
      p_method         => 'GET',
      p_source_type    => ORDS.source_type_query,
      p_source         => 'SELECT item, loc, stock_on_hand FROM cust_inv_api_v WHERE item = :item AND loc = :loc'
  );
  COMMIT;
END;

ORDS automatically handles the connection pooling, security, and JSON serialization.

CACHING PATTERNS

Caching Patterns (Anti-Pattern Warning)

Anti-Pattern: Exposing real-time RMS inventory to high-traffic consumer websites via direct database queries.

Pattern: Use a caching layer (like Redis) or an integration hub.

  1. Use the RIB to publish inventory change messages (InvAvail family).
  2. Have a lightweight microservice subscribe to those messages and update a Redis cache.
  3. The E-commerce platform queries the Redis cache—not RMS.

Only use ORDS or direct API calls for internal, lower-volume B2B systems or administrative tools where real-time database exactness is required and volume is controlled.

Key Takeaways

  • Do not let external apps connect to RMS via JDBC.
  • Use Oracle REST Data Services (ORDS) to quickly spin up secure REST APIs backed by PL/SQL.
  • Never expose raw tables; always build custom views for API exposure.
  • Use caching layers (driven by the RIB) for high-volume consumer traffic to protect the RMS database.
RetailCoder
All systems operational
v1.0 Live

RC:OMS

Multi-channel order management with double-entry inventory ledger. Amazon, Flipkart, Shopify, WooCommerce — one source of truth.

Launch demo →
v1.0 Live

RC:Storefront

Self-hosted headless e-commerce. Your server, your data, zero transaction fees. Native RC:OMS inventory sync.

Visit Storefront →
Pipeline

RC:Pulse

AI-powered retail analytics and demand forecasting — built natively on top of your RC:OMS and Storefront data.

Request early access →
Built in India 🇮🇳  ·  Architected by Priyanshu PandeyTalk to an engineer →