Database Reference
In-Depth Information
This approach has some major drawbacks. Moving data back and forth to the data-
base server one row at a time is extremely inefficient and you will find that this meth-
od is simply not viable in a web scale application.
This idea is usually associated with a concept of a "data abstraction layer", a client
library that allows the developer to switch the database out from under the applic-
ation with very little effort. This abstraction layer is very useful in the open source
development community, which allows the use of many databases, but they have no
financial incentive to get the best possible performance.
In a 27 year career, I have never actually changed the database of an installed ap-
plication without throwing away the application. One of the principles of agile soft-
ware development is YAGNI (you ain't gonna need it). This is one of those cases.
Lesson learned : Data abstraction is valuable for projects that need to select a data-
base platform at installation time. For everybody else, just say no.
Encapsulation
Another technique used in more client centric development philosophies is to try to
isolate the database specific calls into a library of procedures. This design is usually
aimed at leaving the application in control of all business logic. The application is still
king, and the database is still just a necessary evil.
This view of database architecture sells the application developer short by ignoring
a toolbox full of tools and choosing only the hammer. Everything in the application is
then painted to look like a nail, and smacked with the hammer.
Lesson learned : Don't give up the power of the database just because it is not fa-
miliar. Use procedural languages and check out extension toolkits. There are some
awesome pieces of work in there.
What does PostgreSQL offer?
So far we've mentioned procedural languages, functions, triggers, custom data
types, and operators. These things can be created directly in the database via
CREATE commands, or added as libraries using extensions.
Search WWH ::




Custom Search