Limitations of TinyDB¶
JSON Serialization¶
TinyDB serializes all data using the
Python JSON module by default.
It serializes most basic Python data types very well, but fails serializing
classes and stores tuple as list. If you need a better
serializer, you can write your own storage, that e.g. uses the more powerfull
(but also slower) pickle or
PyYAML.
Performance¶
TinyDB is NOT designed to be used in environments, where performance might be an issue. Altough you can improve the TinyDB performance as described below, you should consider using a DB that is optimized for speed like Buzhug or CodernityDB.
How to Improve TinyDB Performance¶
The default storage serializes the data using JSON. To improve performance, you can install ujson , a extremely fast JSON implementation. TinyDB will auto-detect and use it if possible.
In addition, you can wrap the storage with the
CachingMiddleware which reduces disk I/O.