Technology restrictions

Edit on GitHub

Some actions, parts of the website, or the entire website are slow.

Cause

A possible cause is technology restriction.

Solution

Before using some technology, you need to understand all its advantages and disadvantages.

A good example is key-value storage (Redis or Valkey). It is fast, but if used incorrectly, it can lead to performance degradation. If we search against * or Wildkey in the key-value store (Redis or Valkey) with a large DB, we get the following results:

NewRelic—DB:

new-relic-db

NewRelic—Breakdown:

new-relic-breakdown

As you can see, the key-value store keys take most of the time. Therefore, they need optimization. You can optimize them by updating your functionality to use exact keys instead of *.

In the code, this would look similar to this line:

$this->storageClient->getKeys(self::RESOURCE . ':*');