FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Next.js job board: reliable scrapes with pg locks
How-ToWeb Development

Next.js job board: reliable scrapes with pg locks

via Dev.to WebdevSathish1mo ago

I stopped duplicate cron runs with Postgres advisory locks. I moved “job already exists” into one SQL upsert. I rate-limit per source, not globally. I keep Next.js out of the scraping path entirely. Context I’m building a job board for Psychiatric Mental Health Nurse Practitioners. Next.js 14 on Vercel. Supabase (Postgres) behind it. The board has 8,000+ active listings across 2,000+ companies. I scrape 200+ jobs daily from multiple sources. My first version was naive. A Vercel Cron hit an API route. The route scraped. Then wrote rows. It worked… until it didn’t. One day I had 3 copies of the same job. Another day I missed an entire source. Brutal. The core issue wasn’t “scraping is hard”. It was “cron is not a single threaded program”. Retries happen. Overlaps happen. Two regions happen. And “check-then-insert” is a race. So I rebuilt the pipeline around the database. Postgres decides what runs. Postgres decides what’s new. 1) I don’t trust cron. I make Postgres gate it. Vercel Cron i

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
34 views

Related Articles

Building an MCP Server for Your Own Tools
How-To

Building an MCP Server for Your Own Tools

Medium Programming • 5d ago

[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One
How-To

[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One

Medium Programming • 5d ago

RHAPSODY OF REALITIES - 26TH MARCH 2026
"In Nehemiah’s day, as the people built the wall of…
How-To

RHAPSODY OF REALITIES - 26TH MARCH 2026 "In Nehemiah’s day, as the people built the wall of…

Medium Programming • 5d ago

How to Actually Make Money with a "Free" App
How-To

How to Actually Make Money with a "Free" App

Medium Programming • 5d ago

How-To

Building a Runtime with QuickJS

Lobsters • 5d ago

Discover More Articles