News for hackers. Stuff that matters.
Re:"How hard can it be to implement?" by kristiandupont on Wednesday September 08, 2010 @05:02PM (#1673489)
Should you implement something with an array or a linked list? That depends. Should it be fast to locate an element in the middle? Or should it be cheap to add another element regardless of the size? Ideally, both, but you weigh the pros and cons and choose one. And even if it is the right choice, you might still run into situations where the other choice would have been better and people will comment that your decision was stupid.
Re:"How hard can it be to implement?" by vog on Wednesday September 08, 2010 @05:43PM (#1673618)
This is not necessarily about whether the denormalized database structure is appropriate. It is more about:

Why the h... doesn't their ORM, or even better their database, already take care of cascading updates?

Why does it have to be implemented manually for every code that updates something? (... which is of course expensive and prone to errors)

Re:"How hard can it be to implement?" by gaius on Thursday September 09, 2010 @12:37AM (#1674423)
Exactly. I can imagine that they thought they were being very clever using ORM + MySQL instead of writing SQL to run on a more mature RDBMS. Well, decisions like that often result in you painting yourself into a corner. There's a reason that MySQL is free yet people still pay for Oracle...
Re:"How hard can it be to implement?" by vog on Thursday September 09, 2010 @05:18AM (#1674852)
I was not thinking of Oracle here. PostgreSQL is free software and offers almost everything you expect from a real database.

So I guess the main reason people pay for Oracle is because they only know about MySQL and not about PostgreSQL.

Re:"How hard can it be to implement?" by gaius on Thursday September 09, 2010 @08:46AM (#1675125)
You're probably right. I've never understood why Postgres has such a small mindshare. Between Postgres and SQLite, there ought to be no ecological niche for MySQL to exist...
Re:"How hard can it be to implement?" by jemfinch on Thursday September 09, 2010 @11:07AM (#1675609)
MySQL does (did, at least; Postgres has been improving) replication better. Replication is really important for high availability, which almost everyone needs.

The irony, of course, is that a single Postgres server is frequently (IME) more reliable than multiple MySQL servers even when the latter is setup for HA.

Re:"How hard can it be to implement?" by vog on Thursday September 09, 2010 @07:45PM (#1677368)
In addition, replication is the next thing where PostgreSQL is vastly improving (according to their road map).

Also note that if you want to trade some of the ACID properties for better performance and replication, the so-called NoSQL databases (CouchDB etc) seem to be a better trade-off than, say, MySQL with MyISAM instead of InnoDB.

Re:"How hard can it be to implement?" by jemfinch on Wednesday September 08, 2010 @05:51PM (#1673643)
Whatever the case, when I see a programmer doing a linear search through a linked list, I think you must agree that I'm justified in saying that I have no reason, based on that observation, to trust in that programmer's competence. In fact, I think it could easily be argued that in the absence of additional data, it would actually constitute a reason not to trust the programmer's competence.

While I fully agree that trade offs like yours do occur in our profession, their mere existence is no argument against my initial non-trust of 37signals' competence: you need to actually demonstrate that this problem is one of those cases, and I think that would be difficult to do.

The problem of associating entities in a way that their associations can be modified easily and consistently (i.e., normalization) is effectively a solved problem. Just like the programmer complaining that his program is slow because he's doing a linear search through a linked list, a BaseCamp programmer complain that a requested feature is difficult to implement because their data is in an abnormal form does not inspire confidence, and certainly gives no reason to trust his competence.

Re:"How hard can it be to implement?" by ellyagg on Wednesday September 08, 2010 @07:15PM (#1673849)
> Whatever the case, when I see a programmer doing a linear search through a linked list, I think you must agree that I'm justified in saying that I have no reason, based on that observation, to trust in that programmer's competence. In fact, I think it could easily be argued that in the absence of additional data, it would actually constitute a reason not to trust the programmer's competence

In Erlang, the most common data structure is the linked list. There's no way to search them other than linearly. You are claiming that in general we should suspect that Erlang programmers are incompetent?

Re:"How hard can it be to implement?" by Dylan16807 on Wednesday September 08, 2010 @08:01PM (#1673943)
Only the ones that won't switch to a log-performance data structure when it's causing them trouble.
Re:"How hard can it be to implement?" by ericd on Thursday September 09, 2010 @01:11AM (#1674458)
If the worst case size of that linked list is small, then I would say that I would trust that programmer more than the one that throws every searched linked list into a tree structure regardless of size.

In the case of sharding by project, it actually seems like a decent move given that a single Basecamp account has potentially large space requirements (75 GB), and you can't realistically provision enough space on a box to meet all the needs of a bunch of expanding accounts on that box. Being able to throw an entire project onto a new server and assuming that everything associated with a project is on that one server are both nice simplifying assumptions which seem like they would strike a nice balance.

Please stop painting everything with broad black and white strokes, programming and business in general are frequently more about striking the right balance of compromises than about knowing the "best" way to do things. There's usually not a universal "best". 37Signals seem to be doing a marvelous job balancing those compromises between their various disciplines, especially given their massive success with customers.

Edit: This is assuming they're storing attachment files on the same machine, which might very well be wrong. It would be pretty hard for one group to get up to 75GB of todo's and other text content...

Re:"How hard can it be to implement?" by anthonyb on Thursday September 09, 2010 @06:16AM (#1674928)
Basecamp is written in Ruby, so the choice is really a hash or a list. Either way, it's not likely to be your bottleneck in a web app.