Introduction

Great that you’ve taken time to check out the TinyDB docs! Before we beginlooking at TinyDB itself, let’s take some time to see whether you should useTinyDB.

Why Use TinyDB?

  • tiny: The current source code has 1800 lines of code (with about 40%documentation) and 1600 lines tests.
  • document oriented: LikeMongoDB, you can store any document(represented asdict) in TinyDB.
  • optimized for your happiness: TinyDB is designed to be simple andfun to use by providing a simple and clean API.
  • written in pure Python: TinyDB neither needs an external server (ase.g.PyMongo) nor any dependenciesfrom PyPI.
  • works on Python 3.5+ and PyPy: TinyDB works on all modern versions of Pythonand PyPy.
  • powerfully extensible: You can easily extend TinyDB by writing newstorages or modify the behaviour of storages with Middlewares.
  • 100% test coverage: No explanation needed.

In short: If you need a simple database with a clean API that just workswithout lots of configuration, TinyDB might be the right choice for you.

WhyNot Use TinyDB?

  • You needadvanced features like:
    • access from multiple processes or threads (e.g. when using Flask!),
    • creating indexes for tables,
    • an HTTP server,
    • managing relationships between tables or similar,
    • ACID guarantees.
  • You are really concerned aboutperformance and need a high speeddatabase.

To put it plainly: If you need advanced features or high performance, TinyDBis the wrong database for you – consider using databases likeSQLite,Buzhug,CodernityDB orMongoDB.

« Welcome to TinyDB! |Getting Started »