The DBA`s Role within N-tier Applications Dan Andrews

Download Report

Transcript The DBA`s Role within N-tier Applications Dan Andrews

The DBA's Role within N-tier Applications
Presented by: Dan Andrews
Time: 10-15 Minutes
Slides: 8
Who the heck is this guy?
Dan Andrews
I work at TMW Systems as a Database Architect and/or Platform Engineer depending on who you ask.
I have been with TMW Systems since June 2016. Previously with PNC Bank as a Senior Software
Engineer in QRM (Quantitative Risk Management) area. Previous to PNC, at Kenan Advantage
Group as a Lead Software Developer and Database Architect.
Blog:
Twitter:
LinkedIn:
Stackoverflow:
Email:
http://www.medinafreemason.com
https://twitter.com/MedinaFreemason
https://www.linkedin.com/in/dandrews330
http://http://stackoverflow.com/story/dandrews330
[email protected]
I know Mindy too!
The strawman that got into production
An example of an application with little to no design intent, is the strawman that got into production.
This the application that reads directly into the database with its own connection string. It
concatenates strings to build SQL queries. It has no regard to indexes or any knowledge of efficiently
accessing the database. It doesn’t utilize or rarely utilizes existing stored procedures – only the stored
procedures that the developer knows of at that moment. It cannot utilize stored procedures made
after the fact w/o a recompile and deployment. It’s the application that users complain is too slow
while DBA involvement was an after thought. Only after the application is written, rolled out, and
people are complaining does a DBA get tasked with making indexes and reviewing the data model.
What’s worse? The salesman started selling this application as a solution for customers and claimed
that it’s second only to sliced bread.
We’ve all been here, we’re not alone, there should be a support group for us.
What is N-Tiered Architecture?
Enter the Service Layer
Don’t get too cra-cra
Why do we need a service layer?
Generally the data access layer is tightly coupled with your RDBMS. Adding a service layer allows
you to abstract the RDBMS and allows you to use multiple data sources or change your data source
w/o affecting down stream application. This allows you to have the best of both worlds and utilize
document-oriented database such as MongoDB, Couchbase or other NoSQL database systems.
A Service Layer creates a reusable code for other applications with a single entry point. Stored
Procedures (CRUD layer) are great, but that new hire just found how to insert data directly, skip all of
the triggers, the application is fast, salesmen & managers are excited, and the developer just became
the Rock Star of the company, hailed as an Elite Developer by your boss.
Service layers allow DBAs do what DBAs do well, to monitor query performance, to write efficient
stored procedures for the data model, and maintain a realistic number of indexes for the tables. They
allow DBAs to worry less about the one off queries.
TL;DR: Service Layers allow you to abstract the data access layer
What does the N-Tier approach promise?
DBAs want to be part of every design aspect of an application
•
•
•
We want to design the data model
We want to have the application developers change their code
We don’t want some code monkey touching our beloved stored procedures (I’m a code monkey)
These goals are generally unrealistic as there are more developers than DBAs. Developers will wear
down DBAs by flooding them with code changes causing a DDoS.
By utilizing an N-Tiered approach, DBAs get to focus on the database and data model. Developers
don’t feel like DBAs are out to make their lives miserable. Applications consume objects from the
Service Layer without having to worry about how’s to get the data.
Questions?
Plug for good reading material
Go Tribe!