140 likes | 262 Views
Gurunandan R. Bhat Synapse. FireBird! (no Virginia, not the browser). Some History. 25 July 2000 Borland (or Inprise...or whatever) releases the Source Code of Interbase 6.0 Interbase Public License aka Mozilla License
E N D
Gurunandan R. Bhat Synapse FireBird! (no Virginia, not the browser)
Some History..... • 25 July 2000 • Borland (or Inprise...or whatever) releases the Source Code of Interbase 6.0 • Interbase Public License aka Mozilla License • Support to be handled by an independent company carved out of original Interbase developers • 29 July 2000 • Inprise (or Borland... or whatever) demurs – vacillates and then finally pulls plug
History (....contd) • 28 August 2000 • Interbase 6.0 Forks – Community takes over released code base • No Install scripts, No Makefiles, No Documentation, No Regression Suites for testing • Reborn as Firebird and makes an appearance on Sourceforge • Original Interbase developers regroup around Sourceforge • 15 September 2000 • Borland promises to support Interbase 6.0 again
Firebird Current Status • Version 1.5 RC7 released on 25 November 2003 • Builds and Build Kits now available for • Linux, FreeBSD, Solaris, HP-UX • Windows, MacOS, Darwin, AIX, Sinix-Z
Firebird Features • General SQL 92 Compliance • Stored Procedures • Triggers • Variety of Bindings • PHP • Perl • C/C++ • ODBC/JDBC • Delphi 5 (MIDAS) and Delphi 7/Kylix dbExpress • Mono !
Firebird Features... the interesting part • Sequences available as Generators • User defined datatypes available as Domains • Procedural Language for Triggers and SPs • As powerful as PL/SQL and easier to learn • Database on a Single File • Ideal for CD based and embedded databases • Easy Replication and Backup • Easy to install • Easy to use Command line tool (isql)
Two Flavours1. The Classic Server (CS) • A Separate Process for every Client Connection • A Separate Database Cache for every Client Connection • Requires a Lock Manager to arbitrate between Concurrent Page Access • Multiple Processes started and configured via inetd • Ideal for a small number of concurrent connections
Two Flavours2. Super Server (SS) • A single server process • Each client starts a Separate Thread • No Lock Manager required for concurrent access to the same Page • Better Integrity since a single process has write access • Some Implications on User Defined Functions (UDF) • Careful whilst using global variables (Single Process shares all!) • Do not allocate dynamic memory (The Server process never dies!)
Installing Firebird on Linux • Download rpm from Sourceforge • Decide whether you want the Classic or the Superserver version • Install the rpm • Copy the startup script to /etc/init.d • Change the SYSDBA password • Create Users • Create Databases • Enjoy!
Building Your Own UDFsLimitations • You can't pass NULL to a UDF or return a NULL • Does not run inside a Transaction • Do not DDL inside a UDF
Building your Own UDFsFrom The Operating System Side • On the Command Line • gcc -c -O -fpic -fwritable-strings my_udf.c • ld -G my_udf.o -lm -lc -o my_udf.so • cp myudf.so /opt/firebird/UDF
Build Your Own UDFFrom the FireBird Side • On the SQL Command Line • declare external function myudf • integer, integer • returns • integer by value • entry_point 'modulo' module_name 'myudf'; • commit;
References • http://firebird.sourceforge.net • http://www.ibphoenix.com • Firebird Quick Start Guide • Interbase Manuals from Borland