NoSQL started out as meaning “No SQL” as in “No Relational Databases”. It represented a movement to replace RDMBSs like SQL Server, DB2, Oracle, MySQL and Sybase. Over time, the more adept architects realized that there’s a place for both relational and non-relational technologies. However, NoSQL was a brand at this point, so like KFC, they redefined this as meaning “Not Only SQL”. This has been a nice turn of events, but it’s still a branding issue.
I believe the NoSQL community needs a new name – a new brand – to say what the community stands for. In fact, I was on a closing panel at NoSQL Now! that discussed this need. We didn’t really come up with an answer, but the general consensus was saying you aren’t isn’t nearly as helpful as saying what you are.
So what are those solutions that aren’t relational? DocBlobGraphEVA?
This week was Canadian Thanksgiving so this post on metadata stuffing is timely.
Today Thomas LaRock (@sqlrockstar | blog ) posted a rant about our Database Design Throwdown topic on naming standards for tables and other database objects. Tom is a fan of what I call “metadata stuffing” in object names. That’s basically shoving as much additional information as one can into object names so that one does not have to go find out that information from its rightful place.
My reason for wanting to use prefixes is simple enough: I want to know if I am looking at a table or a view when reviewing code.
Karen doesn’t believe that anyone should be using object names as a place to store meta data about the objects themselves. I would like to agree with her but then we’d both be wrong.
He even created the nice graphic of my quote I use here. Thanks, Tom.
Object Confusion Abounds
That quote is indeed one I use during our debate. It’s a snarky introduction to what I think the real problem is: our tools aren’t doing enough to help us with this potential confusion of tables and views. When you are writing or looking at a query, the syntax for referencing a table or a view is exactly the same.
When a developer writes:
USE AdventureWorks; GO SELECT Name, ProductNumber, ListPrice AS Price FROM Production.Product ORDER BY Name ASC; GO
He has no idea for certain if Product is a table or a view. The syntax is the same. And if the developer is working in a text editor of some sort, or with some native tools, there’s no tooltip or other help that the he can use to check what type of object they are querying.
Why does this matter? Tom has a great presentation where he shows the impacts of trying to make stuff work and you don’t know what you are looking at. That’s why Tom wants to do this with his objects:
So that the object type is injected into the object name. That seems so innocuous, doesn’t it? What could go wrong?
I’m here to tell you that this is a slippery slope. One of the most egregious examples of this sort of meta data stuffing I’ve run across is one that required all this meta data to be prefixed in front of every table name:
- tbl_ prefix
- Primary Systems that managed the table
- Primary subject area that the table belongs to in the data model
- Classification of the role the table plays in the database (Associative Entity, Domain Entity, Master Data, Reference Data, Log Data, etc.)
- Three letter login of the DBA responsible for administering this table (I KID YOU NOT).
So in this wonderful naming scheme, we’d get:
I have found that once an organization starts thinking of stuffing, their designs become turkeys really fast. It’s ugly. Think about the tools you use, with all those nifty object lists on the left side. To find a table you need to know all that great metadata as you scroll through the list, hoping that PRODUCT Is buried in there, somewhere. And what the heck was the name of that guy that dressed funny who did all that data stuff for the company before he won the lottery?
All that metadata that should have been managed elsewhere, not prefixed in front of the “real” name of the table. In fact, it was. In the data model and in the system catalog. Every time any of that data changed (DBA assignment changes, DBA wins the lottery, whatever), we had to rename the table and change all the code and reports that referenced it. Sure we could have isolated systems by this change by using views and or aliases but that is additional complexity for no performance gain, either. Refactoring might have helped, but eventually we’d still have to change all the code and queries.
Why I Hate Metadata Stuffing
- It’s redundant data. Just like with business data, the reason we want to minimize redundant data is because we then have to worry about updating the data in multiple places. There’s cost and added risk for that.
- It changes. I don’t know about you, but I don’t have the luxury of taking down a production system just to update a change in the name of the DBA’s favourite TV show or whatever lame naming scheme someone thought up. Sure, tables can’t change into views or indexes, but all the other type of stuffings will change.
- It takes up real estate. I get all kinds of flack from developers and DBAs for the length of object names when I want the names to be meaningful. It’s funny how spelling out CUSTOMER is unacceptable, but adding the exact same characters in front of every object of its type is A-OKAY. What’s up with that? Somehow optimizing names for developers is more important than loving your data? Show me where it says that in the Project Charter.
- tbl_ is a tell for bad database design. I don’t know where this particular naming scheme originated, but when I do a database design review and I see this naming scheme, I know that the designer learned design in a one hour webinar “training course” and has not really mastered the complexities of enterprise database design and maintenance. The design will be less than best practice 90% of the time. This naming scheme is prominent in programming books, introduction to database books, presentations by non-database people, and uninformed blog posts, by far. It’s not popular with people who do professional database design. Sure, some products use this, too, but do you really want to take database design best practices from vendors? How many professional data architects do you think they have on staff? I will most likely see a database design that is highly optimized to make development go faster. Not for data integrity or loving data.
- It’s not needed “for consistency”. One of Tom’s points is that if we are going to prefix views, we have to prefix tables to be consistent. Actually, no, we don’t. If we have to bite the bullet and prefix views because our tools let us down, we can choose not to clutter up tables names just to punish those objects, too. I’m assuming that since Tom prefixes tables and views, he prefixes columns, too, right? its just being consistent. < snort>
- It gets in the way of using the data. Tables and Column names are the most user-facing parts of a database design. When we in IT insist on munging up these names with a bunch of systemese, we make it more difficult for business users to get at their data. It shows that we have optimized the database design to help a relatively small number of technical users (developers, DBAs, ETL folks) over the needs of the business. Ultimately, we build databases to manage data. For the business.
What’s the Cost, Benefit and Risk?
One of my Splendid Truths is that all design decisions should assess cost, benefit and risks. In the overall scheme of things, just prefixing “tbl_” in front of a table name isn’t that costly and it isn’t that risky. Tom assesses his designs based only on potential for performance harm according to his post. He “laughs” at my position. I’m happy that my stance on metadata stuffing brings happiness to his day. But performance is only one data point out of many for making a design decision. Usability, clarity, business goal support are other factors that a database architect needs to consider when assigning a name to an object. If we optimize something for a subsystem, we do it as the expense of other subsystems.
Our Tools Should Help Us More
Having said that, I feel the pain of people having to work with sub-standard tools or having to use tools that just refuse to help. Tom showed how SQL Server Management Studio tooltips can help. But all those command line “I don’t need any stinking help” aficionados are left on their own to know what they are looking at.
Oh, and Tom:
ProperNoun_Tom, Pronoun_you Verb_made Pronoun_me Verb_laugh Preposition_with Possessive_your Noun_post.
(See how all this stuffing gets in the way?)
One of my other Splendid Truths about database design is:
Your tools will impact your data models and database designs more than you can imagine.
We shouldn’t sit back and let that happen. Stuffing is great with Tofurky, not with databases.
This past weekend I attended SQL Saturday San Diego, AKA, #SQLSat157. This was my first time speaking at this event and I want to give lots of thanks and kudos to the organizers for putting on a fine event.
Because I arrived in town early to meet with friends from both the space and data world, I was able to visit the San Diego Air and Space Museum. It was fitting that it was the 50th anniversary of President Kennedy’s Rice University speech on space exploration:
There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again. But why, some say, the moon? Why choose this as our goal? And they may well ask why climb the highest mountain? Why, 35 years ago, fly the Atlantic? Why does Rice play Texas?
We choose to go to the moon. We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too.
Not only is this fitting for motivating a generation to invest in space exploration, it’s fitting for professional development work, too. We attend and speak at SQL Saturdays not because it’s easy, but because we need goals to serve to organize the best of our energies and skills. I can’t tell you how many times I’ve been inspired to learn something new because I saw a fellow community member demonstrate how it could help make life for end users or co-workers better. And SQL Saturday gives me a full day of these sorts of workshops and demos…all for free. How great is that? It means giving up a Saturday and for those of us who travel to speak, 2-3 days plus expenses. And yet every time I leave one, I think "That was so worth it".
I spoke three times at this SQL Saturday: DB Design Throwdown, the Women in Technology Panel, and Career Management for Data Professionals. Between those, I was able to see just a couple more sessions. I really enjoyed Lynn Langit’s (@lynnlangit | blog) NoSQL for the SQL Server Developer. Lynn did a fabulous job explaining the differences between SQL and NoSQL technologies, as well as demoing MongoDB and cloud-based technologies. You should spend some time on her blog; she has a lot of great stuff with plenty of videos and demos.
I also had the pleasure of being on the WIT panel with Lynn. This panel, moderated by Tara Kizer, focused mostly on how we can energize the next generation of girls (and boys) to be interested in IT careers. Lynn is doing some fabulous stuff over on http://teachingkidsprogramming.org, where she and her partner, Llewellyn Falco (@llewellynfalco | blog ) are building a framework for, well, teaching kids programming.
I talked about the importance of talking with girls in your life, which is my usual homework assignment for attendees. Having someone in the IT profession share the fact that the industry isn’t just about typing and programming can make a real difference to a girl who just needs to hear that IT professionals can make a difference in the world. In fact, I have another blog post coming up soon on that topic.
Download the Database Design Throwdown: The Trailer presentation.
Download the Career Management for Data Professionals presentation.
I recently talked with my good friend Denny Cherry (@mrdenny | blog) about my experience at the NoSQL Now! conference and working with NoSQL technologies. Denny’s new podcast series is called People Talking Tech and he has other interesting topics and people coming up soon.
My comments focused on how at the NoSQL professionals understand that it means "Not Only SQL" and can’t mean "No SQL" and have much of a future. Using the right tool for the right job. Cost, benefit, risk and all.
One of the things we talked about on the closing panel is "how do you find somebody that is a good architect who can tell you which types of technologies you can use for which use cases…"
Even though many people talk about NoSQL needing no architecture, we still need people to help choose when and what NoSQL technologies to use. Seems to me that having experience working hands-on with relational and NoSQL technologies is going to be hugely valuable in the next couple of years. If you have relational experience, now is the time to start learning about non-relational ones.
By the way, we talked a bit about database security. Denny’s new edition of his book Securing SQL Server, Second Edition: Protecting Your Database from Attackers has recently been released. Check it out.
I’ll be doing two sessions at SQL Saturday San Diego this weekend:
The first is with co-presenter, Tom LaRock (@sqlrockstar | blog), where we debate, whine (Tom) and win (me) several database design approaches and methods in front of a live audience (you!). This is a warm up for our PASS Summit spotlight presentation.
Database Design Throw Down
Karen and Tom debate about the options and best practices of common and advanced design issues, such as: * Natural vs. Surrogate keys * NULL vs NOT NULL * Datatypes * Agile Database Design * Database Refactoring * Identity Crisis ? …and others. Bring your votes, your debates, and your opinions. Help us figure out who’s right and who wrong…or less right.
Session Level: Intermediate
My second presentation is on career management.
Career Management for Data Professionals
Career Success in Data Management during Turbulent Times: A workshop on issues and ideas that today’s data professionals can do to build their careers and networking skills with other data management professionals. Workshop topics will include: • Demonstrating your expertise • Building a portfolio of your success stories • Getting others to sell your skills and business value • Building & extending your data management skill set • 10 Steps to highlighting you and your work Bring your thoughts, ideas, and experiences.
Session Level: Beginner
There are many great speakers at this event and it’s FREE for a full day of learning. Registration is still open, but it is common for these events to sell out before the event. Register now!
Subscribe via E-mail
- Karen Lopez on Strutting: We all Know When You are Doing It. So Stop.
- Joey D'Antoni on Strutting: We all Know When You are Doing It. So Stop.
- Karen Lopez on Strutting: We all Know When You are Doing It. So Stop.
- Thomas LaRock on Strutting: We all Know When You are Doing It. So Stop.
- Karen Lopez on Strutting: We all Know When You are Doing It. So Stop.
- May 2013 (5)
- April 2013 (5)
- March 2013 (4)
- February 2013 (7)
- January 2013 (12)
- December 2012 (2)
- November 2012 (3)
- October 2012 (3)
- September 2012 (13)
- August 2012 (5)
- July 2012 (17)
- June 2012 (2)
- May 2012 (4)
- April 2012 (4)
- March 2012 (8)
- February 2012 (11)
- January 2012 (3)
- December 2011 (10)
- November 2011 (8)
- October 2011 (5)
- September 2011 (3)
- August 2011 (9)
- July 2011 (5)
- June 2011 (5)
- May 2011 (5)
- April 2011 (9)
- March 2011 (4)
- February 2011 (9)
- January 2011 (8)
- December 2010 (15)
- November 2010 (27)
- September 2010 (2)
- August 2010 (1)
- July 2010 (4)