{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
7

Apigee Edge Caching In Detail  

  • Export to PDF
Michael Russo   created · Feb 20, 2015 at 09:22 PM · 6.5k Views · edited · Apr 02, 2015 at 11:51 PM

How does it work?

Apigee Edge uses Cassandra for its persistent datastore and cached data is stored in Cassandra. This enables us to provide distributed caching across multiple processing servers when we scale and even across regions. However, Edge caching does function as a 2 level cache. When a request hits an Apigee message processor (MP), it will try to return from an in-memory cache first. If it doesn't exist in memory, it fetches from Cassandra and then populates the value in memory for the next time.

What is the need for a distributed cache?

Depending on your solution, you may need to maintain state in Apigee across multiple API requests and be fault tolerant. As Edge typically has more than 1 message processor taking traffic, the distributed caching feature allows any message processor to have access to the same cache, persisted across any application restarts. An example solution needing a distributed cache is providing server-side storage for web sessions.

How are cache updates and invalidations handled in the distributed scenario?

When a cache entry's value is updated or invalidated, the message processor handling the event will notify the other message processors that the value has changed. These MPs will then remove their in-memory value for the given cache key. When the other MPs have to lookup the cache value again, it can be fetched from cassandra.

Can you control the configuration and limits of the cache?

There is no way to configure how much (in terms of size) can be cached. A named cache resource in Apigee has a concept of # of elements in memory with no relation to overall size. What does this mean? The 2nd level of cache (Cassandra) allows to you cache as much as you want, but the in-memory level will always have a finite space limitation since it's dependent on memory. The memory elements setting allows you to optimize which objects you want to return slightly faster from memory. Also, be aware that cache policy execution, today, doesn't tell you where the value returned from(memory/cassandra).

Configurable percentage limits do exist for the message processor to ensure caching does not consume all of the application's memory. When using Apigee's cloud offering, these settings are managed by Apigee and the customer does not have control. If deploying Apigee on-premises in a private cloud, the settings can be changed but typically it's not necessary alter the default configuration.

For more information on how to use the caching policies and configure named cache resources, please see the docs pages: Cache Policies , Cache Resources, Cache Internals

apigee-caching-new.png (52.2 kB)
thub.nodes.view.add-new-comment
api proxyedgecachingedge architecture
Add comment Show 4
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benjamin Goldman · Feb 25, 2015 at 04:15 PM 0
Link

Michael - in the following article:

http://apigee.com/docs/api-services/content/manage-caches-environment

Reference is made to the shared cache - which does not have all of the fancy settings of the defined caches.

one thing we want to understand is if this shared cache is also a distributed cache?

avatar image Benjamin Goldman · Feb 25, 2015 at 04:19 PM 0
Link

Also - we are looking to understand if that memory limit mentioned above applies to a total utilization from ALL caches as a total or to each cache independently?

avatar image Michael Russo ♦   · Feb 25, 2015 at 09:04 PM 0
Link

The default (shared) cache should also be distributed. As far as the memory limits, here are the differences. # max elements configuration - this is set on the cache resource so limit is per cache resource

configurable percentage limit - this is a usage memory limit across all cache resources

I'll try to clarify this more in the article when I get a chance. Thanks!

avatar image Omid Tahouri ♦   · Oct 19, 2015 at 02:02 PM 0
Link

On this doc, the last point in "Level 1 is an in-memory cache" states "Each in-memory cache instance is isolated and cache entries are not distributed across message processors". This contradicts the information in this post.

Specifically, I'm referring to the diagram and "When a cache entry's value is updated or invalidated, the message processor handling the event will notify the other message processors that the value has changed".

Does it just notify other MPs of the change, or will it share the change (with k & v)?

Any clarification on this would be great!

Thanks,

Omid

Article

Contributors

avatar image

Follow this article

11 People are following this .

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Navigation

Apigee Edge Caching In Detail
  • Cache handling in proxies which return both XML and JSON response

Related Articles

Customized APIs by device - Belly

Automate KVM creation on Apigee Edge

Sample: Using Node.js caching with Edge policies

How to dynamically call different target endpoints based on region

Apigee Developer? Here's The Stuff You Should Know

Enable SAML for Apigee Edge Production Organizations!

Configure a proxy NOT routing it to any target servers, How can I design it?

How do I move data from one org to another ?

How to return a WSDL through Edge

How do see full request/response body in the Trace UI?

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges