<?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: PeekLaunch</title>
    <description>The latest articles on DEV Community by PeekLaunch (@peeklaunch).</description>
    <link>https://dev.to/peeklaunch</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%2F4174924%2F71b5c0f1-cca5-4e66-9145-c896517054ca.png</url>
      <title>DEV Community: PeekLaunch</title>
      <link>https://dev.to/peeklaunch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peeklaunch"/>
    <language>en</language>
    <item>
      <title>Database Backups for a Small SaaS: A Simple Plan You Will Actually Test</title>
      <dc:creator>PeekLaunch</dc:creator>
      <pubDate>Mon, 02 Nov 2026 06:32:44 +0000</pubDate>
      <link>https://dev.to/peeklaunch/database-backups-for-a-small-saas-a-simple-plan-you-will-actually-test-592g</link>
      <guid>https://dev.to/peeklaunch/database-backups-for-a-small-saas-a-simple-plan-you-will-actually-test-592g</guid>
      <description>&lt;p&gt;Most small SaaS teams think they have backups. Fewer have ever restored one. A backup you have never restored is a guess, not a plan. Here is a simple setup for a small app with one main database, written for founders and web developers who want to sleep well without building a whole ops team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with two questions
&lt;/h2&gt;

&lt;p&gt;Before you pick any tool, answer these in plain words:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How much data can I lose?&lt;/strong&gt; If the database died right now, would losing the last 24 hours be fine, or would losing one hour already hurt your users?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How long can the app be down?&lt;/strong&gt; Ten minutes, one hour, or one day?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your answers decide how often you back up and how fast your restore needs to be. A weekend side project and a paid B2B app will answer very differently, and that is fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know what your host already does
&lt;/h2&gt;

&lt;p&gt;If you use a managed database, it may already take automatic backups. Open the settings page and check three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How often backups run&lt;/li&gt;
&lt;li&gt;How many days they are kept&lt;/li&gt;
&lt;li&gt;Whether you can restore to a point in time, or only to a daily snapshot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Write the answers down in your project notes. Many people assume they have point in time restore and find out on a bad day that they only had a daily snapshot, or that old backups were removed after a short time on their plan.&lt;/p&gt;

&lt;p&gt;Even with good host backups, keep one extra copy that you control. If your account gets locked, your billing fails, or someone deletes the whole project by mistake, the host backups can go with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple extra copy with pg_dump
&lt;/h2&gt;

&lt;p&gt;If you use Postgres, a nightly logical dump is a good second layer. It is slow for huge databases, but for most early SaaS apps it is perfect.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# custom format, compressed, easy to restore selectively&lt;/span&gt;
pg_dump &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;custom &lt;span class="nt"&gt;--no-owner&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"backup_&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y%m%d&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;.dump"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DATABASE_URL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then copy the file somewhere outside your main provider, like object storage in a different account. Keep a small rotation, for example the last 7 daily files and the last 4 weekly files. Old files should be cleaned up by a rule, not by memory.&lt;/p&gt;

&lt;p&gt;A few habits that save pain later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encrypt the file&lt;/strong&gt; before it leaves the server if it contains user data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never commit dumps&lt;/strong&gt; to your git repo, even a private one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store the credentials&lt;/strong&gt; for the backup bucket separately from your app credentials, so one leaked key does not expose both.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The part everyone skips: the restore test
&lt;/h2&gt;

&lt;p&gt;Once a month, put a short reminder in your calendar and do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# create an empty scratch database, then restore into it&lt;/span&gt;
createdb restore_test
pg_restore &lt;span class="nt"&gt;--no-owner&lt;/span&gt; &lt;span class="nt"&gt;--dbname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;restore_test backup_20261101.dump
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then check that the restore actually makes sense:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Count rows in your most important tables and compare with production&lt;/li&gt;
&lt;li&gt;Open the newest record and make sure it is from the time you expect&lt;/li&gt;
&lt;li&gt;Point a local copy of your app at the restored database and log in as a test user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Time the whole thing. If the restore takes two hours and you said you can only be down for thirty minutes, you just learned something important on a calm day instead of during an outage.&lt;/p&gt;

&lt;p&gt;Drop the scratch database when you are done so you do not leave a copy of user data lying around.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write a one page runbook
&lt;/h2&gt;

&lt;p&gt;When something breaks, you will be stressed and tired. Write a short page now that answers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where the backups live and how to reach them&lt;/li&gt;
&lt;li&gt;The exact commands to restore&lt;/li&gt;
&lt;li&gt;Who has access, and what to do if that person is not around&lt;/li&gt;
&lt;li&gt;How to tell users what happened&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep it next to your code, in plain text. A runbook that lives only in your head is not much help to anyone else on the team, or to you at 3 AM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backups do not replace care
&lt;/h2&gt;

&lt;p&gt;Backups protect you after a mistake. A few small habits stop many mistakes from happening at all:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run destructive migrations on a copy of production data first&lt;/li&gt;
&lt;li&gt;Use a read only database user for analytics and admin dashboards&lt;/li&gt;
&lt;li&gt;Turn on deletion protection if your host offers it&lt;/li&gt;
&lt;li&gt;Be careful with scripts that run &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;UPDATE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A quick checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I know how much data I can afford to lose&lt;/li&gt;
&lt;li&gt;I know what my host backs up and for how long&lt;/li&gt;
&lt;li&gt;I keep one extra copy in a place I control&lt;/li&gt;
&lt;li&gt;I restored a backup in the last 30 days and timed it&lt;/li&gt;
&lt;li&gt;My runbook is written down where the team can find it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this needs fancy tools. It needs one evening to set up and thirty minutes a month to test. That is a small price for knowing your users' data will still be there tomorrow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by the team behind &lt;a href="https://peeklaunch.com" rel="noopener noreferrer"&gt;PeekLaunch&lt;/a&gt;, a weekly launch board for SaaS makers.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>webdev</category>
      <category>database</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why Your SaaS Emails Land in Spam (and How to Fix SPF, DKIM and DMARC)</title>
      <dc:creator>PeekLaunch</dc:creator>
      <pubDate>Fri, 30 Oct 2026 01:13:00 +0000</pubDate>
      <link>https://dev.to/peeklaunch/why-your-saas-emails-land-in-spam-and-how-to-fix-spf-dkim-and-dmarc-4h93</link>
      <guid>https://dev.to/peeklaunch/why-your-saas-emails-land-in-spam-and-how-to-fix-spf-dkim-and-dmarc-4h93</guid>
      <description>&lt;p&gt;You ship your signup flow. You test it. The welcome email arrives... in the spam folder. Your password reset emails do the same. Users think your app is broken, and some never come back.&lt;/p&gt;

&lt;p&gt;This is one of the most common problems in a new SaaS, and it is almost never about your email text. It is about &lt;strong&gt;who your email says it is from, and whether the receiving server can prove it.&lt;/strong&gt; This guide walks through the fix in plain English.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real reason emails go to spam
&lt;/h2&gt;

&lt;p&gt;Gmail, Outlook and Yahoo ask three simple questions about every email:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is this server allowed to send for this domain? (SPF)&lt;/li&gt;
&lt;li&gt;Was this email signed by the domain, and was it changed on the way? (DKIM)&lt;/li&gt;
&lt;li&gt;What does the domain owner want me to do if the first two checks fail? (DMARC)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you send from a free address like &lt;code&gt;yourapp@gmail.com&lt;/code&gt; through some other tool, or from your own domain without these records, the answers are "no", "no" and "no idea". So the email lands in spam, no matter how nice the content is.&lt;/p&gt;

&lt;p&gt;Since 2024, Gmail and Yahoo also require bulk senders to have SPF, DKIM and DMARC set up. Even if you only send a few hundred emails a day, it is smart to follow the same rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Send from your own domain
&lt;/h2&gt;

&lt;p&gt;Stop sending app emails from a free Gmail or Outlook address. Use your own domain, for example &lt;code&gt;hello@yourapp.com&lt;/code&gt; or &lt;code&gt;no-reply@yourapp.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A good pattern is to use a &lt;strong&gt;subdomain for sending&lt;/strong&gt;, like &lt;code&gt;send.yourapp.com&lt;/code&gt; or &lt;code&gt;mail.yourapp.com&lt;/code&gt;. This keeps your main domain's reputation safe, and it means you don't have to touch the SPF record that your normal inbox or email forwarding already uses.&lt;/p&gt;

&lt;p&gt;Most email APIs (Resend, Postmark, Amazon SES, Mailgun and others) will ask you to add your domain and then show you the exact DNS records to add.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add SPF
&lt;/h2&gt;

&lt;p&gt;SPF is a TXT record that lists who may send email for a domain. It looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host:  send.yourapp.com
Type:  TXT
Value: v=spf1 include:amazonses.com ~all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few rules people often miss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Only one SPF record per host.&lt;/strong&gt; If you already have one, merge the &lt;code&gt;include:&lt;/code&gt; parts into it. Two SPF records on the same host make both invalid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay under 10 DNS lookups.&lt;/strong&gt; Every &lt;code&gt;include:&lt;/code&gt; counts. Too many and SPF fails.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~all&lt;/code&gt; (soft fail) is a safe start. Move to &lt;code&gt;-all&lt;/code&gt; later if you are sure every sender is listed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Add DKIM
&lt;/h2&gt;

&lt;p&gt;DKIM adds a digital signature to every email. Your provider holds the private key, and you publish the public key in DNS. It usually looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host:  resend._domainkey.yourapp.com
Type:  TXT
Value: p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The host name part before &lt;code&gt;._domainkey&lt;/code&gt; is called the selector. Copy it exactly from your provider. Don't add your domain twice: many DNS panels add &lt;code&gt;yourapp.com&lt;/code&gt; for you, so you would only type &lt;code&gt;resend._domainkey&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add DMARC
&lt;/h2&gt;

&lt;p&gt;DMARC ties SPF and DKIM together and tells receivers what to do when checks fail. Start gentle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host:  _dmarc.yourapp.com
Type:  TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p=none&lt;/code&gt; means "just report, don't block". Good for the first few weeks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rua=&lt;/code&gt; is where daily reports go. Use an address you can read, or a free DMARC report tool.&lt;/li&gt;
&lt;li&gt;Once reports show your real emails pass, move to &lt;code&gt;p=quarantine&lt;/code&gt;, and later &lt;code&gt;p=reject&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: Check alignment
&lt;/h2&gt;

&lt;p&gt;This is the part that confuses most people. DMARC passes only if the domain in your &lt;strong&gt;From&lt;/strong&gt; address matches the domain that passed SPF or DKIM.&lt;/p&gt;

&lt;p&gt;For example, if your From is &lt;code&gt;hello@yourapp.com&lt;/code&gt; and DKIM is signed by &lt;code&gt;yourapp.com&lt;/code&gt;, you are aligned. If DKIM is signed by &lt;code&gt;someprovider.com&lt;/code&gt; instead, DMARC can still fail. Setting up DKIM on your own domain (Step 3) fixes this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Use Reply-To for real replies
&lt;/h2&gt;

&lt;p&gt;Many founders want emails to come from &lt;code&gt;hello@yourapp.com&lt;/code&gt; but replies to go to their personal inbox. You don't need a full mailbox for that. Set the &lt;strong&gt;Reply-To&lt;/strong&gt; header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;resend&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;emails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YourApp &amp;lt;hello@yourapp.com&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;replyTo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;founder@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Welcome to YourApp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hi! Thanks for signing up. Reply to this email if you get stuck.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most email APIs have a similar &lt;code&gt;reply_to&lt;/code&gt; option. The From domain stays authenticated, and replies still reach you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Test before real users see it
&lt;/h2&gt;

&lt;p&gt;Don't guess. Test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send a test to a Gmail address, open it, and click &lt;strong&gt;Show original&lt;/strong&gt;. You want to see &lt;code&gt;SPF: PASS&lt;/code&gt;, &lt;code&gt;DKIM: PASS&lt;/code&gt; and &lt;code&gt;DMARC: PASS&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use a free checker like mail-tester.com to get a score and a list of problems.&lt;/li&gt;
&lt;li&gt;Check your DNS with &lt;code&gt;dig&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig TXT send.yourapp.com +short
dig TXT resend._domainkey.yourapp.com +short
dig TXT _dmarc.yourapp.com +short
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS changes can take from a few minutes to a few hours to show up. Wait before you panic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Content still matters a little
&lt;/h2&gt;

