Data Abstraction in Large Web Applications*
The principles of abstraction are drilled into us repeatedly, and we work hard to abstract the layers of our applications. Abstraction between layers is excellent, but what about abstraction within layers, especially the data layer? Many developers still build database-centric applications, and then struggle the day they need an additional or new data source. Learn the reasons why this is a poor design choice, and the best ways to avoid it.
It’s a pain point for web developers: our small, database-focused application is growing and we need to add a new data source. Suddenly the model layer’s focus on databases doesn’t seem so rational. Whether it’s REST, a NoSQL datastore, or some other data type, the idea of transactions, queries and tables doesn’t fit anymore. Even our frameworks become inadequate.
But there is a better way! We can design for this eventuality from the very beginning. Learn the ways of planning a web application for the day it needs to incorporate some other kind of data source, and avoid the pain points of being database-centric.
I have spoken at OSCON twice, as well as several other PHP conferences and PHP user groups. I am speaking at PHP UK in February 2012.
Brandon Savage is a software developer who began his PHP career in 2003, before PHP 5 was even released. He began by developing gaming systems, figuring that having a computer complex math was preferable to doing it by hand. Brandon eventually figured out that he could make money by writing code, and began full time software development in 2008. He quickly outgrew his first few roles, and eventually landed at Mozilla, where he works as a Software Engineer on the Socorro team and has since added several open source technologies to his resume. Brandon lives in Olney, Maryland with his wife and three cats. He is an instrument rated private pilot.