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 replica 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.
Even with caching disabled Relay is up to twice as fast as PhpRedis.
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.
Advanced integrations for Laravel, WordPress, Magento, Drupal and many other platforms are ready to go.
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
Relay is free to use — forever. Upgrade for more memory.
- Unlimited vCPUs
- Community support
- Limited to 64 MB
- Fastest Redis client for PHP
- 8 vCPUs included
- Email support
- No memory limits
- $2/mo per extra vCPU
- Reduced vCPU pricing
- Slack & Phone support
- Advanced feature set
- Engineer led onboarding
- Payment via invoice/PO