Click Below to Get the Code

Browse, clone, and build from real-world templates powered by Harper.
Tutorial
GitHub Logo

Overview of Redirector Component

Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups, no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.
Tutorial

Overview of Redirector Component

By
Stephen Ludin
April 30, 2025
By
Stephen Ludin
April 30, 2025
By
Stephen Ludin
April 30, 2025
April 30, 2025
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups, no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.
Stephen Ludin
Chief Architect of Customer Delivery

When your URL map changes, every millisecond spent in a 404 costs rankings, revenue, and trust. The Harper Redirector lets you manage millions of redirects with 1 millisecond P95 lookups—without bolting on a separate database, cache, or edge worker. Below is a quick technical tour so you can clone the repo and start stress‑testing it today.

‍


Why a Dedicated Redirect Engine?

Scale

  • Legacy approach: Apache/Nginx conf files grow linearly and reload slowly.
  • Harper Redirector: Horizontally sharded tables; handling hundreds of millions of rules is routine. 

Latency

  • Legacy approach: Database lookups or client‑side JavaScript add extra round‑trips.
  • Harper Redirector: In‑memory index inside the Harper runtime delivers sub‑millisecond lookups

Ops

  • Legacy Approach: Redirects scattered across YAML files, CDN rules, and spreadsheets.
  • Harper Redirector: One CSV/JSON import or REST write—fully versioned and promotable in bulk. 

‍

Under the Hood

  • Smart matching – Host‑aware lookups, optional regex paths, and query‑string operations (qs:preserve, qs:filter) so one rule can handle thousands of permutations
  • Versioning – Flip activeVersion in the version table to atomically swap an entire redirect set—perfect for re‑platform launches. 

Metrics out of the box – Every hit is written to a metrics stream; drop it into Grafana or the Harper Analytics API for real‑time insight.

‍

3‑Step Local Spin‑Up

git clone https://github.com/HarperDB/template-redirector.git
cd template-redirector
harperdb dev .           # Hot‑reloads while you edit

Requires the Harper CLI (npm i -g harperdb).

The harperdb dev . command will automatically watch for file changes within the component directory and restart the Harper threads when changes are detected.

‍

Importing Rules

curl http://localhost:9926/redirect \
  --header "Content-Type: text/csv" \
  --data-binary @redirects.csv

Fields include path, redirectURL, optional utcStartTime/EndTime, and regex flag. JSON is equally accepted.

Need a blue‑green cut‑over? Add version=1 to your CSV and promote it later:

PUT /version
{ "activeVersion": 1 }

‍

Fast Lookup API

GET /checkredirect?path=/shoe-sale&h=www.shop.com&ho=1

Returns {statusCode:301, redirectURL:"/sneakers"} from server in ~ 1ms. Parameters let you override host, version, or testing time, and you can push paths via the Path header to preserve query strings exactly.

‍

Edge or Origin? You Choose

Because Harper runs identically on a single VM, a Kubernetes cluster, or geo‑distributed edge nodes, you can:

  1. Centralize at the origin for simple architectures.
  2. Fan‑out to edge instances (or have your CDN call the /checkredirect API) for single‑digit‑ms global round‑trips.

Either way, scaling up is literally adding another Harper node—no extra services to wire.

‍

Deploying to Dev, Staging, Prod

harperdb deploy_component \
  project=redirector \
  package=https://github.com/HarperDB/template-redirector \
  target=prod.mydomain.io \
  username=$USER password=$PASS \
  restart=true replicated=true

The CLI packages the repo (or pulls from npm/GitHub), ships it to the remote instance with rolling restarts for zero downtime.

‍

Ready to Test It Yourself?

‍

The redirect problem is solved; now you can get back to building features. Happy routing!

‍

When your URL map changes, every millisecond spent in a 404 costs rankings, revenue, and trust. The Harper Redirector lets you manage millions of redirects with 1 millisecond P95 lookups—without bolting on a separate database, cache, or edge worker. Below is a quick technical tour so you can clone the repo and start stress‑testing it today.

‍


Why a Dedicated Redirect Engine?

