Custom data is stored in CloudBilling in the form of generic tables. This facility allows the use of important tabular information to be used in conditions and expressions in the Price Rules. It is possible to store many different “Custom Data Tables” within CloudBilling, with the following key concepts:
- Each table is uniquely named
- A “schema”, in the form of a set of column definitions, each consisting of:
- Long name: the actual name of the column, used to refer to it and for display purposes
- Short name: an internal name for the column, of limited length
- Type: the type of data in the column (such as String, Date, or Numeric)
- Index: a list of indexes. For each added index an index will be created in the underlying database. Columns that have the index specified will be members of this index. Indices are important for improving the performance over larger tables, but adding too many indices can harm performance. If you’re not sure how this function works or your tables are not very large (> 100.000 entries), you probably won’t need to fill in this field.
- Optional: a Time To Live (TTL) column and an accompanying length (in days).
Once a table has been added, it can be filled with data. This is done by adding rows to it, by defining a value for each column. The data in these tables can then be used in expressions on your rules. See Price Rules for more information on this subject.
Only columns of type Date can be specified as TTL columns. When a table has a TTL column specified and a TTL length of, e.g., 4 (days), it means that as soon as the date specified in this column for a given row is more than 4 days in the past, the row is removed from the table. This mechanism can be used to keep tables that are frequently or automatically added to, small and relevant.