DEV Community

Cover image for Files
Anamika
Anamika

Posted on

Files

Files are highly recommended to store data for future purposes. But still, when we have a huge amount of data, we tend to move on to database for storing our data.
Why?

file

What are Files?

Files can be considered as the permanent store areas for our data. A Normal/Ordinary File on any Operating System can be classified into two types- Text Files and Binary Files.

File are so important that many (almost all) programming languages have them as an entire topic!

Data is stored in flat files and can be accessed using programming languages.

When to use files?

  • Files can be used on local devices since they provide on-device access to data.
  • Files can be useful for storing data offline.

    Eg:- History feature in a calculator app stores all the operations performed in the calculator. It makes use of files.

  • Many chatting apps store messages as files on the user's device. This is done so that the user is able to read the messages accessed through the files if he/she is not online.
  • For storing frequent incoming data.

    Eg: Censors in a city, if they read information at every 5 minutes.

  • For storing not-so-important data.

    Eg: Error log of a server.

Why not use Files?

  • Files can cause the dependency of program on a physical structure of data.
  • The process of retrieving data from files is complex.
  • There can be loss of data on concurrent access.
  • Files are not capable to give access based on records (Security)
  • Storing data in files can cause Data Redundancy , which is never desirable.

Database Management Systems offers several functions that help us overcome problems associated with file-based systems, such as-
Data Management, Integrity, Transaction and Concurrency, Security, Recovery and Utilities etc.

Also Read: The Management of Data

Top comments (3)

Collapse
 
noviicee profile image
Anamika

More links in this post regarding some other topics will be added soon!

Collapse
 
bataunga_nhi profile image
Sword

It's good BTW👍🏻

Collapse
 
noviicee profile image
Anamika

Thanks a lot!