Prev | Current Page 161 | Next

Brad Ediger

"Advanced Rails"

html.
Advanced Database Features
Among Rails programmers, advanced database features are often a point of contention.
Some contend that constraints, triggers, and procedures are essential; some
shun them completely, saying that intelligence belongs in the application only. I am
sympathetic to the argument that all business logic belongs in the application; it is
nearly impossible to make agile changes to changing requirements when logic is split
between two locations. Still, I believe that constraints, triggers, and even stored procedures
have their place in enterprise applications. In order to explain why, we??™ll
have to examine a distinction that comes up often in relation to this debate: the difference
between application and integration databases.
Application Versus Integration Databases
Martin Fowler differentiates between application databases and integration databases.*
The basic distinction is that an integration database is shared among many
applications, while an application database ???belongs??? to the one application using it.
* http://www.martinfowler.com/bliki/DatabaseStyles.html
110 | Chapter 4: Database
In this sense, ???application??? can mean one program or multiple programs within an
application boundary (the same logical application). Usually this distinction refers to
how the schema is organized; in Rails, integration databases are often referred to as
databases with ???legacy schemas.


Pages:
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173