Skip to content

Redis distributed cache does not need to use Lua #54685

Closed
@mgravell

Description

@mgravell

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

The Redis implementation of IDistributedCache uses Lua for the "set" path; this means it doesn't work without Lua. Lua is Redis v3+, but this gap impacts things like Garnet, which acts as a Redis-ish (¿Redish?) server (on top of FASTER). See microsoft/garnet#85

Upon analysis, the current code does not actually seem to use Lua usefully - it looks like this can be replaced with either MULTI/EXEC or just F+F pipeline.

In addition to increasing backend compatibility, this would be more efficient:

  • no need to SCRIPT LOAD
  • no need to absorb the overheads of the current ad-hoc/script command API ("known" commands use a more efficient path, and have array arguments)
  • no need for the server to initialize and execute the Lua runtime each time

Describe the solution you'd like

System works without Lua

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresfeature-cachingIncludes: StackExchangeRedis and SqlServer distributed caches

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions