msiemens / tinydb

TinyDB is a lightweight document oriented database optimized for your happiness :)
https://tinydb.readthedocs.org
MIT License
6.84k stars 550 forks source link

Are there any option to persist query caches? #536

Closed miratcan closed 1 month ago

miratcan commented 1 year ago

(If there is it can be run very fast I think.)

fenchu commented 1 year ago

Tinydb is just a dict of objects keyed from "1" and upwards, It is intended as a simple structure for small datasets. You can cache on the outside by adding a wrapper around the db.search() routine. if you need this then go for redis or another database.

msiemens commented 1 month ago

I full agree with @fenchu. If you're in a state where you gain a significant amount of performance by persisting the query cache, I think you'd gain at least an order of magnitude by switching to a more sophisticated database system like Sqlite (which has quite extensive JSON support!) or something like DuckDB.