5 ms·
>because the developer and deployment experience is so good. That was ironic, right? http://php.net/manual/en/mongo.sqltomongo.php http://php.net/manual/en/mon
by jsemrau 12y ago
>because the developer and deployment experience is so good.
That was ironic, right?
http://php.net/manual/en/mongo.sqltomongo.php http://php.net/manual/en/mongo.sqltomongo.php
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- aikah 12y agoStrangely,there is no JOIN example ...
- Xylakant 12y agoWell, you won't find one. That's a property of the way the system works. It can be either good or bad, but you won't find an example on how to store and query whole documents with a map/reduce implementation on an SQL database. Both can be either a good fit or a bad fit to your needs - I've seen project that leveraged CouchDB to basically return all data for any given view with a single query from a pre-calculated view, something which would have impossible with an SQL database. That's a good fit. Using a document store as drop-in-replacement for an SQL dabase is most of the time a very very bad fit. The general issue that I often see is that people don't choose their databases by "is this a good fit or a bad fit for our use case" but rather by "that looks cool" or "we need that to attract talent" or "we did that project with X, so X is also fine for that new, totally different thing". And then they also try and stick with it at all costs, instead of acknowledging that the choice was a bad fit. And then they call you and say "we have an X database in flames, can you come in and rescue our data? Best would be yesterday?" This is not restricted to document databases. I've seen apps run on mysql on a cluster with 10 Sun XFires where after a man-month of index-optimization 3 would have been sufficient. That was like shooting dead fish in a dry barrel. A lot of developers don't want to bother with stuff like "how does that complicated piece of machinery actually behave if I push it."
- gozzoo 12y ago> I've seen project that leveraged CouchDB to basically return all data for any given view with a single query from a pre-calculated view, something which would have impossible with an SQL database. This sounds interesting. I've been looking for a good example where NoSQL db is better than relation db. Could you provide more details.
- lgas 12y agoPostgresql has materialized views now: http://www.postgresql.org/docs/9.3/static/sql-creatematerializedview.html http://www.postgresql.org/docs/9.3/static/sql-creatematerial... Unless I'm misunderstanding what Xylakant means, that's certainly doable in Postgresql and has been in other relational databases for a long time.
- Xylakant 12y agoI didn't mean "view" in the sense of "database view" but rather in the sense of "page view". All data displayed on a page with multiple types of documents was returned in a single query. That's certainly doable in pg, but requires a lot of hacks and it's not efficient. Or you can use hstore and basically use pg as a nosql db.
- lgas 12y agoAh, that makes sense, though couldn't you solve this by something like creating a table called 'pages' and storing the materialized JSON (the same that mongo would generate) in the table?
- Xylakant 12y agoSure, you could. But CouchDB just makes that very easy to do while it is very hard and hacky in PG. On the flip side, the use case did not require the guarantees that PG has to offer, so why go through the pain for no gain :)