Why use databases?

Why should we store data?

  • When the program runs, data is stored in RAM, but it is volatile.
  • Data such as user actions, settings, logs, and other data must be continuously retained.
  • Therefore, a system is needed to permanently store and manage data

File Systems and Databases

  • File System
    1. Storage format: Simple file formats such as csv, txt, json, etc.
    2. Approach: Read the entire file and process it yourself
    3. Concurrency: Accessed by file - > risk of collision
    4. Scalability: Managing becomes difficult as the number of files increases
    5. Reliability: Data corruption if errors occur during correction
  • Database
    1. Storage type: Structured data
    2. Approach: Only query the data needed
    3. Concurrency: Simultaneous access control through transactions
    4. Scalability: Large-scale processing with indexing, sharding, etc.
    5. Reliability: Data stability is ensured with ACID assurance
  • What is SQLite?
    • Files are saved in .sqlite format, but not as a file system. It is an SQL-based database that uses files as a medium.