A local database cache enabling persistent, adaptive caching of either
full or partial content of a remote database is provided. Content of
tables comprising a local cache database is defined on per-table basis. A
table is either: defined declaratively and populated in advance of query
execution, or is determined dynamically and asynchronously populated
on-demand during query execution. Based on a user input query originally
issued against a remote DBMS and referential cache constraints between
tables in a local database cache, a Janus query plan, comprising local,
remote, and probe query portions is determined. A probe query portion of
a Janus query plan is executed to determine whether up-to-date results
can be delivered by the execution of a local query portion against a
local database cache, or whether it is necessary to retrieve results from
a remote database by executing a remote query portion of Janus query
plan.