Databases

What is SQLite

What it is

A compact database that lives in a single file โ€” no separate database server required.

How we use it

For small self-hosted services with moderate load where a separate database would be overkill โ€” easier to deploy, easier to back up.

Where it helps a business

  • A bot for a club, a family or one department does not need a separate database server.
  • The service should be easy to deploy and move: the whole database is one file.
  • You need a light cache or log next to the program.

How we use it

  • Small bots. The birthday bot and the club loyalty card keep everything in one file; the club's database copy is sent to the main administrators in Telegram once a day.
  • A cache. The voice transcription bot keeps transcripts for 30 days, and the video downloader bot keeps the file_id of files already sent.
  • No documents stored. The insurance policy bot writes only processing counters to SQLite, with no files or their contents.
  • Chats and accounts. In Peregovorka accounts, messages and 90 days of chat history are in SQLite; the OshaPlay app keeps its library index in SQLite.

Common problems

  • A copy taken mid-write. The database file is best copied while the container is stopped.
  • A file inside the container. In Docker it must live on the host's disk, or a rebuild deletes it.

When you do not need it

When many administrators work with the database at once, several services share it, or transactions with locks are needed, we use PostgreSQL or MariaDB.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.