Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a file-based database and a server-based database?

Tags:

sql

database

I know SQL, and I know the basic structure of a database, but what I don't know is how exactly does a file-based database work as opposed to a server-based one.

like image 788
Amir.F Avatar asked May 12 '12 13:05

Amir.F


2 Answers

what is the difference between a file-based database and a server-based database

First of all databases are stored in files! So a simplified answer would be there is no difference.

But when we refer to file-based databases we mean databases that we interact with/update directly (via an SQL abstraction offered by the JDBC driver) but in essence we just read/write to a file directly. Example would be SQLite

When we talk about server based databases we mean that there is a server process running (bind to some port), that accepts requests (i.e. SQL queries). Your process connects to the server and sends queries to the server which itself is responsible to update the database files. Example is MS-SQL Server.

The server based database could be anywhere (could be accessed via network) while the file-based database must be in a file in the local file-system.

Which one to choose depends on your needs.

like image 197
Cratylus Avatar answered Sep 19 '22 21:09

Cratylus


A file-based database is just one record after the other in a file, and maybe it uses some indexing.

A server database uses pages, where each page contains multiple records inside and might use multiple files to store the data.

Server databases are highly optimized for high performance.

like image 27
memo Avatar answered Sep 21 '22 21:09

memo