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

Tutorial
GitHub Logo

Real-Time Pub/Sub Without the Stack

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Harper Learn
Tutorial
Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
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
Tutorial

Real-Time Pub/Sub Without the Stack

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
Jan 2026
Tutorial

Real-Time Pub/Sub Without the Stack

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
Tutorial

Real-Time Pub/Sub Without the Stack

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
News
GitHub Logo

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Announcement
News
Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Colorful geometric illustration of a dog's head resembling folded paper art in shades of teal and pink.
Harper
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
Jan 2026
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
Comparison
GitHub Logo

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Comparison
A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
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
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Dec 2025
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Tutorial
GitHub Logo

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Harper Learn
Tutorial
Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
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
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Dec 2025
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Podcast
GitHub Logo

Turn Browsing into Buying with Edge AI

Discover how Harper’s latest features streamline development, boost performance, and simplify integration. This technical showcase breaks down real-world workflows, powerful updates, and practical tips for building faster, smarter applications.
Select*
Podcast
Discover how Harper’s latest features streamline development, boost performance, and simplify integration. This technical showcase breaks down real-world workflows, powerful updates, and practical tips for building faster, smarter applications.
Person with short hair wearing a light blue patterned shirt, smiling widely outdoors with blurred greenery and trees in the background.
Austin Akers
Head of Developer Relations
Podcast

Turn Browsing into Buying with Edge AI

Discover how Harper’s latest features streamline development, boost performance, and simplify integration. This technical showcase breaks down real-world workflows, powerful updates, and practical tips for building faster, smarter applications.
Austin Akers
Dec 2025
Podcast

Turn Browsing into Buying with Edge AI

Discover how Harper’s latest features streamline development, boost performance, and simplify integration. This technical showcase breaks down real-world workflows, powerful updates, and practical tips for building faster, smarter applications.
Austin Akers
Podcast

Turn Browsing into Buying with Edge AI

Discover how Harper’s latest features streamline development, boost performance, and simplify integration. This technical showcase breaks down real-world workflows, powerful updates, and practical tips for building faster, smarter applications.
Austin Akers