sopherapps / pydantic-redis

A simple Declarative ORM for Redis using pydantic Models
https://sopherapps.github.io/pydantic-redis
MIT License
39 stars 14 forks source link

Optimize select() by removing multiple network requests especially for nested models #15

Closed Tinitto closed 1 year ago

Tinitto commented 1 year ago

When doing a Model.select() call, any nested models in the model will mean that package does extra network calls to eagerly load the nested models.

orredis sidesteps this altogether by using lua scripts that are run on the redis server itself such that a single request is made, and any nested models are eagerly loaded on the redis server itself before the results are returned.

See example code It is in rust though.