<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hugo Francisco on Medium]]></title>
        <description><![CDATA[Stories by Hugo Francisco on Medium]]></description>
        <link>https://medium.com/@hugo.amxd?source=rss-49bf1bf35920------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*N8MkOPXWLPtqsdGom6ppJA.png</url>
            <title>Stories by Hugo Francisco on Medium</title>
            <link>https://medium.com/@hugo.amxd?source=rss-49bf1bf35920------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:28:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hugo.amxd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond the Toggle: The Cache Awakens in OutSystems]]></title>
            <link>https://medium.com/peaceful-evolution/beyond-the-toggle-the-cache-awakens-in-outsystems-3c96486506eb?source=rss-49bf1bf35920------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c96486506eb</guid>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[outsystems]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[outsystems-development]]></category>
            <dc:creator><![CDATA[Hugo Francisco]]></dc:creator>
            <pubDate>Fri, 08 May 2026 08:31:51 GMT</pubDate>
            <atom:updated>2026-05-08T08:31:51.872Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This article covers caching architecture in OutSystems applications, from native caching to database-backed snapshots and distributed cache strategies. The focus is on how to choose the right caching approach for each type of data, instead of treating </em><em>Cache in Minutes as a universal solution. Although the examples are specific to OutSystems, the principles apply broadly to any platform where performance, consistency, and scalability need to be balanced.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxRigpkEbIksh_ipEvjxgA.png" /></figure><h4><strong>Introduction</strong></h4><p>OutSystems makes it easy to build fast applications early.</p><p>A few Aggregates, clean screens, a small data model — and everything feels responsive. But as the application grows, that simplicity starts to hide a harder reality: more joins, more calculations, more users, more records and, eventually, <strong>slower screens.</strong></p><p>At that point, many teams reach for the familiar fix: Cache in Minutes.</p><p>It helps. But… <strong>“This is not the architecture you’re looking for”</strong>.</p><p>High-performance OutSystems applications are not built by “turning cache on”. <strong>They are built by deciding what data must be real-time, what can be reused, what should be precomputed, and what must be shared across runtime instances</strong>.</p><p>That is where caching becomes a design decision, not a toggle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncV9pLrXkU_CZjCOOcu9Iw.png" /></figure><h4>First rule: don’t cache a bad query</h4><p>Caching a bad query may feel like a shortcut. It usually leads to the dark side.</p><p>If an Aggregate is slow because it pulls or joins too much data, or runs too often, caching may hide the problem for a while — but it does not solve it.</p><p>Before adding any cache layer, fix the basics:</p><ul><li>Fetch less data</li><li>Add the right indexes</li><li>Paginate large lists</li></ul><p>Remove queries inside loops</p><ul><li>Move expensive calculations out of the request path</li><li>Precompute when necessary</li></ul><blockquote><strong>Rules of thumb:</strong></blockquote><blockquote>Optimize first. Cache second. There are no Jedi mind tricks for bad data access.</blockquote><blockquote>Caching should amplify a healthy design and not compensate for a weak one.</blockquote><blockquote>Think in layers, not in features.</blockquote><p>Most OutSystems applications don’t need one cache strategy.</p><p>They need the <strong>right strategy for each type of data</strong>.</p><p>There is no single cache strategy for every use case. Different data needs different caching decisions. <strong>“This is the way.”</strong></p><p><strong>1. Real-time queries</strong></p><p>Use Aggregates or SQL when data must be fresh, transactional, or strongly consistent.</p><p><strong>2. Native OutSystems cache</strong></p><p>Best for small, stable, frequently reused data such as reference lists or configuration.</p><p><strong>3. Database-backed snapshots (Databags)</strong></p><p>Useful for complex views that are expensive to build on every request.</p><p><strong>4. Distributed cache (Redis)</strong></p><p>Useful for high-concurrency scenarios where multiple runtime instances need shared cached data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oh6LRRqBDx8SWytaHjFFPw.png" /></figure><h4>Native OutSystems cache: fast, simple, local</h4><p>OutSystems native cache is a useful lightsaber against slow reads, but it will not win every battle.</p><p>It works well for small, stable data such as country lists, categories, configuration, and lookup tables.</p><p>But native cache is stored locally on each OutSystems front-end.</p><p>So, in environments with multiple front-ends, one front-end may already have a value cached while another still needs to load it.</p><p>That is fine for data where local reuse is enough. For shared state that must be consistent across front-ends, use another strategy.</p><blockquote><strong>Rule of thumb:</strong></blockquote><blockquote>Use native cache to make repeated reads faster, not to manage shared state across front-ends.</blockquote><h4>Database-backed snapshots (DataBags)</h4><p>Some screens are expensive because they rebuild the Death Star every time they load.</p><p>Think dashboards, summary screens, or data combined from multiple sources.</p><p>In these cases, a useful pattern is to store a <strong>precomputed snapshot</strong> in a dedicated entity. Some teams call this a <strong>DataBag</strong> pattern.</p><p>Instead of rebuilding everything on every request, the application stores a ready-to-use payload plus metadata such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*-FZ64VfnddgSdZbKbUnr5g.png" /></figure><p>This is not just caching. It is closer to a <strong>read model</strong> optimized for the UI.</p><p>The key is to keep it separate from core business entities. Large serialized payloads do not belong mixed into transactional tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CL0pW1wFF5Rsr2XdK7iXzg.png" /></figure><h4>Avoid rebuilding the same snapshot</h4><p>When a snapshot expires, don’t send in a clone army of requests to rebuild it.</p><p>If 40 users open the same dashboard, only one request should mark the snapshot as Refreshing.</p><p>Everyone else should get the stale snapshot for a short grace period.</p><p>The refresh then runs in the background: Aggregates, Server Actions, or API calls rebuild the data, store the new snapshot, and clear the Refreshing flag.</p><p>Use GetForUpdate only for the quick “mark as refreshing” step.</p><p>Never keep that lock while doing the heavy work.</p><blockquote><strong>Rule of thumb:</strong></blockquote><blockquote>GetForUpdate should protect the Refreshing flag, not the Aggregates, Server Actions, or API calls.</blockquote><h4>Cache invalidation: know when to destroy the old snapshot</h4><p>A cache is only useful while the Force is still with it.</p><p>ExpiresAt helps, but time-based expiration is not always enough. Some data can wait a few minutes. Other data must be refreshed as soon as the source changes.</p><p>If a user updates an order, customer status, or dashboard-critical record, the related snapshot should not keep serving the old version until the TTL (Time To Live) runs out.</p><p>That is where invalidation comes in.</p><p>The application needs to know which cache keys are affected by a change, and then clear them, expire them, or mark them for refresh.</p><p>For DataBags, expose a small Server Action such as InvalidateSnapshot(CacheKey) or MarkSnapshotForRefresh(CacheKey). The module that changes the source data should call it after the update succeeds.</p><p>For native OutSystems cache, use platform cache invalidation when cached Aggregates, SQL queries, or Server Actions must be refreshed before their cache duration expires. Actions like EspaceInvalidateCache clear the cache at module level, so every cached element in that module is invalidated. That is useful for broad configuration or reference-data changes, but too heavy for one small data change.</p><p>Do not leave invalidation to luck.</p><blockquote><strong>Rule of thumb:</strong></blockquote><blockquote>TTL is a safety net, not the whole invalidation strategy.</blockquote><h4>Redis: shared cache for high traffic</h4><p>Redis helps when the whole fleet of OutSystems front-ends needs the same cached data quickly.</p><p>It fits public portals, APIs, booking flows, and other high-read areas where local cache is not enough.</p><p>But keep the payloads small.</p><p>Large cached objects still need to travel over the network and be deserialized by the app.</p><blockquote><strong>Rule of thumb:</strong></blockquote><blockquote>Do not cache the full record if the screen only needs one or two fields.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1vb5ClqSUfcjFxTAUMkcg.png" /></figure><h4>In ODC, shared state matters more</h4><p>In OutSystems Developer Cloud, runtime instances behave more like starfighters than planets: they can scale, restart, and move often.</p><p>That makes local cache less reliable as shared state.</p><p>So the distinction becomes more important:</p><ul><li>Use native cache for local optimization.</li><li>Use snapshots or Redis for shared reusable state.</li><li>Use real-time queries where correctness matters most.</li></ul><p><strong>The question is not “should we cache more?”</strong></p><p>It is:</p><p><strong>Which data can be local, which must be shared, and which should be precomputed?</strong></p><blockquote><strong>Rule of thumb:</strong></blockquote><blockquote>In ODC, keep local cache for disposable data. Use snapshots, Redis, or the database for state that must be shared across runtime instances.</blockquote><h4>Final thought</h4><p>Cache in Minutes is a useful optimization, but it should not be the whole architecture.</p><p>In a high-performance OutSystems application, each data access pattern needs a clear purpose.</p><p>Live queries are for data that must be current.</p><p>Native cache is for small, stable data that can be reused locally.</p><p>Snapshots are for expensive views that should be precomputed.</p><p>Distributed cache is for shared, high-read data across front-ends.</p><p>The performance model comes from choosing the right strategy for each case.</p><p>At small scale, most choices feel acceptable.</p><p>At large scale, there is no hiding from the architecture.</p><p><strong>“The Force is not in the toggle. It is in knowing when to use it.”</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c96486506eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peaceful-evolution/beyond-the-toggle-the-cache-awakens-in-outsystems-3c96486506eb">Beyond the Toggle: The Cache Awakens in OutSystems</a> was originally published in <a href="https://medium.com/peaceful-evolution">Peaceful Evolution</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>