majority SQL Database engines provide external access as separate server processes , External clients want to access the database , You need to communicate with the server process （ Usually TCP / IP）, This will send the request to the server and receive the result back to the database server .SQLite But can't work in this way . Use SQLite, If you want to access the database , Can only read and write directly from the database file on disk .SQLite No server process .
No server has advantages and disadvantages .
The main advantage is that there is no need to install 、 Set up 、 To configure 、 initialization 、 Manage individual server processes . This is it. SQLite yes “ Zero configuration ” One of the reasons for the database engine . Use SQLite Before running, you can set up the database engine without any management support . Any program that can access the disk can use SQLite database .
On the other hand, the disadvantage is that ： Database engine using server process can provide better protection , To prevent errors in client applications - Stray pointers in the client cannot destroy the memory on the server . And because the server is a single persistent process , So it can control database access more precisely , To achieve finer grained locking and better concurrency .
majority SQL Database engines are all client based / Server's . In a server less database ,SQLite It's the only known one , It allows multiple applications to access the same database at the same time .
Classic no server vs. new no server
Recently, , People began to use “ There is no server ” A word that is slightly different from what is expected in this document . This is a “ There is no server ” Two possible definitions of ：
SQLite Is a classic example of a server less database engine . Use SQLite, There are no other processes , Threads , Machine or other mechanism （ host OS And file systems ） Can help provide database services or implement . There is really no server .
Microsoft Azure Cosmo DB and Amazon S3 Is an example of a new serverless database . These databases are implemented by server processes running separately in the cloud . But the server is made up of ISP Not maintained and managed by application developers . Application developers only use this service . Developers don't have to set up , Configure or manage database server instances , Because all this work is done automatically by the service provider . The database server actually exists , They're just hidden from developers .
understand “ There is no server ” These two different definitions are important . When the database claims to be “ There is no server ” when , Make sure you identify them as “ Classic no server ” still “ New no server ”.