Database Management Systems
Sqlite Postgresql SQL-Server Oracle XML
SqliteSQLite is a very cool thingamabob indeed. It's kind of an open source
Access
database equivalent. SQLite is only a C-library that provides a
SQL92
interface to a database file. In this database instance you can create multiple tables and store stuff in them like in a normal DBMS. There is no database daemon running at all, as the library is only used while processing the SQL command. With such simplicity some functionality of a real database system is of course missing. There are no constraints (like in MySQL) and no datatypes apart from
VARCHAR
. Nevertheless SQLite is very fast - not only compared to Microsoft Access (which was not really worth mentioning) - but even beats MySQL in some benchmarks. There are bindings for many languages, with C and TCL modules coming with the base package. PySQLite e. g. is a Python database module, which makes up for a very nice, portable data container. SQLite is even available for win32... Though sqlite does not provide constraints, you can simulate at least some funcitonality of a real database. Here is an example for a delete cascade. CREATE TRIGGER DELETE_CASCADE_1 AFTER DELETE ON TABLE1 FOR EACH ROW
BEGIN
DELETE FROM TABLE2 WHERE TABLE2.ID=OLD.ID;
END;
PostgresqlIf you haven't looked at PostgreSQL, you probably have missed something. If your MySQL is just fine, you don't seem to need a relational database, that features such essential features as constraints, procedures, triggers and fine grained locks. You can write the database procedures in various languages, for example C/C++, plpgSQL, Python, Perl, ... PostgreSQL is my favorite database management system. I'm also maintaining the MacPorts port of PostgreSQL (version 7 & 8). Here is a PL/Python stored procedure to query a pop3 server for validity of a username/password combination: CREATE OR REPLACE FUNCTION CHECK_ACCOUNT( TEXT, TEXT ) RETURNS INTEGER AS '
from poplib import POP3
# unknown error
retval = 1
username = args[0]
password = args[1]
if not username.isalnum():
# username is NOT alphanumeric
retval = 2
else:
try:
pop3server = POP3( "pop3.mydomain.com", 110 )
pop3user = pop3server.user( username )
if pop3user.startswith( "+OK" ):
try:
pop3pass = pop3server.pass_( password )
if pop3pass.startswith( "+OK" ):
# everythings fine
retval = 0
else:
# auth failed - not sure if not always an exception is raised
retval = 3
except:
# auth failed
retval = 4
except:
# problems reaching server
retval = 5
else:
pop3server.quit()
return retval
' LANGUAGE plpythonu;
SQL-ServerThe Microsoft SQL-Server is by far the best product from Redmond I know. It is well suited for medium sized databases and has a nice graphical front end. We had to use the SQL-Server at the EPTA project where we only encountered some minor problems. We had networking problems where we could not connect to the DBMS over tcp. Ironically the SQL-Slammer worm could. The online documentation is a bit bloated and seemed to be written for database novices who should perhaps stick with
Access
(which btw. is not a relational database, as it does not fullfill the ACID requirements). The
.NET
database connectivity is - as a far as we used it - en pair with JDBC. The disadvantage of using .NET with SQL-Server is of course that you are bound to Microsoft Windows as long as Mono does not do the job.
OracleThere is a nice article on the Oracle technology network about installing Oracle 10g on RHEL 2.1, RHEL 3, or SLES 8.
XML |