<?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">Cache Interface&lt;/h2>&lt;p>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>
&lt;p>&lt;strong>Repository Operations:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Open repository connections from Repository CR specifications&lt;/li>
&lt;li>Close repositories and clean up resources&lt;/li>
&lt;li>Retrieve list of all open repositories&lt;/li>
&lt;li>Get specific repository by key&lt;/li>
&lt;li>Update repository metadata&lt;/li>
&lt;li>Check repository connectivity&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Repository Interface Delegation:&lt;/strong>&lt;/p></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">Overview&lt;/h2>&lt;p>The &lt;strong>Custom Resource (CR) Cache&lt;/strong> is the default cache implementation in Porch. It stores package metadata using a Kubernetes Custom Resources while keeping repository data in memory. This implementation is designed for standard Porch deployments where Kubernetes &lt;code>etcd&lt;/code> provides sufficient storage and performance.&lt;/p>
&lt;p>&lt;strong>Key characteristics:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Default implementation&lt;/strong>: Used when no cache type is explicitly configured&lt;/li>
&lt;li>&lt;strong>Hybrid storage&lt;/strong>: In-memory repository cache + CR-based metadata storage&lt;/li>
&lt;li>&lt;strong>RDBMS-independent&lt;/strong>: No RDBMS (such as Posgres) required, leverages the Kubernetes API, &lt;code>etcd&lt;/code>, and Git for persistence&lt;/li>
&lt;li>&lt;strong>Suitable for&lt;/strong>: Small to medium deployments with moderate package counts&lt;/li>
&lt;li>&lt;strong>No external dependencies&lt;/strong>: Only requires a Kubernetes cluster&lt;/li>
&lt;li>&lt;strong>Git interaction&lt;/strong>: Interacts with Git at every stage of package revision lifecycle for presistence&lt;/li>
&lt;/ul>
&lt;h2 id="implementation-details">Implementation Details&lt;/h2>&lt;h3 id="storage-architecture">Storage Architecture&lt;/h3>&lt;p>The CR Cache uses a two-tier storage model:&lt;/p></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">Overview&lt;/h2>&lt;p>The &lt;strong>Database (DB) Cache&lt;/strong> 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>
&lt;p>&lt;strong>Key characteristics:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Alternative implementation&lt;/strong>: Used when explicitly configured with database connection details&lt;/li>
&lt;li>&lt;strong>Database-backed storage&lt;/strong>: All repository, package, and package revision data stored in PostgreSQL&lt;/li>
&lt;li>&lt;strong>External dependency&lt;/strong>: Requires PostgreSQL database instance&lt;/li>
&lt;li>&lt;strong>Suitable for&lt;/strong>: Large deployments with thousands of packages and package revisions&lt;/li>
&lt;li>&lt;strong>Better persistence&lt;/strong>: Survives Porch server restarts without re-fetching from Git&lt;/li>
&lt;li>&lt;strong>Git interaction&lt;/strong>: By default, interacts with Git only during approval/publish and sync operations. Configurable with &lt;code>--db-push-drafts-to-git&lt;/code> flag to push drafts&lt;/li>
&lt;/ul>
&lt;h2 id="implementation-details">Implementation Details&lt;/h2>&lt;h3 id="storage-architecture">Storage Architecture&lt;/h3>&lt;p>The DB Cache uses a database-centric storage model:&lt;/p></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">Overview&lt;/h2>&lt;p>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>
&lt;h3 id="high-level-architecture">High-Level Architecture&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">┌─────────────────────────────────────────────────────────┐
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ Package Cache Layer │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ ┌──────────────┐ ┌──────────────┐ ┌──────┐ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ CaDEngine │ ───&amp;gt; │ Cache │ ───&amp;gt; │ Repo │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ Requests │ │ Operations │ │Adapt │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ │ │ │ │ ers │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────────┘ └──────────────┘ └──────┘ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ ↑ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ ↓ ↓ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ ┌──────────────┐ ┌──────┐ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────────│ Watcher │ │ Git │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ Notifier │ │Repos │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────────┘ └──────┘ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">└─────────────────────────────────────────────────────────┘
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="repository-adapter-integration">Repository Adapter Integration&lt;/h2>&lt;p>The cache wraps repository adapters to provide caching and synchronization services:&lt;/p></description></item></channel></rss>