&lt;p&gt;Once authentication passes, content is the next thing to look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send a plain-text version along with HTML.&lt;/li&gt;
&lt;li&gt;Avoid huge images with very little text.&lt;/li&gt;
&lt;li&gt;Don't use link shorteners. Use links on your own domain.&lt;/li&gt;
&lt;li&gt;Keep the first emails to new domains small. Warm up slowly instead of sending 5,000 emails on day one.&lt;/li&gt;
&lt;li&gt;Add a clear unsubscribe link to any marketing or newsletter email.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Emails come from my own domain, not a free address&lt;/li&gt;
&lt;li&gt;[ ] Sending uses a subdomain like &lt;code&gt;send.yourapp.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] One SPF record per host, under 10 lookups&lt;/li&gt;
&lt;li&gt;[ ] DKIM record added with the exact selector from my provider&lt;/li&gt;
&lt;li&gt;[ ] DMARC record added, starting with &lt;code&gt;p=none&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] From domain aligns with the DKIM domain&lt;/li&gt;
&lt;li&gt;[ ] Reply-To points to an inbox I actually read&lt;/li&gt;
&lt;li&gt;[ ] Gmail "Show original" shows SPF, DKIM and DMARC all PASS&lt;/li&gt;
&lt;li&gt;[ ] Marketing emails have an unsubscribe link&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Spam-folder problems feel random, but they usually come down to three DNS records and one matching domain. Fix those once, test with a real inbox, and your welcome, reset and launch emails will start arriving where users can see them.&lt;/p&gt;

&lt;p&gt;If you are getting ready to launch and want a place to share your product with other makers, you can list it for free on &lt;a href="https://peeklaunch.com" rel="noopener noreferrer"&gt;PeekLaunch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>saas</category>
      <category>webdev</category>
      <category>email</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Pick a Tech Stack for Your First SaaS Without Overbuilding</title>
      <dc:creator>PeekLaunch</dc:creator>
      <pubDate>Fri, 23 Oct 2026 12:31:11 +0000</pubDate>
      <link>https://dev.to/peeklaunch/how-to-pick-a-tech-stack-for-your-first-saas-without-overbuilding-4h92</link>
      <guid>https://dev.to/peeklaunch/how-to-pick-a-tech-stack-for-your-first-saas-without-overbuilding-4h92</guid>
      <description>&lt;p&gt;Most first SaaS projects die from tool choice, not from bad ideas. You open ten tabs, compare frameworks, and two weekends later you still have no signup form. Here is a simple way to pick a &lt;strong&gt;first SaaS tech stack&lt;/strong&gt; that you can ship, maintain, and understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the product, not the framework
&lt;/h2&gt;

&lt;p&gt;Write three lines before you open docs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Who is the user?&lt;/li&gt;
&lt;li&gt;What is the one action they must complete?&lt;/li&gt;
&lt;li&gt;What must be true for that action to work (auth, payments, file upload, email)?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the answer is "a form, a database, and email," you do not need a microservices mesh. You need a boring stack that gets that path live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use four buckets, not forty tools
&lt;/h2&gt;

&lt;p&gt;Group decisions like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bucket&lt;/th&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Good default for a first SaaS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;App&lt;/td&gt;
&lt;td&gt;Where does UI + API live?&lt;/td&gt;
&lt;td&gt;One full-stack framework you already know&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;Where does state live?&lt;/td&gt;
&lt;td&gt;One managed Postgres (or SQLite while tiny)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auth&lt;/td&gt;
&lt;td&gt;How do users sign in?&lt;/td&gt;
&lt;td&gt;One auth library or hosted auth, not custom crypto&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ops&lt;/td&gt;
&lt;td&gt;How do you deploy and watch it?&lt;/td&gt;
&lt;td&gt;One host with preview deploys + basic logs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Everything else is optional until a real user asks for it. Caching layers, message queues, and multi-region setups can wait.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prefer "known" over "new"
&lt;/h2&gt;

