Table Cache

Table Caches are an extended form of names maps, that can hold references to other caches. They are used to replace database tables that are very often used to lookup values that can lead to a massive impact on the performance of a mapping. Since table caches are kept in memory, access times are significantly lower than a database request going over a network.

A table cache is organised similarly to a table.

  • It has a name.

  • It contains columns, each with a name where convention defines that the first column is also the primary key identifying an entry. This is similar to the key of a common map.

  • Values of columns can be referencing to the primary key of another cache (foreign keys).

A table cache is created using the create table cache function. Passed to the function is the name of the cache and the names of the cache's columns. As already explained, the first column is also the column containing the primary key. Foreign keys are declared using the syntax foreign cache name -> column name.

Entries are added to the cache using the function add to table cache and being read from the cache using the function get value from table cache.

Hint: Another way of solving the problem being described in the beginning, memory based databases can be used as well. When running on the same system or within the same process, the bottleneck network can be avoided. The following databases are offering this feature.