Data sharing in traditional file system vs dbms?

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Data File System
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
Why is data sharing not possible in traditional file system(TFS) (vs DBMS)?
Relevant Equations
None
I know data is decentralized in TFS. But how does that makes data sharing difficult?
We've got distributed computing for the similar purpose on different machines as well.
I read a lot on this but failed to find any information regarding why it was not possible to share data in TFS as compared to DBMS? And why is it easy to share data in DBMS?
OXyqoVluQNQklwcHQr3XbhnrP2ZsvwAEVwe8FVOZJHwa8dLGyA.png

Source: Parteek Bhatia "Simplified Approach to DBMS"

According to this figure, I really don't see anything not offered in TFS that is offered in DBMS.
 
Physics news on Phys.org
The DBMS will handle updates to the data insuring that no two entities can update and overwrites one anothers data.

As an example, you have a data record with a count. User A reads the count and adds one to it and then writes it back to the database. At the same time, User B reads the count, adds one and writes it back. You can see that its possible for User B to overwrite User A count increment.

A DBMS would use an atomic operation to increment the count meaning when run by User A the count is read and incremented in one operation. Hence User B is locked out and can't do the same until the User A operation completes.

With a shared filesystem its still possible for someone to read a file, make some changes and write it back while another user is reading the file making different changes and writing it back at a slightly later time

at t0 user A reads file X
at t1 user B reads file X
at t2 user A writes back changes X'
at t3 user B writes back changes X' --> X''

and so User A's changes X' are lost
 
Reply
  • Like
Likes   Reactions: shivajikobardan