&lt;p&gt;A stack you have shipped once beats a trendy stack you only read about. Speed to a working demo matters more than impressing other developers on Twitter. If you are strong in React, pick a React-friendly full-stack path. If you are strong in Rails or Django, stay there. First revenue rarely cares which logo is in your &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide with a one-week spike
&lt;/h2&gt;

&lt;p&gt;Give yourself five working evenings (or one focused weekend) and only build the core path:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up / log in&lt;/li&gt;
&lt;li&gt;Create the main object (project, doc, checklist, whatever your product is)&lt;/li&gt;
&lt;li&gt;Save it and load it again&lt;/li&gt;
&lt;li&gt;Send one transactional email&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you cannot finish that path in a week, the stack is too heavy for you &lt;em&gt;right now&lt;/em&gt;. Simplify and try again. Do not "just add" another service mid-spike.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to skip on purpose
&lt;/h2&gt;

&lt;p&gt;Skip these until you feel real pain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple databases "for scale"&lt;/li&gt;
&lt;li&gt;GraphQL when REST or server actions already work&lt;/li&gt;
&lt;li&gt;A design system with 80 components before you have 8 screens&lt;/li&gt;
&lt;li&gt;Kubernetes for a weekend project&lt;/li&gt;
&lt;li&gt;Building your own auth, billing, or email pipeline from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Paid, well-documented tools in those areas often save months. Overbuilding is usually unpaid work that never ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  A healthy "good enough" shape
&lt;/h2&gt;

&lt;p&gt;For many indie SaaS apps, this shape is enough for the first six months:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One web app (SSR or SPA + API in the same repo)&lt;/li&gt;
&lt;li&gt;One relational database&lt;/li&gt;
&lt;li&gt;File storage only if users upload files&lt;/li&gt;
&lt;li&gt;Stripe (or similar) when you charge money&lt;/li&gt;
&lt;li&gt;One error tracker and one analytics tool&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a &lt;strong&gt;first SaaS tech stack&lt;/strong&gt; you can explain in one sentence. If you cannot explain your stack in one sentence, you probably overbuilt it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Revisit after real users
&lt;/h2&gt;

&lt;p&gt;Change the stack when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A feature is blocked for more than a week by a missing capability&lt;/li&gt;
&lt;li&gt;Monthly cost or complexity is clearly hurting you&lt;/li&gt;
&lt;li&gt;You are hiring and the team cannot maintain what you chose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not rewrite because a conference talk made you feel behind. Shipping updates for real users beats a perfect rewrite that never leaves your laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist before you commit
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] I can name the core user action in one sentence&lt;/li&gt;
&lt;li&gt;[ ] I already know (or can learn in days) the main framework&lt;/li&gt;
&lt;li&gt;[ ] Auth and data are covered by one clear choice each&lt;/li&gt;
&lt;li&gt;[ ] Deploy takes under an hour to set up&lt;/li&gt;
&lt;li&gt;[ ] I can run the core path by the end of one spike week&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pick boring tools. Finish the path. Talk to users. Then upgrade the stack only when the product forces you to.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written for SaaS creators and web developers who want to ship, not collect frameworks.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Lessons from Building a Product Launch Platform with Next.js and Prisma</title>
      <dc:creator>PeekLaunch</dc:creator>
      <pubDate>Wed, 21 Oct 2026 18:23:59 +0000</pubDate>
      <link>https://dev.to/peeklaunch/lessons-from-building-a-product-launch-platform-with-nextjs-and-prisma-36co</link>
      <guid>https://dev.to/peeklaunch/lessons-from-building-a-product-launch-platform-with-nextjs-and-prisma-36co</guid>
      <description>&lt;p&gt;I've been working on &lt;a href="https://peeklaunch.com" rel="noopener noreferrer"&gt;PeekLaunch&lt;/a&gt;, a weekly launch board where makers submit a SaaS or AI tool, it goes live on that week's board, and other builders upvote, rate, and review it. On paper it's a simple CRUD app. In practice, a launch board is a caching puzzle. The pages are read constantly and need to be fast and crawlable, but votes and reviews change all the time and users expect to see their own action reflected immediately.&lt;/p&gt;

