Archive for the ‘Naming’ Category

Table names should be singular

Thursday, May 24th, 2007

The Rails convention is for database table names to be plural. The Handmark convention was previously the same. However, our new DBA (Chris Simonton for those of you who listen to the show) changed that convention to singular. The reason for the change lies in a common misconception about database tables.

Most people think about a table as a collection of rows. The database is a place to store data, and the data is organized in rows. The rows live in the tables. Seems pretty straight forward.

But that line of thinking leads to some serious mistakes. A collection is a group of things that all belong together. Like a group of employees who work for the same company, or a group of line items on an invoice. But a table contains rows that are completely unrelated to one another.  The employee table contains employees of various companies, and the invoice line item table contains information about several invoices.

Thinking about the table as a collection of rows leads to an assumption that the rows are somehow related. We might assume that all employees in the Employees table work for the same company, or that all of the rows in the LineItems table have a common vendor. After all, the application will be hosted by that company or that vendor, right?

Applications may start out in one scope, but they tend to outgrow their initial design. If we allow limitations to creep in because of inadvertent assumptions, it may be difficult to make the jump when we need to. Assuming that there is a relationship among the rows of a table can cause you to forget foriegn keys. After all, if every employee works for the same company, why would you need a CompanyID column in the Employees table?

We made that mistake at Radiant. The Enterprise product hosts data for restaurant companies. Since the product started out as a targeted system for a small number of customers, we made the assumption that each company would have its own database. As a result, none of the tables contained a CompanyID. The database name itself identified the company.

In the days when a new company signed on about once a month, it was no big deal to prop a new database from the model. But as the product grew, we were adding companies more frequently. And as we made changes to the product we had to deploy those changes to each company individually. But because of the assumption, we were unable to merge companies into a common database when we recognized that it would be a good idea.

A database table is not a container. It is a type. It is not a collection of rows, but a collection of columns. It defines not a set of data but a set of relationships. It is alalogous to "class Employee", not to "private List<Employee> _employees". To remind us of this, database names should be singular.

More Trouble with Naming

Friday, October 13th, 2006

Previously, I posted a solution that I learned from my wife for the problem of domain name kiting, squatting, and misspelling. In that post, I mentioned that other nations have little control over the way that this international network is administered. The e360 Insight LLC v Spamhaus suit illustrates exactly why we should all be concerned.

Spamhaus maintains a blacklist of spammers. e360 Insight LLC sued Spamhaus after it was blacklisted, and won an $11.7 million ruling. But the US district court that ordered the payment has no validity against the UK-based Spamhaus, so e360 turned its attention to another US company: ICANN.

e360 has asked the court to order ICANN to suspend spamhaus.org until Spamhaus complies with the ruling.

A recent ZDNet article reports that ICANN is taking the high road in stating that it will refuse this order. I applaud their efforts to stay above the fray. But some day they will be drawn down into it, bringing the Internet (to some degree) with them.

Problems with Naming

Thursday, August 24th, 2006

As you probably know, DNS is the way that computers turn names (like mallardsoft.com) into addresses (like 216.154.223.70). The DNS system was invented as a convenience to TCP/IP network users so that they wouldn't have to remember numbers or maintain their own hosts file. It has since become something much bigger.

The assignment of names and numbers is controlled by ICANN, the Internet Corporation for Assigned Names and Numbers. As their name implies, ICANN is a corporation, so it is controlled by US law. Other nations have very little influence in the way they conduct business, which is obviously a cause for concern. The Internet may have been born here, but it is now very much an international platform. Considering how much business is done online, I can understand the concern.

What is most troublesome is the way that the business of naming has evolved. ICANN controls the central registry of names. Somebody has to, since the name mallardsoft.com must always resolve to the same address no matter who types it in. DNS itself is a peer-to-peer protocol that distributes the registry, but the problem of naming demands that one organization must resolve conflicts.

ICANN outsources the actual registration process to other corporations, the registrars. These include some big names like Namesecure, AOL, NetworkSolutions, and GoDaddy. But many smaller corporations have also gotten into the registration business. (For an entertaining look inside the business of registration, please listen to Bob Parsons, CEO of GoDaddy). Not all of these registrars provide the same level of service. Some don't service customers at all.

Names have become hot property. Common words are especially valuable. According to one registrar, "Business.com" sold for $8 million. That's a lot to pay for a part of the English language. If you check out the site, you will find a search engine. This is the unfortunate reality of naming: the owners of these names do not need to add value to them. Someone who has a legitimate desire to provide value on line has to pay one of these squatters for the name they want, or make up some obscure name that isn't yet taken.

I have been concerned about this problem for a while. When ICANN started to charge for names, I thought that it would be less of an issue. As long as the resource is not free, you have to add value in order to recoup your investment, right? No. In his last podcast episode, Bob Parsons talks about Kiting or Tasting names. Domain registrars can obtain domain names from ICANN, put up a search page, and then return it to ICANN after a few days for a full refund. If they get enough traffic with that name, they'll keep it. If not, they haven't lost anything.

Another disturbing behavior is to register common misspellings of popular sites. This usually brings you to a page that tries to make money through some other means, like paid advertisements or sales of spyware blockers. Occasionally, though, the fake site will mimic the real one that you tried to visit, and may entice you to reveal passwords or personal data.

I am a capitalist at heart. I don't begrudge anyone doing anything legal and ethical to make money. These practice -- while robbing value-providing entrepreneurs of the resource of domain names -- are usually neither illegal, nor unethical. However, any system that rewards this kind of behavior is broken. The cornerstone of capitalism is that the market rewards businesses according to the value that they provide. If you can make money without providing value, then the system that you are using is ultimately not market-driven.

So here's my solution

This is one I learned from my wife. I Google everything, even known domain names. I never type names into the address bar of my browser. Google has very effective page ranking algorithms and an incredibly large user base from which to glean data. Theirs is not a centrally managed naming system. Theirs is a community ranking system. If I'm looking for youtube.com and I accidentally search for "utube", the first link in Google will take me to the right place. If I enter the same thing into the address bar I end up at Universal Tube and Rollform Equipment Corporation. Obviously, they are providing value with their site, but that isn't where I wanted to go.

The idea that a corporation owns a domain name is fundamentally flawed, especially in today's international marketplace. Naming implies registration, which implies that someone controls the names. How is this central registrar supposed to decide who provides value with that name and who is just squatting? ICANN can't do it, and doesn't even try. But the market can. Search engines like Google that use community data enable us, the market, to decide who is providing value. If DNS were to stop working tomorrow, searching would still work. Only the squatters and kiters that would loose out.