Topic: A Question for God = David Hansson = 37signals Database?

I wish to develop and market web based applications that have distinct data for each user that operates upon them.
My intensions are nowhere near the application realm of www.37signals.com and I hope my question doesn't reveal any trade secrets.
I expect there are two ways to handle this?
1. Develop a structure so that each customer has a separate database that holds tables with identical names. There login would determine the connection to THEIR database.
2. One LARGE database's main record would be a USERRECORD and all subsequent parent -> child -> grandchild records cascade from this. I expect to CHEAT each record would hold the USERRECORD KEY?
Which method do you use at www.37signals.com?
Along similar lines, I want to create a website that is virtually identical but appears to be many distinct domains. For example I would have 12 domains that are the names of the month (Jan, Feb, Mar. etc) and the only thing different is the database they access. In this way I'd hope to maintain one source deck and be able to manage all 12 sites with reasonable effort. Not only would the database hold the chats, activities, user info, blogs, voting for each distinct site, but also TEMPLATE words such as the <h1>January</h1> . This question follows similar lines in that should I use strategy 1 or 2?
I am taking the Pragmatic Studios class in Dallas on April 18 - 20th and I'm hoping to have my projects moving in your recommended direction before I get there.
Many thanks,
David Kennedy
dak AT itracker DOT com
775-885-9125

Re: A Question for God = David Hansson = 37signals Database?

Just use one database.

Re: A Question for God = David Hansson = 37signals Database?

1. That approach violates the DRY principle..if you have repetitive table columns within different databases, then there is something fundamentally wrong with your structure and you need to rethink things. FWIW Im pretty sure that 37 signals uses one database.

2. If you want a user to only have access to certain parts of the site, then u need to set up a permissions model and then use session IDs in your controllers to filter out who gets to see what. You can also set up a has_many relationship between a user and their subsequent projects, or even do this with an Account model so you get multiple users. There are many ways you can swing it, but its useless trying to run marathons before you can crawl.

For example I would have 12 domains that are the names of the month (Jan, Feb, Mar. etc) and the only thing different is the database they access.

Huh?

Why on earth would you want to do this? You are creating big complex problems for yourself before you even start, and for what added functionality? If you ask me this is just confusing for your users, who will have to shift their bookmarks every 30 days. Perhaps you could set up some mod_rewrite magic with Apache to point to domains automagically, but what feature is this really adding to your site?

Simplicity is vastly underrated, and complexity scares people away.

If you want to have a good read (and a breather from reading about code you aren't using yet) check out Don't Make me Think

It will make you see things a lot differently