26.1 LPC

LPC stands for Lightweight Persistent Cache. It’s the easiest way to use key-value DB in Artanis.

For example:

(get "/certain_rule" #:lpc <backend> (lambda (rc) ...))

The backend includes:

After configured, it’s easy to use it:

;; Setter
(:lpc rc 'set <key> <val>)

;; Getter
(:lpc rc 'get <key>)
;; or
(:lpc rc 'ref <key>)

In default, the key will be prefixed automatically:

(string-append "__artanis_lpc_" (get-conf '(db name)) "_" key)