Automattic / Automattic/mongoose

Populate integration with cache

Open
#2,068 7 comments 0 reactions 0 assignees View on GitHub
new feature plugin
Dominant language
JavaScript
Stars
27.5k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
35

Description

Correct me if I am wrong but I understood mongoose'e implementation for populate as a a direct db query everytime.

It would be super nice for mongoose to support caching for objects that are populated as a configurable option (let user incorporate their own caching implementation), because currently what I would do is get the object and manually populate any reference from the cache first (then hit db if not in cache). I am not so comfortable with using the populate feature, although it is super convenient, because the extra read it incurs each time.

tldr: Does mongoose currently have caching layer support for populate feature? Or any suggestions?

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by tracing Mongoose's populate implementation and existing documentation to determine whether populate performs a database query each time and whether a user-provided cache extension point exists. Done requires a settled scope for configurable caching, with the supported behavior documented and verified by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, node.js
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.