Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why daemon is required for DBMS?

I was recently introduced to MongoDB and going through the installation guide I came to know that we have to first run the daemon (mongod) and then we have to connect to the daemon through mongo.exe (for windows) to actually run the commands. I have noticed this is a general structure for most of the DBMS where we have to start a server and then connect to it to run the commands.

Why can't we run DBMS in a single program instance as we do with Python or Node.js? Specifically, why we need the server-client architecture for a DBMS?

like image 582
Anurag Shukla Avatar asked Nov 07 '22 03:11

Anurag Shukla


1 Answers

Yes you can. It is not strictly needed.

What you describe is how SQLite works. Other "embedded" database engines do the same.

The main advantage of a separated server is that multiple clients can connect to it at the same time. Simultaneously writing and reading to shared data files without a central coordination process (a server) becomes more and more complex and unreliable to a point where a separated, dedicated process is easily justified.

like image 178
istepaniuk Avatar answered Nov 15 '22 06:11

istepaniuk