<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rendi Eka</title>
    <description>The latest articles on DEV Community by Rendi Eka (@rendies).</description>
    <link>https://dev.to/rendies</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1740437%2F46e052f0-ec8a-483f-82ec-a137c1ba703b.png</url>
      <title>DEV Community: Rendi Eka</title>
      <link>https://dev.to/rendies</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rendies"/>
    <language>en</language>
    <item>
      <title>How We Serve Thousands of Bio-Link Page Views on a Single VPS (No Microservices Needed)</title>
      <dc:creator>Rendi Eka</dc:creator>
      <pubDate>Thu, 16 Jul 2026 12:49:36 +0000</pubDate>
      <link>https://dev.to/rendies/how-we-serve-thousands-of-bio-link-page-views-on-a-single-vps-no-microservices-needed-5hdc</link>
      <guid>https://dev.to/rendies/how-we-serve-thousands-of-bio-link-page-views-on-a-single-vps-no-microservices-needed-5hdc</guid>
      <description>&lt;h2&gt;
  
  
  How We Serve Thousands of Bio-Link Page Views on a Single VPS (No Microservices Needed)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fog59reyhrhdtapvhi0mg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fog59reyhrhdtapvhi0mg.webp" alt="How We Serve Thousands of Bio-Link Page Views on a Single VPS (No Microservices Needed" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bio-link pages (the "link in bio" mini-sites creators use) look simple on the surface — a static page with a few buttons. But they have a nasty traffic pattern: everything is fine, and then one creator posts a link on social media and your server gets hit with thousands of requests in a few minutes.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://trakk.id" rel="noopener noreferrer"&gt;Trakk.id&lt;/a&gt;, we run this feature (&lt;code&gt;trakk.id/l/:slug&lt;/code&gt;) on a single VPS — no Kubernetes cluster, no fleet of microservices. Here's the architecture that makes that possible, and the two problems we had to solve to get there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: two competing loads on every request
&lt;/h2&gt;

&lt;p&gt;Every page view actually creates two jobs for your backend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read load&lt;/strong&gt; — serve the HTML and static assets (profile photo, background) as fast as possible&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write load&lt;/strong&gt; — log the impression for the creator's analytics dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The naive approach — render the page on every request and write the impression straight to Postgres — works fine at low traffic and falls over exactly when you need it most: during a spike. Every request wakes up your app server, hits the database, and you end up with lock contention and rising latency right as a link goes viral.&lt;/p&gt;

&lt;p&gt;The fix was splitting the read path from the write path entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Serving: don't let requests touch the app server at all
&lt;/h2&gt;

&lt;p&gt;Instead of rendering bio-link pages dynamically on every request, we pre-render static HTML whenever a creator updates their page from the dashboard. Public traffic never touches our Node.js/Fastify backend — Nginx serves the cached HTML directly at the edge.&lt;/p&gt;

&lt;p&gt;Two consequences of this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;vCPU usage stays flat during spikes&lt;/strong&gt;, because there's no per-request rendering work happening.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-uploaded assets&lt;/strong&gt; (avatars, custom themes) live in S3-compatible object storage (we use IDCloudHost for data residency reasons), not on local disk — so large file I/O never competes with the app server either.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The API layer is the only thing that ever touches storage credentials; the public-facing serving path has zero access to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Analytics: stop writing to Postgres on every page view
&lt;/h2&gt;

&lt;p&gt;This was the more interesting problem. Impression tracking needs to be real-time-ish for the dashboard, but you can't afford a database write per visit when a page might get 50,000 views in five minutes.&lt;/p&gt;

&lt;p&gt;Our solution: &lt;strong&gt;in-memory counting + batched flushes.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page view → Redis INCR biolink:impression:{slug}   (&amp;lt; 1ms, no DB touch)

every 5 minutes:
cron worker → reads all counters from Redis
            → batch writes them to Postgres in one transaction
            → resets Redis counters to zero
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key insight: &lt;code&gt;INCR&lt;/code&gt; on a Redis key is O(1) and doesn't care whether it's the 1st or 50,000th increment in that window. Postgres only sees &lt;strong&gt;one write per slug per 5-minute window&lt;/strong&gt;, regardless of how many people actually visited. That's what keeps latency stable under load without needing to scale the database vertically.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick note on security at the edge
&lt;/h2&gt;

&lt;p&gt;Since these pages are rendered and served publicly, we set &lt;code&gt;X-Frame-Options: SAMEORIGIN&lt;/code&gt; on every response. It lets our own dashboard preview a creator's page in an iframe, but blocks any third-party site from embedding it — closing off a common clickjacking vector where an attacker overlays a disguised, clickable link on top of an iframed page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;You don't need a microservices cluster to hit enterprise-grade performance. What you need is to correctly identify which parts of your workload are read-heavy vs. write-heavy, and give each one an architecture suited to it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read path → pre-render + edge caching, so the app server barely wakes up&lt;/li&gt;
&lt;li&gt;Write path → in-memory counters + batch flush, so the database sees a fraction of the actual traffic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that split, a single well-configured VPS running Nginx + Node.js + Redis + Postgres held sub-50ms response times through traffic spikes that would have brought a naive setup down.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;We wrote up the full architecture — including the S3 asset isolation setup and more detail on the caching layer — in a technical whitepaper, &lt;a href="https://trakk.id/whitepaper" rel="noopener noreferrer"&gt;link here&lt;/a&gt;, if you want to go deeper.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Questions or pushback on any of these decisions? I'd love to hear how others have solved similar read/write splitting problems — drop a comment below.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>redis</category>
      <category>nginx</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
