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 powerful (but also slower) pickle or PyYAML.

Performance

TinyDB is NOT designed to be used in environments where performance might be an issue. Although 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 , an 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.

_images/performance.png

About TinyDB

TinyDB is a tiny, document oriented database optimized for your happiness :)

Useful Links

Table Of Contents

Navigation