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

Blog
GitHub Logo

Happy Thanksgiving! Here is an AI-Coded Harper Game for Your Day Off

Discover how Harper’s unified application platform and AI-first development tools make it possible for anyone—even non-developers—to build and deploy real apps. In this Thanksgiving story, follow the journey of creating a fun Pac-Man-style game using Google’s Antigravity IDE, Gemini, Claude, and Harper’s open-source templates. Learn how Harper simplifies backend development, accelerates AI-driven coding, and unlocks creativity with seamless deployment on Harper Fabric. Play the game and experience the power of Harper for modern app development.
Blog
Discover how Harper’s unified application platform and AI-first development tools make it possible for anyone—even non-developers—to build and deploy real apps. In this Thanksgiving story, follow the journey of creating a fun Pac-Man-style game using Google’s Antigravity IDE, Gemini, Claude, and Harper’s open-source templates. Learn how Harper simplifies backend development, accelerates AI-driven coding, and unlocks creativity with seamless deployment on Harper Fabric. Play the game and experience the power of Harper for modern app development.
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
Blog

Happy Thanksgiving! Here is an AI-Coded Harper Game for Your Day Off

Discover how Harper’s unified application platform and AI-first development tools make it possible for anyone—even non-developers—to build and deploy real apps. In this Thanksgiving story, follow the journey of creating a fun Pac-Man-style game using Google’s Antigravity IDE, Gemini, Claude, and Harper’s open-source templates. Learn how Harper simplifies backend development, accelerates AI-driven coding, and unlocks creativity with seamless deployment on Harper Fabric. Play the game and experience the power of Harper for modern app development.
Aleks Haugom
Nov 2025
Blog

Happy Thanksgiving! Here is an AI-Coded Harper Game for Your Day Off

Discover how Harper’s unified application platform and AI-first development tools make it possible for anyone—even non-developers—to build and deploy real apps. In this Thanksgiving story, follow the journey of creating a fun Pac-Man-style game using Google’s Antigravity IDE, Gemini, Claude, and Harper’s open-source templates. Learn how Harper simplifies backend development, accelerates AI-driven coding, and unlocks creativity with seamless deployment on Harper Fabric. Play the game and experience the power of Harper for modern app development.
Aleks Haugom
Blog

Happy Thanksgiving! Here is an AI-Coded Harper Game for Your Day Off

Discover how Harper’s unified application platform and AI-first development tools make it possible for anyone—even non-developers—to build and deploy real apps. In this Thanksgiving story, follow the journey of creating a fun Pac-Man-style game using Google’s Antigravity IDE, Gemini, Claude, and Harper’s open-source templates. Learn how Harper simplifies backend development, accelerates AI-driven coding, and unlocks creativity with seamless deployment on Harper Fabric. Play the game and experience the power of Harper for modern app development.
Aleks Haugom
Blog
GitHub Logo

Pub/Sub for AI: The New Requirements for Real-Time Data

Harper’s unified pub/sub architecture delivers real-time data, low-latency replication, and multi-protocol streaming for AI and edge applications. Learn how database-native MQTT, WebSockets, and SSE replace legacy brokers and pipelines, enabling millisecond decisions, resilient edge deployments, and globally consistent state for next-generation intelligent systems.
A.I.
Blog
Harper’s unified pub/sub architecture delivers real-time data, low-latency replication, and multi-protocol streaming for AI and edge applications. Learn how database-native MQTT, WebSockets, and SSE replace legacy brokers and pipelines, enabling millisecond decisions, resilient edge deployments, and globally consistent state for next-generation intelligent systems.
A man with short dark hair, glasses, and a goatee smiles slightly, wearing a black shirt in front of a nature background.
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
Blog

Pub/Sub for AI: The New Requirements for Real-Time Data

Harper’s unified pub/sub architecture delivers real-time data, low-latency replication, and multi-protocol streaming for AI and edge applications. Learn how database-native MQTT, WebSockets, and SSE replace legacy brokers and pipelines, enabling millisecond decisions, resilient edge deployments, and globally consistent state for next-generation intelligent systems.
Ivan R. Judson, Ph.D.
Nov 2025
Blog

Pub/Sub for AI: The New Requirements for Real-Time Data

Harper’s unified pub/sub architecture delivers real-time data, low-latency replication, and multi-protocol streaming for AI and edge applications. Learn how database-native MQTT, WebSockets, and SSE replace legacy brokers and pipelines, enabling millisecond decisions, resilient edge deployments, and globally consistent state for next-generation intelligent systems.
Ivan R. Judson, Ph.D.
Blog

Pub/Sub for AI: The New Requirements for Real-Time Data

Harper’s unified pub/sub architecture delivers real-time data, low-latency replication, and multi-protocol streaming for AI and edge applications. Learn how database-native MQTT, WebSockets, and SSE replace legacy brokers and pipelines, enabling millisecond decisions, resilient edge deployments, and globally consistent state for next-generation intelligent systems.
Ivan R. Judson, Ph.D.
Blog
GitHub Logo

Deliver Performance and Simplicity with Distributed Microliths

Distributed microliths unify data, logic, and execution into one high-performance runtime, eliminating microservice latency and complexity. By replicating a single coherent process across regions, they deliver sub-millisecond responses, active-active resilience, and edge-level speed. Platforms like Harper prove this model reduces infrastructure, simplifies operations, and scales globally with ease.
System Design
Blog
Distributed microliths unify data, logic, and execution into one high-performance runtime, eliminating microservice latency and complexity. By replicating a single coherent process across regions, they deliver sub-millisecond responses, active-active resilience, and edge-level speed. Platforms like Harper prove this model reduces infrastructure, simplifies operations, and scales globally with ease.
A man with short dark hair, glasses, and a goatee smiles slightly, wearing a black shirt in front of a nature background.
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
Blog

Deliver Performance and Simplicity with Distributed Microliths

Distributed microliths unify data, logic, and execution into one high-performance runtime, eliminating microservice latency and complexity. By replicating a single coherent process across regions, they deliver sub-millisecond responses, active-active resilience, and edge-level speed. Platforms like Harper prove this model reduces infrastructure, simplifies operations, and scales globally with ease.
Ivan R. Judson, Ph.D.
Nov 2025
Blog

Deliver Performance and Simplicity with Distributed Microliths

Distributed microliths unify data, logic, and execution into one high-performance runtime, eliminating microservice latency and complexity. By replicating a single coherent process across regions, they deliver sub-millisecond responses, active-active resilience, and edge-level speed. Platforms like Harper prove this model reduces infrastructure, simplifies operations, and scales globally with ease.
Ivan R. Judson, Ph.D.
Blog

Deliver Performance and Simplicity with Distributed Microliths

Distributed microliths unify data, logic, and execution into one high-performance runtime, eliminating microservice latency and complexity. By replicating a single coherent process across regions, they deliver sub-millisecond responses, active-active resilience, and edge-level speed. Platforms like Harper prove this model reduces infrastructure, simplifies operations, and scales globally with ease.
Ivan R. Judson, Ph.D.