CloudSqlite.CloudCache Interface

A local cache for storing data downloaded from many CloudSqlite databases. This object refers to a directory on the local filesystem and is used to connect CloudContainers so they may be accessed. It maintains the state of the local copy of the downloaded data from SQLiteDbs in CloudContainers across sessions.

Notes:

  • CloudCaches have a name, used internally by CloudSqlite, that must be unique. CloudCaches are created and maintained via CloudCaches.getCache.
  • All CloudContainers connected to a given CloudCache must have the same block size, as determined by the first CloudContainer connected.
  • they have a maximum size that limits the amount of disk space they can consume. When the maximum size of a CloudCache is reached, the least recently used blocks are removed to make room for new blocks.
  • CloudCaches may only be used by a single process at a time. An exception is thrown if you attempt to access a CloudCache from a second process if it is already in use by another process. Note: for a readonly CloudCache, a "daemon" process can be used to share a CloudCache across processes. See its documentation for details.
  • Generally, it is expected that there only be a few CloudCaches and they be shared by all applications. Each CloudCache can consume its maximum disk space, so controlling system-wide disk usage is complicated. The only reason to make a new CloudCache is either for containers with a different block size, or to purposely control local disk space usage for a specific set of containers.
  • The contents of the cache directory are entirely controlled by CloudSqlite and should be empty when the cache is first created and never modified directly thereafter.

Methods

Name Description
setLogMask(mask: number): void Configure logging for this CloudCache.  

Defined in

Last Updated: 03 May, 2024