Jump to: navigation, search

Nova/Object Cache

< Nova
Revision as of 08:28, 10 January 2014 by Malini-k-bhandaru (talk | contribs) (Created page with "'''Nova/Object Cache''' One of the reasons why Objects were introduced was to reduce the load on the database. But a further optimization is possible and especially useful in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Nova/Object Cache

One of the reasons why Objects were introduced was to reduce the load on the database. But a further optimization is possible and especially useful in a cloud of many hosts and consequently many more objects representing VMs, networks, security groups and much more. This is particularly useful for management dashboards such as horizon for very large clouds. For instance you want to display all VMs in the system (active, sleeping ..), or all VMs belonging to a tenant etc.

The database field: "updated_at" in conjunction with the object-id can be used to determine whether a copy of an object one has on hand is the latest. If it is, one may use it, display it without further re-fresh.

To support caching,

  1. the base object class should carry the field "updated_at".
  2. Need an API that retrieves only headers .. get_all_instances( .., headers_only=true)
  this would return {(VM1, t1), (VM2, t2), (VM3, t3) ...(VMz, tz)}
  1. refresh_cache(my_cache, object_headers)

This method essentially establishes whether the object at hand was updated since it was last retrieved. For instance, assume the cache contains only {(VM1, t0), (VM2, t2)} and that t0 < t1. The refresh option then retrieve a fresh copy of VM1 and copies of VM3 and VMz to give


While this solution requires two calls and a comparison and then retrieval of full objects, in cases where all objects do not change, or do not change too frquently, much the caching improves performance.

Yet another performance speed-up is to request an object with only limited fields. This typically is useful in a display hierarchy where the more detailed object is only required should the user select the item.