Scale

  • Legacy approach: Apache/Nginx conf files grow linearly and reload slowly.
  • Harper Redirector: Horizontally sharded tables; handling hundreds of millions of rules is routine. 

Latency

  • Legacy approach: Database lookups or client‑side JavaScript add extra round‑trips.
  • Harper Redirector: In‑memory index inside the Harper runtime delivers sub‑millisecond lookups

Ops

  • Legacy Approach: Redirects scattered across YAML files, CDN rules, and spreadsheets.
  • Harper Redirector: One CSV/JSON import or REST write—fully versioned and promotable in bulk. 

‍

Under the Hood

  • Smart matching – Host‑aware lookups, optional regex paths, and query‑string operations (qs:preserve, qs:filter) so one rule can handle thousands of permutations
  • Versioning – Flip activeVersion in the version table to atomically swap an entire redirect set—perfect for re‑platform launches. 

Metrics out of the box – Every hit is written to a metrics stream; drop it into Grafana or the Harper Analytics API for real‑time insight.

‍

3‑Step Local Spin‑Up

git clone https://github.com/HarperDB/template-redirector.git
cd template-redirector
harperdb dev .           # Hot‑reloads while you edit

Requires the Harper CLI (npm i -g harperdb).

The harperdb dev . command will automatically watch for file changes within the component directory and restart the Harper threads when changes are detected.

‍

Importing Rules

curl http://localhost:9926/redirect \
  --header "Content-Type: text/csv" \
  --data-binary @redirects.csv

Fields include path, redirectURL, optional utcStartTime/EndTime, and regex flag. JSON is equally accepted.

Need a blue‑green cut‑over? Add version=1 to your CSV and promote it later:

PUT /version
{ "activeVersion": 1 }

‍

Fast Lookup API

GET /checkredirect?path=/shoe-sale&h=www.shop.com&ho=1

Returns {statusCode:301, redirectURL:"/sneakers"} from server in ~ 1ms. Parameters let you override host, version, or testing time, and you can push paths via the Path header to preserve query strings exactly.

‍

Edge or Origin? You Choose

Because Harper runs identically on a single VM, a Kubernetes cluster, or geo‑distributed edge nodes, you can:

  1. Centralize at the origin for simple architectures.
  2. Fan‑out to edge instances (or have your CDN call the /checkredirect API) for single‑digit‑ms global round‑trips.

Either way, scaling up is literally adding another Harper node—no extra services to wire.

‍

Deploying to Dev, Staging, Prod

harperdb deploy_component \
  project=redirector \
  package=https://github.com/HarperDB/template-redirector \
  target=prod.mydomain.io \
  username=$USER password=$PASS \
  restart=true replicated=true

The CLI packages the repo (or pulls from npm/GitHub), ships it to the remote instance with rolling restarts for zero downtime.

‍

Ready to Test It Yourself?

‍

The redirect problem is solved; now you can get back to building features. Happy routing!

‍

Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups, no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups, no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups, no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right

Explore Recent Resources

Solution
GitHub Logo

Enterprise Agentic Development with Harper

Enterprise Agentic Development with Harper enables coding agents to build and deploy production-ready applications without backend wiring. A unified runtime combines database, cache, APIs, messaging, and global deployment into one seamless, enterprise-proven platform.
Solution
Enterprise Agentic Development with Harper enables coding agents to build and deploy production-ready applications without backend wiring. A unified runtime combines database, cache, APIs, messaging, and global deployment into one seamless, enterprise-proven platform.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM & Marketing
Solution

Enterprise Agentic Development with Harper

Enterprise Agentic Development with Harper enables coding agents to build and deploy production-ready applications without backend wiring. A unified runtime combines database, cache, APIs, messaging, and global deployment into one seamless, enterprise-proven platform.
Aleks Haugom
Feb 2026
Solution

Enterprise Agentic Development with Harper

Enterprise Agentic Development with Harper enables coding agents to build and deploy production-ready applications without backend wiring. A unified runtime combines database, cache, APIs, messaging, and global deployment into one seamless, enterprise-proven platform.
Aleks Haugom
Solution

Enterprise Agentic Development with Harper

