LRU Cache (Least Recently Used) is the caching strategy where the item accessed longest ago is evicted when the cache is full. The naive O(n) implementation is too slow for tight loops. A proper O(1) implementation requires combining a doubly linked list (access order) with a hash map (O(1) lookup). I implement it from scratch in PHP and show how it maps to the per-request in-memory cache pattern used in Magento 2.

(more…)

Redis Streams is a data structure added in Redis 5.0 that combines the simplicity of a log with consumer groups and acknowledgement semantics. For Magento 2 it offers a robust alternative to RabbitMQ for message queuing: persistent messages, consumer groups, pending message redelivery, and dead letter handling – without the operational overhead of a dedicated AMQP broker.

(more…)

PHP 8.4 was officially released on 21 November 2024. After the RC months I had code ready to merge the day it went stable. A month in production gives me a clear picture of what property hooks look like in real module code, where asymmetric visibility is actually useful versus where it is overkill, and how BcMath\Number compares to the traditional bcmath functions in practice.

(more…)

PWA Studio, Hyvä, and Luma are the three main frontend options for Magento 2. Each represents a fundamentally different architecture and development model. Choosing the wrong one is an expensive mistake that is hard to reverse. I give an honest comparison including Total Cost of Ownership, not just technical features.

(more…)

TOP