relay.so

Active invalidation

Relay is a PHP extension that is both a Redis™ client and a shared in-memory cache, collapsing the boundary between APCu and PhpRedis into a single primitive.

It uses server-assisted client-side caching to actively invalidate its in-memory cache and optionally informs you about invalidations, so your app can update its runtime cache mid-request.

<?php
$relay = new Relay(host: '127.0.0.1', port: 6379);
// Fetch the user count from Relay’s memory,
// or from Redis if the key has not been cached, yet.
$users = $relay->get('users:count');
// Listen to all invalidation events.
$relay->onInvalidated(function (Relay\Event $event) use ($users) {
    if ($event->key === 'users:count') {
        $users = null;
    }
});

Built for scale

Relay maintains a highly efficient, partial replica of Redis’ data in the PHP master process’ memory — handling millions of requests per second while cutting network communication with Redis™ to a bare minimum. That saves you resources, bandwidth, and money.

Redis’ breaking point is its single-threaded nature, often forcing complex and unnecessary replication or clustering. Relay’s multi-threaded, lock-free architecture removes that bottleneck, letting every PHP worker access data concurrently without blocking.

Seamless integration

Relay can easily be integrated with most existing apps, websites and e-commerce stores — no code changes necessary.

Advanced integrations for Laravel, WordPress, Magento, Drupal and many other platforms are ready to go.

Relay is a modern rewrite — everything from cluster replica failover to session locking has been rethought, and modern features like AZ affinity routing land the moment they ship.

Adaptive caching

Caching everything is a recipe for thrashing — one-off reads evict the keys your app actually needs. Relay can observe access patterns and decide what’s worth keeping in its in-memory cache, automatically.

The result is a cache that stays warm under realistic, skewed workloads — especially impactful for chaotic apps like WordPress, where a small slice of keys absorbs the bulk of reads.

Relay is free to use — forever. Upgrade for more memory.

  • Unlimited vCPUs
  • Community support
  • Limited to 64 MB
  • 8 vCPUs included
  • Email support
  • No memory limits
  • $2/mo per extra vCPU

Enterprise

Ask for Quote

Request a quote

  • Reduced vCPU pricing
  • SLA & Slack support
  • Engineer-led onboarding
  • Payment via invoice

Follow us on Bluesky, join our Discord or send us an email.

Sign up to follow Relay’s development and receive special offers.

Read the original on relay.so ↗