In this Post

    Subscribe to Our Blog
    Get the latest trends, solutions, and insights into the event-driven future every week.

    Thanks for subscribing.

    APIs are often the front door to businesses, but when they rely on heavyweight systems like SAP, performance can suffer. Caching helps—but only if you can keep the data fresh. In this post, I’ll explore how Apigee and Solace work together to keep our APIs responsive and the data current. While back-end systems such as SAP are the engine room of many businesses, clients polling them frequently can be expensive and inefficient. Often, multiple API calls to request information in an ERP return unchanged data, yet still burden the backend services. You can use API caching to address these issues, but then face the challenge: what if your data changes in the backend? How do you ensure your cache remains up-to-date and avoids serving stale information?

    This is where a combination of Apigee’s caching capabilities and Solace’s REST delivery point (RDP) can turbo-charge data delivery.

    The Challenge: Slow Backend APIs and Stale Cached Data

    Consider an Order API that’s frequently polled for status updates. If every request hits a backend system – such as SAP- directly, response times slow down and backend load increases.

    enterprise systems back end

    API gateways like Apigee live between clients and target systems and can cache data in response to API calls, and once cached, can serve subsequent requests directly from the cache within milliseconds. Apigee offers response caching for backend responses and general-purpose caching allowing you to quickly and easily apply caching to your APIs.

    enterprise systems and apigee edge back end

    However, the default cache expiry time for a cache entry is typically one hour. If the order data e.g. in SAP changes within that hour, your API continues to serve outdated information from the cache, which leads to stale data and a poor user experience. While Apigee allows you to explicitly clear a cache entry using its Management APIs, the question remains: how do you know when to clear or update it in real-time?

    apigee management apis apigee edge

    Enabling Real-Time API Updates with Solace RDPs

    Solace’s REST Delivery Point (RDP) helps you bridge the gap between event-driven systems and REST-based APIs. It listens for events—like changes in SAP—and sends them as HTTP POST requests to REST endpoints, such as an Apigee API Proxy. This enables you to establish real-time communication between backend systems and REST APIs.

    Solace’s REST Delivery Point

    It allows HTTP/REST consumers to participate in an event-driven ecosystem, providing reliable and ordered event delivery through queue-based persistence.

    Real-Time Cache Updates with Apigee and Solace

    Here’s how to make Apigee and Solace work together to keep your cache current:

    1. A backend system such as SAP publishes an event when order data changes.
    2. A Solace RDP delivers the event to an Apigee API Proxy via HTTP POST.
    3. The Apigee API Proxy either updates the cache directly or invalidates it, depending on the content of the event.

    Real-Time Cache Updates with Apigee and Solace

    Event Generation in Backend Systems

    When an order status changes, an item is shipped, or any other relevant update occurs in your backend systems, such as SAP, it publishes an event to a Solace Event Broker. This is a common pattern in EDA enabled by Solace Platform. It liberates information from a variety of sources using platform capabilities such as micro-integrations or partner products such as ASAPIO for SAP.

    Solace RDP Delivers Events to Apigee

    A Solace RDP is configured to consume these order-related events from a persistent queue on the Solace broker. It then transforms these events into HTTP POST requests and delivers them to a specific REST endpoint exposed by an Apigee API proxy. The API proxy acts as the REST consumer in this scenario.

    Apigee Proxy Manages the Cache

    The Apigee API proxy, upon receiving the HTTP POST request from a Solace RDP, can be configured with policies to intelligently handle the event data.

    If the event from Solace contains the full, updated order information, the Apigee API Proxy can directly update the relevant cache entry. It uses a suitable cache key e.g. based on the order ID received in the event to update the correct entry.

    Alternatively, the API proxy can make an Apigee Management API call to delete the specific cache entry using its cache key. This ensures that the next API call to the Order API for that specific order will bypass the cache and go all the way to the backend SAP system to fetch the latest, fresh data. This newly fetched data will then be re-cached by Apigee for subsequent requests.

    Results: Fresh Data, Fast APIs, and Scalable Performance

    By integrating Apigee and Solace, you get:

    • Real-time Data Consistency: Your cache is dynamically updated or invalidated as soon as data changes in the backend systems. This ensures that clients always receive the most current information, effectively eliminating the problem of serving stale data that can occur with simple time-based cache expiry.
    • Reduced Load on systems of record: By leveraging the Apigee cache for frequently accessed data, the number of direct, expensive queries to back-end systems is significantly reduced. The systems only need to be hit for the initial data fetch or after a specific cache invalidation.
    • Super-Responsive APIs: Apigee’s ability to serve cached data in milliseconds transforms your “garden snail” APIs into “turbo APIs”, providing a superior experience for end-users and client applications.
    • Automated Cache Management: Instead of manual invalidation or waiting for arbitrary expiry times, the system proactively manages the cache based on actual backend data changes, leading to more efficient resource utilization.
    • Scalability: Both Apigee and Solace are built for scale, allowing your APIs to handle high traffic volumes efficiently without compromising data freshness.

    Connecting the event-driven capabilities of Solace Platform with the API management and caching power of Apigee, lets you build a robust, real-time data delivery system for critical back-end information, ensuring data is never stale and always accessible at low latency.

    Swen-Helge Huber headshot
    Swen-Helge Huber
    Senior Director, Office of the CTO

    As a senior director in Solace's office of the CTO, Swen-Helge Huber works with Solace’s API management technology partners to make unified event and API management a reality for our PubSub+ Event Portal customers. He has connected apps, services, data, mobile clients and devices for more than 15 years working for middleware vendors across the event broker, data integration, big data, EAI, SOA and API management spaces.