DEV Community

Arshid
Arshid

Posted on

Zentropy for Laravel: The High-Performance Redis Alternative for Scalable Apps

Zentropy Laravel Cache

Boost your Laravel app's speed and simplicity with Zentropy, a lightweight Redis alternative. No more setup headaches.

What is Zentropy?

Zentropy is a high-performance key-value store that can be used as a replacement for Redis. It supports both TCP connections with optional authentication and Unix socket connections, providing maximum flexibility for developers.

With the Zentropy Laravel wrapper, you can integrate it seamlessly into your Laravel applications, using familiar Facade syntax or dependency injection.

Install Zentropy

  1. Download the latest release from the official GitHub repository:
    https://github.com/mailmug/zentropy/releases

  2. Extract the zip file for your operating system.

  3. Run the binary from your terminal:

    ./zentropy
    
  4. Run as a Service (Recommended for Production): For a production environment, you should configure it to run as a system service (e.g., using systemd on Linux) so it starts automatically on boot.

Getting Started with Zentropy Laravel

Install the package

composer require mailmug/zentropy-laravel
Enter fullscreen mode Exit fullscreen mode

Publish the Configuration

php artisan vendor:publish --provider="MailMug\ZentropyLaravel\ZentropyWrapperServiceProvider" --tag="config"
Enter fullscreen mode Exit fullscreen mode

Sample Controller

use MailMug\ZentropyLaravel\Facades\Zentropy;

class UserController extends Controller
{
    public function index(){
        Zentropy::set('users', User::get());
        // Set a value
        Zentropy::set('foo', 'bar');

        // Get a value
        $value = Zentropy::get('foo');

       // Delete a key
       Zentropy::delete('foo');


    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)