&lt;p&gt;Here are the lessons that cost me the most debugging time, using the Next.js App Router with Prisma on Postgres.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Cache the board, but tag it precisely
&lt;/h2&gt;

&lt;p&gt;The weekly board, product pages, and archives are perfect for static rendering with revalidation. They're read far more often than they change, and search engines love fast HTML.&lt;/p&gt;

&lt;p&gt;The mistake I made early was caching big chunks of data with no way to invalidate them selectively. The fix is to give cached data &lt;strong&gt;tags&lt;/strong&gt; that match your invalidation needs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// lib/queries.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;unstable_cache&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/cache&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/lib/prisma&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getWeeklyBoard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nf"&gt;unstable_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findMany&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;launchWeek&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;LIVE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;upvotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;desc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;select&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;tagline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;upvotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;board&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;board&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`board:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="na"&gt;revalidate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;)();&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getProduct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nf"&gt;unstable_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;product&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`product:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="na"&gt;revalidate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;)();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Newer Next.js versions also offer the &lt;code&gt;"use cache"&lt;/code&gt; directive with &lt;code&gt;cacheTag()&lt;/code&gt;. The idea is the same: tag what you cache, and invalidate by tag.)&lt;/p&gt;

&lt;p&gt;Tag granularity is a design decision. Think about which events should refresh which pages, and name the tags after those relationships.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;code&gt;revalidateTag&lt;/code&gt; vs &lt;code&gt;revalidatePath&lt;/code&gt;: pick the scalpel
&lt;/h2&gt;

&lt;p&gt;Both functions live in &lt;code&gt;next/cache&lt;/code&gt;, and both mark cached data as stale. They differ in &lt;em&gt;what&lt;/em&gt; they target:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://nextjs.org/docs/app/api-reference/functions/revalidateTag" rel="noopener noreferrer"&gt;&lt;code&gt;revalidateTag(tag)&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; invalidates every cached entry carrying that tag, wherever it's used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://nextjs.org/docs/app/api-reference/functions/revalidatePath" rel="noopener noreferrer"&gt;&lt;code&gt;revalidatePath(path, type?)&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; invalidates the cache for a route. &lt;code&gt;revalidatePath("/", "layout")&lt;/code&gt; effectively invalidates &lt;em&gt;everything&lt;/em&gt; under the root layout.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That layout-wide call is tempting because it "just works" in development. In production it means one comment causes every page on the site to re-render and every cached query to hit the database again. On a launch board with a burst of activity, that's how you take your own database down.&lt;/p&gt;

&lt;p&gt;Two rules I follow now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Call revalidation from &lt;strong&gt;Server Actions or Route Handlers&lt;/strong&gt;, not during rendering. Next.js doesn't allow revalidating while a page is being rendered, and it will throw.&lt;/li&gt;
&lt;li&gt;Prefer the narrowest tag that covers the change:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;revalidateTag&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/cache&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;approveProduct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;LIVE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nf"&gt;revalidateTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`product:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;revalidateTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`board:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;week&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the docs for the version you're on. The signatures and recommended helpers have shifted between major releases (recent versions add a cache-life argument to &lt;code&gt;revalidateTag&lt;/code&gt; and an &lt;code&gt;updateTag&lt;/code&gt; helper for read-your-own-writes in Server Actions).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Live upvotes: don't route every vote through the page cache
&lt;/h2&gt;

&lt;p&gt;Votes are the highest-frequency write on a launch board. If every upvote invalidates the board and the product page, your cache hit rate collapses on exactly the days that matter.&lt;/p&gt;

