Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does sql require a server? [closed]

Tags:

sql

sql-server

I'm new to SQL, and i'm trying to understand something basic about it.

Why do we need a server to connect to when using SQL?
In my very narrow vision of it, it just uses some databases, which could be implemented as arrays for example (or whatever it is that is implemented "backstage").
For example, if I want to set up a table in my computer and do some operations on it, what usage does the server has? Why can't it "just be there"?

like image 428
Achi Even-dar Avatar asked Apr 21 '26 20:04

Achi Even-dar


2 Answers

I think the reason for your confusion is too narrow interpretation of the word "server" as a separate hardware box.

A server does not need to run on separate hardware, or even in a separate virtual environment. It could be another process on the same computer, or even a library within your process. What makes it a server is an ability to accept and process requests from clients. It does not matter where the server runs physically: as long as you follow a protocol in which requests originate on the client side, you have a server.

like image 121
Sergey Kalinichenko Avatar answered Apr 23 '26 10:04

Sergey Kalinichenko


What you're envisioning (roughly) is referred to as an in-process database and they do exist for SQL. SQL Server is set up to be used by multiple users or applications so it makes sense for it to be a central server that many clients can connect to so they can share the same data.

If you only want to process data locally, there is SQL Express LocalDB, SQLite and a few others that allow you to essentially embed a SQL engine inside your application.

like image 26
Chris Smith Avatar answered Apr 23 '26 08:04

Chris Smith