npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fantasticfour/world-mysql-redis

v1.6.0

Published

Hybrid World implementation using MySQL for durable storage with Redis Lists for queue management

Downloads

437

Readme

@fantasticfour/world-mysql-redis

Hybrid world implementation combining MySQL for durable storage with Redis Lists for high-performance queue management.

Features

  • Storage: MySQL with Drizzle ORM + CBOR serialization
  • Queue: Redis Lists with BRPOPLPUSH (sub-10ms latency)
  • Streaming: MySQL polling at 100ms intervals
  • Performance: 100+ jobs/sec with default 10 workers
  • Compatibility: Works with PlanetScale, AWS RDS, Aiven MySQL, and any Redis provider

Installation

pnpm add @fantasticfour/world-mysql-redis

Quick Start

1. Set up environment variables

WORKFLOW_MYSQL_URL="mysql://user:pass@host:3306/database"
WORKFLOW_REDIS_URL="redis://localhost:6379"

2. Initialize database schema

pnpm world-mysql-redis-setup

Or programmatically:

import { sql } from '@fantasticfour/world-mysql-redis/cli';
await sql(); // Runs migrations

3. Create and use the world

import { createWorld } from '@fantasticfour/world-mysql-redis';

const world = createWorld({
  databaseUrl: process.env.WORKFLOW_MYSQL_URL,
  redis: process.env.WORKFLOW_REDIS_URL,
  queueConcurrency: 10, // Number of workers per queue
  jobPrefix: 'workflow_', // Redis key prefix
});

await world.start();

Configuration

interface MysqlRedisWorldConfig {
  databaseUrl: string; // MySQL connection string
  redis: string | RedisOptions; // Redis connection string or options
  jobPrefix?: string; // Redis key prefix (default: 'workflow_')
  queueConcurrency?: number; // Workers per queue (default: 10)
  deploymentId?: string; // Optional deployment tracking ID
  httpTimeoutMs?: number; // Per-job dispatch timeout (default: 300_000)
  visibilityTimeoutMs?: number; // Lease before an in-flight item is requeued (default: httpTimeoutMs + 30_000); must be an integer >= httpTimeoutMs, else a RangeError is thrown at startup
}

Performance Characteristics

  • Queue Latency: <10ms p95 (Redis BRPOPLPUSH)
  • Throughput: 100+ jobs/sec with 10 workers
  • Storage: MySQL provider-dependent (20-200ms)
  • Streaming: 100ms polling interval

Use Cases

  • Cost-effective alternative to PostgreSQL + Redis
  • Existing MySQL infrastructure with need for fast queueing
  • Multi-region deployments with MySQL read replicas
  • Teams already comfortable with MySQL

Migration from Other Worlds

From world-postgres-redis

Replace PostgreSQL with MySQL - the queue layer is identical (Redis Lists).

From world-upstash

Replace QStash HTTP queue with Redis Lists for 10-20x lower latency.

Database Schema

The world creates the following tables:

  • workflow.workflow_runs - Workflow execution state
  • workflow.workflow_events - Event sourcing
  • workflow.workflow_steps - Step execution tracking
  • workflow.workflow_hooks - Webhook/callback management
  • workflow.workflow_stream_chunks - Streaming data

All tables use CBOR serialization for efficient binary storage with JSON fallback for compatibility.

Requirements

  • MySQL 8.0.13+ (functional indexes and window functions are required by the schema migrations)
  • Redis 3.2+
  • Node.js 18+

License

Apache-2.0