Subject Re: [firebird-support] Architecture of Firebird
Author Stefan Heymann
> There is the server-software which you install on a machine. The
> database is contained in a file (.fdb).
Correct.

> The server is a process on the system.
Correct. On Windows machines it is a Service, on Linux machines it is
a Daemon.

> And the database resides somewhere on the hard-disk as a file.
Correct.

> You don't load a database-file into the server.
No, the server can use any database file on its local (!) file system.

> So the server- software doesn't know which databases are running.
The server software doesn't care which database files are on the file
system until someone connects to one of them. From this time on, the
server software *does* know that this database is "running".

> As long as the server is running, you can access the fdb-files as
> database.
Correct. The server will hold an exclusive lock on the database file
so the file can only be accessed, on a file basis, by this very server
and no other process. From then on, only Firebird clients can access
the database, using the server (which is what a server is all about
;-)

> So you can run different databases on one instance of the server-
> software.
Correct.

> And in the server-software you don't have to setup anything
> according to the databases.
Correct. You tell the server which file it has to use when you
connect. The file name is a part of the database string, e.g.
elvis:C:\Databases\Employee.fdb
(here, "elvis" is the name of the database server machine, the first
colon ":" tells the Firebird client to use TCP/IP and the rest is the
physical filename of the database file on Elvis's local file system).

There is an exception, though: You can setup "aliases" (this is done
via the aliases.conf file in the Firebird application directory). When
you insert a line
employee = C:\Databases\Employee.fdb
in this file, you can connect to the save database as above using the
database string
elvis:employee

> The username/password is for the server. How is this in the database
> itself? You don't have a userlist on every database. Only in the
> server.

There is a special database, security.fdb, located in the Firebird
directory. You can only connect to a database when the
username/password is found in this security database.

The user's rights for the database are declared in the database
itself, using the GRANT and REVOKE commands. There are two exceptions:
the user SYSDBA and the user who created the database (which is the
"owner" of this database) have all rights on the database.

So the username/password is in the security database which is global
for all databases on the server. What any user can do is a property of
every database.

HTH

Best Regards

Stefan

--
Stefan Heymann
www.destructor.de/firebird