Enterprise Agentic Development with Harper enables coding agents to build and deploy production-ready applications without backend wiring. A unified runtime combines database, cache, APIs, messaging, and global deployment into one seamless, enterprise-proven platform.
Aleks Haugom
Tutorial
GitHub Logo

In 3 Days I Built an AI Ops Assistant That Replaced $2,400/month in SaaS

Learn how to build a lightweight AI ops assistant in just three days that consolidates tools, automates incident workflows, and delivers real-time answers in Slack, all while cutting thousands in monthly SaaS costs. This practical breakdown covers the stack, architecture, and cost savings behind a smarter approach to AI-driven automation and SaaS cost optimization.
Tutorial
Learn how to build a lightweight AI ops assistant in just three days that consolidates tools, automates incident workflows, and delivers real-time answers in Slack, all while cutting thousands in monthly SaaS costs. This practical breakdown covers the stack, architecture, and cost savings behind a smarter approach to AI-driven automation and SaaS cost optimization.
Professional headshot of smiling man with short gray hair and beard, wearing light button-down shirt against blue backdrop.
Stephen Goldberg
CEO & Co-Founder
Tutorial

In 3 Days I Built an AI Ops Assistant That Replaced $2,400/month in SaaS

Learn how to build a lightweight AI ops assistant in just three days that consolidates tools, automates incident workflows, and delivers real-time answers in Slack, all while cutting thousands in monthly SaaS costs. This practical breakdown covers the stack, architecture, and cost savings behind a smarter approach to AI-driven automation and SaaS cost optimization.
Stephen Goldberg
Feb 2026
Tutorial

In 3 Days I Built an AI Ops Assistant That Replaced $2,400/month in SaaS

Learn how to build a lightweight AI ops assistant in just three days that consolidates tools, automates incident workflows, and delivers real-time answers in Slack, all while cutting thousands in monthly SaaS costs. This practical breakdown covers the stack, architecture, and cost savings behind a smarter approach to AI-driven automation and SaaS cost optimization.
Stephen Goldberg
Tutorial

In 3 Days I Built an AI Ops Assistant That Replaced $2,400/month in SaaS

Learn how to build a lightweight AI ops assistant in just three days that consolidates tools, automates incident workflows, and delivers real-time answers in Slack, all while cutting thousands in monthly SaaS costs. This practical breakdown covers the stack, architecture, and cost savings behind a smarter approach to AI-driven automation and SaaS cost optimization.
Stephen Goldberg
Tutorial
GitHub Logo

How Claude Deploys My Apps to Harper Fabric

Learn how to use Claude Code to build and deploy apps to Harper Fabric using simple chat commands. This guide covers AI-assisted development, one-command deploys, live production updates, and how to streamline cloud infrastructure with an agentic coding workflow.
A.I.
Tutorial
Learn how to use Claude Code to build and deploy apps to Harper Fabric using simple chat commands. This guide covers AI-assisted development, one-command deploys, live production updates, and how to streamline cloud infrastructure with an agentic coding workflow.
Professional headshot of smiling man with short gray hair and beard, wearing light button-down shirt against blue backdrop.
Stephen Goldberg
CEO & Co-Founder
Tutorial

How Claude Deploys My Apps to Harper Fabric

Learn how to use Claude Code to build and deploy apps to Harper Fabric using simple chat commands. This guide covers AI-assisted development, one-command deploys, live production updates, and how to streamline cloud infrastructure with an agentic coding workflow.
Stephen Goldberg
Feb 2026
Tutorial

How Claude Deploys My Apps to Harper Fabric

Learn how to use Claude Code to build and deploy apps to Harper Fabric using simple chat commands. This guide covers AI-assisted development, one-command deploys, live production updates, and how to streamline cloud infrastructure with an agentic coding workflow.
Stephen Goldberg
Tutorial

How Claude Deploys My Apps to Harper Fabric

Learn how to use Claude Code to build and deploy apps to Harper Fabric using simple chat commands. This guide covers AI-assisted development, one-command deploys, live production updates, and how to streamline cloud infrastructure with an agentic coding workflow.
Stephen Goldberg