<?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;div class="alert alert-warning" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;Deprecated&lt;/div&gt;
&lt;p&gt;The CR Cache will be removed in a future Porch release. Use the 
&lt;a href="/docs/5_architecture_and_components/package-cache/db-cache/"&gt;Database Cache&lt;/a&gt; with v1alpha2 PackageRevision CRDs instead. See the 
&lt;a href="/docs/5_architecture_and_components/controllers/packagerevision-controller/"&gt;PackageRevision Controller&lt;/a&gt; for the CRD-based architecture.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;strong&gt;Custom Resource (CR) Cache&lt;/strong&gt; is deprecated. It is currently the default, and the default will change to the Database Cache.&lt;/p&gt;
&lt;h2 id="implementation-details"&gt;Implementation Details&lt;a class="td-heading-self-link" href="#implementation-details" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="storage-architecture"&gt;Storage Architecture&lt;a class="td-heading-self-link" href="#storage-architecture" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The CR Cache uses a two-tier storage model:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;In-Memory Layer
 │
 ├─ Repository connections
 ├─ Package revisions (cached)
 ├─ Package metadata (cached)
 └─ Repository version tracking
 ↓
Persistent Layer (Kubernetes)
 │
 └─ PackageRev CRs (metadata only)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;In-Memory Storage:&lt;/strong&gt; The in-memory layer holds repository instances and connections, cached package revisions from Git, package metadata (names, paths, revisions), the repository version used for change detection, and latest-revision tracking per package.&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>