Redis - davidkhala/database GitHub Wiki

  • Share nothing
  • Multi process

Redis Functions

Redis Functions is an API for managing code to be executed on the server. (Stored Procedure)

Also, they are intended to better support the use case of maintaining a consistent view for data entities through a logical schema

  • supersedes the use of EVAL in prior versions of Redis.
  • available in Redis 7
  • The core use case is executing part of your application logic inside Redis, efficiently and atomically.
  • Every function belongs to a single library. The library's contents are immutable, and selective updates of its functions aren't allowed. Instead, libraries are updated as a whole with all of their functions together in one operation.
  • A function's execution blocks all server activities during its entire time, similarly to the semantics of transactions. so you should avoid using long-running functions.

Limit

  • 在单台机器上运行集群,只是为了能够使用超过1个core。

what's wrong with Eval Scripts?

  • Using EVAL requires that the application sends the entire script for execution every time
  • The underlying assumption is that scripts are a part of the application and not maintained by the Redis server.