Data caching in service now

venuvajjala
ServiceNow Employee
ServiceNow Employee

I want to understand about how service now caches the data and what kind of data.

When we query the DB tables (Using GlideRecord API), is the data cached automatically for "any" table created in service now ?

Are there some specific platform tables like sys_properties,wf_context (Not sure about second one though) for which the caching is enabled ?

When we query same table using the GlideRecord API multiple times, does it try to pull the data from cache from second time ?.

1 ACCEPTED SOLUTION

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

There are several places where ServiceNow does caching:



- database level by using the MySQL InnoDB buffer pool caching (MySQL :: MySQL 5.5 Reference Manual :: 14.9.2.1 The InnoDB Buffer Pool )


- application node by using several layers of caching; you can view the table caching by looking at:



https://<yourinstance>.service-now.com/xmlstats.do?include=cache



Regards,


View solution in original post

2 REPLIES 2

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

There are several places where ServiceNow does caching:



- database level by using the MySQL InnoDB buffer pool caching (MySQL :: MySQL 5.5 Reference Manual :: 14.9.2.1 The InnoDB Buffer Pool )


- application node by using several layers of caching; you can view the table caching by looking at:



https://<yourinstance>.service-now.com/xmlstats.do?include=cache



Regards,


Thanks Sergiu , that helped me in understanding how glideRecord query() was able to retrieve results faster. I was actually measuring the performance between


'"in-memory" looping of 1000 records for a condition' vs 'adding   condition using "addQuery" and calling query() multiple times with setLimit(1)' . Calling query() was giving me faster response than "in-memory" looping, i thought DB operations are usually costly so in-memory looping will be faster. But here as its from cache, there was a significant difference. Once again thanks.