This note describes what I'm doing and why, and asks a couple
of simple questions.
The fundamental problem of Linux/Unix on a network server
is that you need to be root to edit a config file in /etc and
restart a service to make the changes take effect. For the
most part real-time status and statistics are just not
available. (_clearly_ just my opinion)
At Fourelle we solved this problem by building our app
with a "DB-like" interface. We recognized that most of our
data was arrays of structures which seemed to look like DB
tables. We wrote an interface which let us view and edit the
contents of the tables directly. The interface was a TCP
connection which accepted a (very) small subset of SQL. All
of our structures which had config, status, and stats were now
data base tables.
This was great for several reasons. The web interface
had the same view of the system as the command-line interface
and as the SNMP interface. The data base view simplified UI
design and coding. Also, the developers migrated to putting
most of their internal tables into the DB in order to make
debugging easier. We wrote a web interface which would let us
view and edit any table in the system.
As an example, consider an "ethers" table:
___name___ ____address____ ____netmask____
lo 127.0.0.1 255.0.0.0
eth0 192.168.1.11 255.255.255.0
eth1 188.8.131.52 255.255.255.0
One of the user interface programs could change the IP address
of the box with the command:
UPDATE ethers SET address =192.168.1.22 WHERE name = 'eth0'
I hope you get the idea of what we did from this example.
One problem we had with this approach was that we needed
to write our own code in the UI program to handle the protocol.
We wrote it for C and Java, but not for PHP, TCL, or Perl.
I would like to switch to using the Postgres protocol in order
to use the PG interfaces in PHP, C, Perl,... hence my questions.
- Any comments on our DB view for config, status, stats
- Any comments on the use of the Postgres protocol
- The protocol uses a "T" to start a "Row Description" packet.
The developer's docs give the packet layout but does not
describe "type modifier". Where is this documented?
- What problems do you think I should expect?