<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Package Cache on Porch Documentation</title><link>/docs/5_architecture_and_components/package-cache/</link><description>Recent content in Package Cache on Porch Documentation</description><generator>Hugo</generator><language>en-us</language><atom:link href="/docs/5_architecture_and_components/package-cache/index.xml" rel="self" type="application/rss+xml"/><item><title>Cache Design</title><link>/docs/5_architecture_and_components/package-cache/design/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/package-cache/design/</guid><description>&lt;h2 id="cache-interface"&gt;Cache Interface&lt;a class="td-heading-self-link" href="#cache-interface" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Package Cache provides a unified interface that abstracts the underlying storage mechanism. Both the CR Cache and DB Cache implementations conform to this common interface, allowing the CaDEngine to work with either implementation without knowing which is in use.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Repository Operations:&lt;/strong&gt; Open repository connections from Repository CR specifications, close repositories and clean up resources, retrieve list of all open repositories, get specific repository by key, update repository metadata, and check repository connectivity.&lt;/p&gt;</description></item><item><title>Custom Resource Cache</title><link>/docs/5_architecture_and_components/package-cache/cr-cache/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/package-cache/cr-cache/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="td-heading-self-link" href="#overview" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Custom Resource (CR) Cache&lt;/strong&gt; is the default cache implementation in Porch. It stores package metadata using Kubernetes Custom Resources while keeping repository data in memory. This implementation is designed for standard Porch deployments where Kubernetes &lt;code&gt;etcd&lt;/code&gt; provides sufficient storage and performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt; The CR Cache is the default implementation when no cache type is explicitly configured. It uses hybrid storage (an in-memory repository cache plus CR-based metadata storage) and is RDBMS-independent: no RDBMS such as PostgreSQL is required, because it leverages the Kubernetes API, &lt;code&gt;etcd&lt;/code&gt;, and Git for persistence. It is suitable for small to medium deployments with moderate package counts and has no external dependencies beyond a Kubernetes cluster. It interacts with Git at every stage of the package revision lifecycle for persistence.&lt;/p&gt;</description></item><item><title>Database Cache</title><link>/docs/5_architecture_and_components/package-cache/db-cache/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/package-cache/db-cache/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="td-heading-self-link" href="#overview" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Database (DB) Cache&lt;/strong&gt; is an alternative cache implementation in Porch designed for larger deployments. It stores both package metadata and repository data in a PostgreSQL database rather than in memory or Kubernetes Custom Resources. This implementation provides better scalability and persistence characteristics for production environments with high package counts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt; The DB Cache is the alternative implementation, used when it is explicitly configured with database connection details. All repository, package, and package revision data is stored in PostgreSQL, which requires an external PostgreSQL database instance. It is suitable for large deployments with thousands of packages and package revisions, and it survives Porch server restarts without re-fetching from Git. By default, it interacts with Git only during publish and sync (pull). With &lt;code&gt;--db-push-drafts-to-git&lt;/code&gt;, draft and proposed revisions are also pushed to Git during the sync.&lt;/p&gt;</description></item><item><title>Cache Interactions</title><link>/docs/5_architecture_and_components/package-cache/interactions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/package-cache/interactions/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="td-heading-self-link" href="#overview" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Package Cache acts as an intermediary layer that coordinates between the CaDEngine, Repository Adapters, and external Git repositories. It provides caching, synchronization, and change notification services while maintaining a clean separation of concerns.&lt;/p&gt;
&lt;h3 id="high-level-architecture"&gt;High-Level Architecture&lt;a class="td-heading-self-link" href="#high-level-architecture" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐
│ Package Cache Layer │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────┐ │
│ │ CaDEngine │ ───&amp;gt; │ Cache │ ───&amp;gt; │ Repo │ │
│ │ Requests │ │ Operations │ │Adapt │ │
│ │ │ │ │ │ ers │ │
│ └──────────────┘ └──────────────┘ └──────┘ │
│ ↑ │ │ │
│ │ ↓ ↓ │
│ │ ┌──────────────┐ ┌──────┐ │
│ └──────────────│ Watcher │ │ Git │ │
│ │ Notifier │ │Repos │ │
│ └──────────────┘ └──────┘ │
└─────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="repository-adapter-integration"&gt;Repository Adapter Integration&lt;a class="td-heading-self-link" href="#repository-adapter-integration" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The cache wraps repository adapters to provide caching and synchronization services:&lt;/p&gt;</description></item></channel></rss>