PolyScale.ai Self Hosted consists of a single downloadable component named the Private Cache Endpoint (PCE). The PCE can be downloaded and started in a single command, yielding a fully automated database cache engine. No configuration, no code to write.
The PCE component can be thought of as a proxy cache that sits between any application connecting to the database, and the database itself. Database traffic is inspected and automatically cached based on PolyScale’s automated caching protocol.
AI Cache Control Plane
The PCE communicates with regional and global control planes to manage the cache behavior. This is done over a secure network connection using a single outbound port (see the install guide for full details. All data sent to the control plane is anonymised - for example, any SQL queries have query parameters stripped.
The control planes also process multi-region invalidations (when mutations/DML are detected), removing the overhead of this layer from the deployment.
For large installations, it is also possible to self host the control plane components. Contact us for more details.
Memory Requirements & Data Storage
The PCE utilizes memory mapping to store cached data both in memory and on disk. When cache entries are read and written, PolyScale does this from memory, and lets the Linux kernel decide what memory pages will be loaded from disk based on demand and the current memory pressure. The Linux kernel will at all times, by design, try to utilize as much RAM as it can to keep the content of the cached entries in memory. The more available RAM, the more cache entries will be readily available to be served without even touching the disk. For example:
- If there is enough RAM to store the whole working set of a database, the cache will always be served from memory, and never from disk.
- At the other extreme, if there is no RAM available at all, the cache entries will be served from the disk all the time.
Most use cases fall somewhere between those two extremes.
CPU and Memory Example
To provide a real-world usage example, a PCE sustaining 100 queries per second, uses 33% of a single Intel Xeon 8375C (Ice Lake) 3.5 GHz CPU. 300MB of memory is used by the PCE after startup and additionally any memory used by the working set i.e. the cache data.
The PCE does not yet support Connection Pooling for PostgreSQL; support will be added in the near future.