The next-generation caching layer for PHP.

Relay is a Redis™ client like PhpRedis and Predis, except two orders of magnitude faster.

Sign up to follow the development or request early access.

Cutting-edge app or legacy codebase, supercharge anything.

Laravel
Symfony
WordPress
Statamic
Magento

Active invalidation

There’s one hard problem in computer science.

Relay is a PHP extension that is both a Redis™ client and a shared in-memory cache. Think APCu and PhpRedis having a child — but with magic powers.

It uses server-assisted client side caching to actively invalidate its in-memory cache and 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;
    }
});

Resource efficient

Outrageously fast, easy on gas.

Relay maintains a highly-efficient, partial copy of Redis’ data in the PHP master process’ memory.

It handles millions of requests per second without breaking a sweat, while also reducing network communication with Redis™ to a bare minimum — saving you resources, bandwidth and money.

Seamless integration

A drop-in replacement for PhpRedis.

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

No blocking calls

Asynchronous, multi-threaded & lock-free.

Redis’ biggest breaking point is its single-threaded nature. Replication and clustering can mitigate this, but they add serious complexity and costs.

Relay removes that bottleneck and provides a concurrent and lock-free API.

<?php

$relay = new Relay(host: '127.0.0.1', port: 6379);

// By default all calls are synchronous.
$users = $relay->mget('post:1', 'post:2', 'post:3');

// Asynchronous, non-blocking calls are as easy as:
$relay->async()
    ->mget(
        'post:1', 'post:2', 'post:3'
    )->then(function ($posts) {
        //
    })->catch(function (Throwable $exception) {
        //
    });

Designed for scale

Built with shared environments in mind.

Relay was designed considering the needs of hosting companies and infrastructure providers alike. By allowing you to set memory limits per prefix, database or user, Relay automatically evicts keys using LRU and LFU policies.

Pricing

Start building for free, upgrade to go live.

Hobby

Free

Coming soon
  • Unlimited workers
  • Community support
  • Limited to 32 MB memory

Business

$297 /month

Coming soon
  • 32 workers included
  • Email support
  • No memory limits
  • $24 per extra 8 workers

Enterprise

Ask for Quote

Request a quote
  • Unlimited workers
  • Email & Slack support
  • No memory limits
  • Advanced feature set
  • Engineer led onboarding