Piper Push Cache Documentation Download Samples Contact  

Groups

Piper Push Cache supports record groups. A record group is defined by a filter expression (more on expressions under the 'filter' help topic). Records can belong to at most one group. The group defines whether a record is stored in the cache, written to the change log, or store in a database (when database support is implemented). Groups have other characteristics as well. A group can limit the number of records in it or the time each record stays in the cache.

The group filter can also be an empty expression which matches any record. An empty filter should only be places as the last group in the groups configuration. When looking for a group that a record matches an empty filter matches all records so it must be the last group defined. If not it will be the last group by it's definition since it is a catch all.

Selection of a group is done by walking the configured groups in order until there is a match on the record. Once there is a match that is the group the record belongs to. Changes in the record can result in changes in the record group.

Group definitions are entered in the 'groups' element of the configuration JSON. The groups element must be a JSON array. Each element of the array must be a JSON object as illustrated.

{
    "groups": [
        {
            "label": "default",
            "filter": "",
            "max": 0,
            "ttl": 0,
            "write": false,
            "cache": true,
            "database": false
        }
    ]
}

The parameter descriptions are:

label An optional label for the group.
filter A filter expression. JSON records that pass the filter with a result of true are considered in the group and the rest of the parameters apply.
max The maximum number of records allowed in the group. Using a FIFO algorithm older records are removed when pushed out by new records.
ttl Not implemented yet but reserved for future versions. As records grow older they are removed when they pass the TTL threshhold which is in seconds since being added to the cache or modified.
write A flag that if true indicates the records should be written to the change log file. If the change log is not active then the changes are not written.
cache A flag indicating records in the group should be added to the cache.
database Not implemented yet but reserved for future versions.