Who’s the winner: Redis, Swoole Table, or Local Cache

Cerwyn Cahyono
4 min readMay 15, 2021
Photo by Stillness InMotion on Unsplash

Almost all web developers know what is Redis. Redis is used by many web applications because it has a great performance to store our data in key-value pair format. But not many developers are familiar with Swoole, especially when they’re not using PHP as their main language. What is Swoole? And how we compare it with the Redis?

High Performance Programmatic Server for PHP with Async IO, Coroutines and Fibers. https://www.swoole.co.uk

Swoole is a PHP package built with C, where it offers a lot of features. Especially with the asynchronous tasks. In traditional PHP, there’s no way we run the codes asynchronously. However, we can achieve that async tasks using Swoole, with the support of coroutines. And there are other features as well.

Another feature that Swoole supports is called Swoole Table. Swoole table has very great performance when it comes to read/write operations with key-value pairs into the table. It claims that the read/write speed is up to 2 million per second. That number is fantastic!

So in this article, I’ll do some simple benchmark/comparison for read/write operations between Redis, Swoole Table, and local cache. Because I’m a Laravel developer, I’ll use the Laravel framework to do all the…

--

--

Cerwyn Cahyono
Cerwyn Cahyono

Written by Cerwyn Cahyono

PHP/Backend Engineer at Undercurrent Capital Pte Ltd — Data Science Enthusiast

Responses (2)