3 ms·
I've used MongoDB recently for the first time, for an internal project. Being schemaless, I believe it did speed up development time significantly, and allowed
by toyg 11y ago
I've used MongoDB recently for the first time, for an internal project. Being schemaless, I believe it did speed up development time significantly, and allowed me to add stuff more gradually, but you could say that's just a way to indulge a certain laziness of design. Now that the project has matured, stepping back I can see how a relational database would be a better fit, but if I had used a rdbms from the beginning I might have not "shipped" quite as quickly. Swapping it out for a real rdbms will mean changing a couple of classes anyway, nothing dramatic.
So uhm, I don't agree that it's not good for prototyping; if your final code ends up having a decent abstraction level, it should not matter what you picked on day 1 anyway.
- jimbokun 11y agoThe article mentions CouchDB and other schematic-less, document DBS, which should be equally good for prototyping but suck less.
- cwyers 11y agoI don't understand why a schemaless database is so great for prototyping. Most of the pain from schema changes is when you have a lot of code or a lot of users depending on an existing schema, so it's hard to change (or at least, hard to change while maintaining uptime). Running ALTER TABLE on a small dataset with almost no users is trivial.
- toyg 11y agoIt might be trivial but it's another thing to do, which is is simply not there otherwise.
- rdtsc 11y agoSchemaless is just one aspect the other one is clustering/replication. Not sure about MongoDB but CouchDB has master-less peer to peer replication built in. That is hard to bolt-on later on top of Postgres and other databases. Just saying that is another factor in play, not just schema vs no-schema.
- bsg75 11y agoA lot of ALTER angst comes from MySQL where any table alter results in a full table lock and copy. In most other RDBMS, column addition and some type changes are a quick metadata change.
- jeremysmyth 11y agoNot all: https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-...
- joepie91_ 11y ago> but if I had used a rdbms from the beginning I might have not "shipped" quite as quickly. I doubt that. As mentioned in the article, migrations with rollbacks basically solve this problem, and let you iterate through schemas quickly. > Swapping it out for a real rdbms will mean changing a couple of classes anyway, nothing dramatic. In theory, perhaps, but I have yet to see that in practice. I do freelance code review and tutoring for a living, and in every case I've seen, a significant amount of work would be needed to move to a different database.
- toyg 11y ago> As mentioned in the article, migrations with rollbacks basically solve this problem Maybe so, but as I said above, they are another thing to do at a time when things are changing fast and one is more worried about checking whether the application "makes sense" than proving its correctness, so to speak. > I do freelance code review and tutoring for a living, and in every case I've seen, a significant amount of work would be needed Well, duh: if this weren't the case, you wouldn't have been involved in the first place :) What company calls consultants to review code they know how to fix themselves in a few minutes?