![]() |
![]() |
|
April 20, 2003Calling all Database GurusI have a question for all the DBAs and developers out there. Anyone know where I can read up on developmental practices of writing vendor neutral database access code for an application. I am writing a pure ANSI C++ application that was originally going to connect to the MSDE. As I would prefer to provide alternatives to include Oracle, PostreSQL, mySQL as well as MS SQL Server.... I need to look at alternatives. Said advice should include information for database drivers supported on both XP/W2k and Linux. I need to read up on ways to do this and avoid many of the cross database issues. As an example of 'issues' I can see, consider Stored Prcoedures. They doesn't work across all db systems the same way. I would like to write the routines once, and not have to do it separately for each database. Anyone know of good resources for this? I want to make sure I include open source alternative databases as well as heavier systems like Oracle and MS SQL Server, and simply do not have the experience to know where to begin. You comments would be greatly appreciated. Comments
Berkeley db? :)
I've started a collected of links and ideas about this topic at: http://www.nyetwork.org/wiki/Databases Your best bet is probably to use ODBC (which works on Windows and Unix/Linux/OSX). Use Stored Procedures, but don't support databases that don't allow support them (MySQL doesn't really AFAIK, although MS Access does.) Every database has its own way of doing Stored Procedures. However, once they are written once and the logic is there, porting them to another database is just tedious. Many vendors (eg PostgreSQL at techdocs.postgresql.org) have hints for porting from other databases. One thing that I ran into with PostgreSQL procedures is that the Win32 ODBC driver doesn't support the EXECUTE syntax for running a stored "function". Other things to consider include access controls on database objects, which differ between databases as well. Posted by: Wim at April 21, 2003 02:19 PMYou would think there would be easier ways. I will look more into the ODBC side of things, but I am perplexed on why this is such a hastle. Looks like it is going to be a lot of work to simply build a database with tables and Stored Procedures, and have some iota of saneness in the development time. I think I may have to break down here and maybe only support PostgreSQL and MSDE/MS SQL Server, and drop the rest. Even though Oracle does have stored procedures, I don't think I will muck with so many different database types. If customers need Oracle and mySQL support, and are willing to pay for it, I will deal with it then I guess. I think a company could make a pretty penny from software developers like me who need a neutral database abstraction layer to deal with such a simple issue which must plague a LOT of software vendors. Thanks to everyone who posted publically or via email. Much appreciated. Posted by: SilverStr at April 21, 2003 03:00 PMHow complicated will these procedures be? Maybe VIEWs would be sufficient? By the way, Oracle's PL/SQL is quite similiar to PostgreSQL's PL/pgSQL. Posted by: Wim at April 21, 2003 04:29 PMYea, I think a lot will come down to "do you want to spend gobs of time creating something that 1% of the people will use" and not "give them reasonable defaults and if they *really* want it put it in later when they are paying for it or have promised to buy $large_number of units when it's in. I think one of the traps we fell into at Merilus was putting in features that no one was really going to use (I think you've harped on this more than once :) and more importantly, spending lots of dev time putting them in. Posted by: Arcterex at April 21, 2003 11:34 PMWhat, you don't like it when I harp about feature creep and trying to keep the dev team focused? :) I want to make sure I include atleast one cost-effective database that works on different Unixes, as my daemon runs on W2K/XP/Linux/BSD. Having an option for atleast PostgreSQL allows for some vendors to deploy the solution on something like Linux without having to deal with MS's CAL, or 10's of thousands of dollars for a database. I am trying to keep the dev time down to a minimum, and I would hate to have to write a database abstraction layer and host like 5 or 6 different databases on servers here. I use exclusively PostgrSQL on all our production stuff here, and will build a default install with the MSDE for Windows. Past that, I would just like to have "integration scripts" to build tables, Stored Procedures and set up perms for different systems as required. Hopefully then the ODBC driver can take over and do the rest. We will have to see. Posted by: SilverStr at April 22, 2003 11:42 AM |
![]() ![]()
My 5 Favorite Books
Writing Secure Code
Secure Programming Cookbook Security Engineering Secure Coding Principles & Practice Inside the Security Mind ![]()
My 5 Favorite Papers
Smashing the Stack
Penetration Studies Covert Channel Analysis of Trusted Systems DoD Trusted Computer System Evaluation Criteria NSA Security Recommendation Guides ![]()
Archives
December 2005
November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 ![]() |
|