How to expose your heavy, legacy retail database to modern, lightweight microservices.
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 (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
- Create a Custom View: Never expose base tables. Create a custom view (e.g.,
CUST_INV_API_V) that joinsITEM_MASTER,STORE, andITEM_LOC_SOHto return exactly the fields the mobile app needs. - Define the ORDS Module: Use the ORDS PL/SQL API to define a module, a URI template, and bind variables.
- Write the Handler:
ORDS automatically handles the connection pooling, security, and JSON serialization.
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.
- Use the RIB to publish inventory change messages (
InvAvailfamily). - Have a lightweight microservice subscribe to those messages and update a Redis cache.
- 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.