&lt;p&gt;What worked better was splitting the problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;cached page&lt;/strong&gt; renders the product and a vote count that may be a few minutes old. That's fine for crawlers and first paint.&lt;/li&gt;
&lt;li&gt;A small &lt;strong&gt;Route Handler&lt;/strong&gt; returns live, uncached numbers.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;client component&lt;/strong&gt; shows an optimistic update the instant the user clicks, then reconciles with the server.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/api/products/[slug]/votes/route.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/lib/prisma&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dynamic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;force-dynamic&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;select&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;upvotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;upvotes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;upvotes&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useOptimistic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useTransition&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;upvote&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./actions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;UpvoteButton&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initial&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;initial&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;addOptimistic&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useOptimistic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pending&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransition&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;
      &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pending&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="nf"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nf"&gt;addOptimistic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;upvote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// writes to DB, no layout-wide revalidation&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      ▲ &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Server Action records the vote (with a unique constraint on &lt;code&gt;userId + productId&lt;/code&gt;, so double clicks don't double count) and, at most, revalidates the one narrow tag it needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reuse the pattern.&lt;/strong&gt; The same pattern fixes reviews and comments. When a user submits a review, they expect to see it straight away. If the comment list comes from the ISR-cached page, they won't, and they'll assume it failed. Load the discussion from an uncached endpoint like &lt;code&gt;/api/products/[slug]/discussion&lt;/code&gt;, append the new comment optimistically, and return a clear success state from the action. Once I treated votes, reviews, and comments as the same "live island inside a cached page" problem, a whole class of "it saved but I can't see it" bugs disappeared.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Never change your schema at request time
&lt;/h2&gt;

&lt;p&gt;This one is embarrassing, but it's worth sharing. At one point a helper ensured some rating columns existed by running an &lt;code&gt;ALTER TABLE ... ADD COLUMN IF NOT EXISTS&lt;/code&gt; before certain queries, then calling &lt;code&gt;prisma.$disconnect()&lt;/code&gt;. It worked locally. In production, as soon as a cache change routed more traffic to live queries, requests began piling up behind the DDL and the connection churn, and pages hung.&lt;/p&gt;

&lt;p&gt;Lessons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schema changes belong in migrations&lt;/strong&gt;, run once at deploy time with &lt;a href="https://www.prisma.io/docs/orm/prisma-migrate" rel="noopener noreferrer"&gt;Prisma Migrate&lt;/a&gt; (&lt;code&gt;prisma migrate deploy&lt;/code&gt; in your build or release step), not inside request handlers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't &lt;code&gt;$disconnect()&lt;/code&gt; per request&lt;/strong&gt; in a long-lived or serverless Next.js process. Use a single shared client:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// lib/prisma.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@prisma/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;globalForPrisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;globalThis&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;globalForPrisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;globalForPrisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Put timeouts on anything that can block&lt;/strong&gt;, and use a connection pooler if you're on serverless Postgres.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be suspicious of fixes that change cache behavior.&lt;/strong&gt; Invalidating more aggressively doesn't just make data fresher. It moves load onto code paths that may never have been exercised under traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Treat SEO as a feature
&lt;/h2&gt;

&lt;p&gt;A launch platform only helps its makers if product pages are discoverable. A few things that matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every product gets a &lt;strong&gt;permanent, statically rendered page&lt;/strong&gt; with &lt;code&gt;generateMetadata&lt;/code&gt; for titles, descriptions, and Open Graph images.&lt;/li&gt;
&lt;li&gt;Archives of past weeks keep older launches reachable through internal links instead of dropping them off the site.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;sitemap.ts&lt;/code&gt; built from the database means new products are listed for crawlers as soon as they go live.&lt;/li&gt;
&lt;li&gt;Outbound links to makers' sites are plain, crawlable &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tags. JavaScript-only redirects are less reliable for crawlers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;The core lesson from building &lt;a href="https://peeklaunch.com" rel="noopener noreferrer"&gt;PeekLaunch&lt;/a&gt; is that a "simple" content site with social features is really two systems: a heavily cached, crawlable read layer and a small, live, uncached interaction layer. Keep them separate, connect them with narrow cache tags, and keep slow or risky operations like schema changes out of the request path entirely.&lt;/p&gt;

&lt;p&gt;If you're building something similar, I'd love to hear how you handle live counters on cached pages. Drop it in the comments.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>prisma</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
