Wednesday, December 03, 2008

Portability via Stored Procedures

This was a thought that just hit me yesterday. If you encapsulate all of your queries into stored procedures, I think if you build your app correctly, it can increase the portability of your application. See, if you use something like Perl's DBI, you can treat every RDBMS identically from an API perspective. So, if all you do is call a stored proc, all you should have to do is change the driver/connection string and you're done. Your stored procs can hold all of the queries and still allow you to use vendor-specific features to be as optimized as possible. Granted, you still have to maintain a set of stored procedure scripts per vendor, however chances are you'll have to have to maintain SQL scripts anyway for table creation, tablespaces, etc.

I bring this up because in every discussion I've seen related to databases, stored procedures, and portability, I've never seen this suggested.

Labels: , , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home