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
- Storage format: Simple file formats such as csv, txt, json, etc.
- Approach: Read the entire file and process it yourself
- Concurrency: Accessed by file - > risk of collision
- Scalability: Managing becomes difficult as the number of files increases
- Reliability: Data corruption if errors occur during correction
- Database
- Storage type: Structured data
- Approach: Only query the data needed
- Concurrency: Simultaneous access control through transactions
- Scalability: Large-scale processing with indexing, sharding, etc.
- 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.