Redis



Repository cache in Laravel

  • avatar
  • 9.0K Views
  • 2 Likes
  • 11 mins read
Repository cache in Laravel

In modern web applications, optimizing data retrieval is crucial to improving performance and user experience. One common practice is caching database queries to reduce redundant calls to the database. While Laravel offers built-in caching features, in some cases, you may want to implement custom repository caching manually to better control your caching mechanism. This article will walk you through implementing repository caching in Laravel 12, explaining the steps involved and how to achieve better performance in your application.

Setting up MySQL and Redis with Docker Compose

  • avatar
  • 9.0K Views
  • 1 Like
  • 6 mins read
Setting up MySQL and Redis with Docker Compose

Docker has transformed the way developers deploy applications, offering an efficient method to package and distribute software. One common use case involves setting up a MySQL database alongside a Redis service. MySQL serves as a reliable relational database management system, while Redis acts as a high-performance in-memory key-value store. With Docker and Docker Compose, you can get both of these services up and connected in just a few steps. This article will guide you through creating a Docker environment that includes MySQL and Redis, giving you a smooth and reliable setup.

Repository cache in Symfony

  • avatar
  • 5.9K Views
  • 11 mins read
Repository cache in Symfony

In today's data-driven world, efficient data management is paramount for any modern web application. Symfony, a popular PHP framework, provides developers with powerful tools and patterns to streamline data handling. Two key components that play a pivotal role in enhancing data management within Symfony applications are the Repository Pattern and Data Caching. In this article, we'll delve into these concepts, exploring how they work together to boost performance and simplify data access in Symfony projects.

 Join Our Monthly Newsletter

Get the latest news and popular articles to your inbox every month

We never send SPAM nor unsolicited emails

Tag-based cache inside Laravel repositories

Available to Premium members only
  • avatar
  • 3.8K Views
  • 12 mins read
Tag-based cache inside Laravel repositories

Working with cache can drastically improve the performance of an application, especially when dealing with data that doesn't change too often. While Laravel provides solid support for caching through multiple drivers, it doesn't offer native support for cache tags. To work around this limitation, we'll integrate Symfony's Cache component, which brings tag support and fits well into the repository pattern we've already established. In this article, we'll build on the existing structure and focus on using cache tags to group and clear related data more efficiently.

How to install and configure Redis on Ubuntu

  • avatar
  • 3.8K Views
  • 7 mins read
How to install and configure Redis on Ubuntu

Redis is an open-source in-memory key-value data store. It can be used as a database, cache, message broker and supports various data structures such as Strings, Hashes, Lists, Sets, etc... Apart from its performance and flexibility, Redis stands out with its wide language support, high availability, and automatic partitioning.

How to track online users with Redis

  • avatar
  • 1.2K Views
  • 11 mins read
How to track online users with Redis

The number of people using a website right now is a common metric. It shows how active the site is at a given moment, and it makes traffic visible while it happens instead of after the fact. Analytics services can report it, but with a delay and outside the application. Redis can keep it inside your own code: each page view records the visitor, and the count is read for the last X minutes, where X is a value from the configuration file that can be changed at any time.

HyperLogLog for counting unique elements with fixed memory

  • avatar
  • 308 Views
  • 12 mins read
HyperLogLog for counting unique elements with fixed memory

Counting unique visitors sounds like a small task until the numbers grow. Every distinct ID has to be remembered, every new visit needs a check against the ones already seen and memory keeps rising with each new person. HyperLogLog is an algorithm that skips the remembering. It estimates how many different items went through a stream while keeping a few kilobytes of state and in return it accepts a small error that can be measured in advance.