# Process model of the database server

## Processes

dbd (whois_rip)

  The "master" daemon of the database system. All access to the underlying database engine goes through this process. It is implemented as a multi-threaded process, and written in C.
  The dbd daemon:

  - answers to queries made with whois;
  - receives update requests from dbupdate and the networkupdate daemon with the update protocol (single-object updates);
  - does referral integrity checks for the updates;
  - keeps in-memory the primary keys of routes, inetnums, in-addr.arpa domains to answer specific queries very efficiently;
  - takes care of locking issues which are not handled by the underlying database automatically;
  - is the only "clean" entry-point to the underlying storage system;
  - answers to near-real-time mirrors on a specific port (different than port 43), supplying them with serials;
  - has a special "admin port", to which the administrators can connect (with telnet) and change some configuration parameters on-the-fly.
dbupdate

  The front-end process for incoming updates. It starts from `.forward`: the incoming update mail messages are piped to dbupdate. It can also be invoked from command-line, using a file as an argument. It is written in C, and C++ for the object parser.
  The dbupdate process:

  - parses the headers of incoming mail and extracts the relevant bits of information (like the from address)
  - does MIME decoding if needed;
  - decodes PGP parts and verifies signatures if needed;
  - parses the objects, verifies the syntax and reports syntax errors;
  - passes the objects to dbd with authentication information with the update protocol, i.e. sending one object at a time with the ADD, DEL or UPD instruction;
  - sends acknowledgements and notifications.

  Must pay extra attention in using the right exit codes (should probably return 75 for ALL fatal errors and other non-successful situations and report them to the database management through some channel instead of sending ugly bounces to senders).

networkupdate

  A dumb program which just reads an update from STDIN and sends it to the networkupdate daemon. Written in Perl.

networkupdate daemon

  Started from inetd every time an update is sent from networkupdate. It is actually the same binary as dbupdate, invoked with a flag (namely, -n).

`$Id: process-model.html,v 1.1 2004/12/27 16:38:38 can Exp $`