Live data from Hacker News

Think before you Mongo

blog.runnable.com

61–70 of 101 posts

Re: Think before you Mongo

#61
I think Mongo is GREAT at one very important thing:

Storing other people's data.

If you need to consume other services, especially if its more than one, it's hard to beat Mongo (or other NoSQL databases). You get a lot of search power (not always the easiest to tap, but you get it), and your app won't break when they change their formats. If you need a LOT of it, even better.

I would never use it as my main datastore, though. At least not for any projects I can think of offhand.

Re: Think before you Mongo

#63
It's absurd to use a schemaless database for the simple sake of "rapid" iteration! That is so, so incredibly inefficient. You need — NEED — to understand your domain data (its structure, volume, usage, etc.) before you even begin writing a single line of code or picking a specific DB vendor. This — and only this — will rightfully inform you of what your actual technical requirements are.

Re: Think before you Mongo

#64

Any thoughts on Amazon's DynamoDb while we all are fresh on Mongo discussion here? Thanks.

I'd like to know this too. I've just started a proof of concept s3-lambda-dynamodb project and I'd like to know what others think about it.

Also I know document dbs don't aggregate well, but wouldn't it be appropriate to have your app backend in NoSQL and have etl or other duplication to an rdbms or possibly cassandra?

Re: Think before you Mongo

#65
post #15

Earlier quoted context omitted.

but we're not talking about silver bullets: we're talking about models which let you derive most information from your data. mathematics says you will get the most bang for your buck from the relational model. if you like hierarchical databases (data trees), consider that relational database gives you a forest: you can treat any datum as your tree root and bloom from there. with hierarchical, you're tied to a single…

Speed of development and execution when I don't, and will likely never need, to query that way. I argue you ignored the silver bullet criticism and then immediately doubled down on SQL as the silver bullet.

Here is a question worth ignoring it seems:

> what purpose does precluding the latter serve?

Re: Think before you Mongo

#66

I agree... but at this point, it's tough to see with all the ink that's been spilled on these issues for years how you could think anything else. Maybe I read HN too much, but the manifold problems with MongoDB have been widely publicized for the past 6 years... it seems pretty close to conventional wisdom that you're going to have those problems if you decide to use Mongo.

You have to separate between "Mongo the database" and "Mongo as it's used by companies"; the latter causes far more problems than the former. I last used MongoDB seriously in 2012-2015. We had myriad operations problems including inconsistent indexing across shards (where some shards had an index created and others didn't, it was baffling), issues with the balancer not moving chunks properly, and more. Also it's just…

>>> Sidenote: It's also occurred to me over the past few years that it's almost impossible to impose a consistent schema on a large enough dataset

+1. I agree that NoSql promotes "careless db design" to an extent.

But yes (as an example) situations do arise where you either need to alter the existing SQL table with bazillions of rows of data in it or refactor your design in an ugly-ass way by adding a 2-column table tied to the 1st table by some FK.

Re: Think before you Mongo

#67
post #22
post #12

Earlier quoted context omitted.

I am yet to fail into this NoSQL trend. Yes, SQL does have its issues, but I am yet to work on any project where the relational data model doesn't fit. Plus all the stuff that we can do at the SQL engine level, specially data validation, is just great for the type of stuff we develop.

NoSQL is driven more by scaling issues than anything else. Joins and strong consistency are awesome but run head first into the CAP theorem and other concerns like single node performance on a sharded cluster. There is also the fact that no programming language lets you deal with relational data sanely in code, so you have the well known impedance mismatch heaeache. All popular languages I've seen offer hierarchical…

SQL is a relatively popular programming language that lets you deal quite sanely with relational data.

Then there's Prolog, Kanren, Mercury… which are admittedly not especially popular.

The so-called “impedance mismatch” comes mostly from people who don't understand all that SQL can do and inevitably end up replicating it in some other language.

Re: Think before you Mongo

#68

Earlier quoted context omitted.

That'd just be Postgres. When you need an schema you use a normal table, when you need arbitrary JSON data you use a JSON schema.

I don't think so -- I'm looking for a database that will actually enforce a JSON schema for you -- I don't think Postgres has any built-in support for JSON schematization. I could always do validation before inserting data, but that opens me up to error on my side which I'd like to avoid=)

You are trying to hammer a screw in. If what you want is a facility for the database to provide you with JSON on query, Postgres has a couple of functions for that, namely array_to_json and row_to_json: https://www.postgresql.org/docs/9.2/static/functions-json.ht...

Re: Think before you Mongo

#69

I agree... but at this point, it's tough to see with all the ink that's been spilled on these issues for years how you could think anything else. Maybe I read HN too much, but the manifold problems with MongoDB have been widely publicized for the past 6 years... it seems pretty close to conventional wisdom that you're going to have those problems if you decide to use Mongo.

You have to separate between "Mongo the database" and "Mongo as it's used by companies"; the latter causes far more problems than the former. I last used MongoDB seriously in 2012-2015. We had myriad operations problems including inconsistent indexing across shards (where some shards had an index created and others didn't, it was baffling), issues with the balancer not moving chunks properly, and more. Also it's just…

I agree with your points about typical database usage. Could it be that some of the people who reach for a database don't in fact know what a particular database implementation (like Mongo, or MySQL, or Redis) actually does, and they're just looking for a black-box that holds data at rest and occasionally gives it back out?

Re: Think before you Mongo

#70
post #22
post #12

Earlier quoted context omitted.

I am yet to fail into this NoSQL trend. Yes, SQL does have its issues, but I am yet to work on any project where the relational data model doesn't fit. Plus all the stuff that we can do at the SQL engine level, specially data validation, is just great for the type of stuff we develop.

NoSQL is driven more by scaling issues than anything else. Joins and strong consistency are awesome but run head first into the CAP theorem and other concerns like single node performance on a sharded cluster. There is also the fact that no programming language lets you deal with relational data sanely in code, so you have the well known impedance mismatch heaeache. All popular languages I've seen offer hierarchical…

> There is also the fact that no programming language lets you deal with relational data sanely in code, so you have the well known impedance mismatch heaeache.

The "Object-Relational impedance mismatch" is not a result of the supposed fact that "no programming language lets you deal with relational data sanely in code", its a result of the fact that industrially popular object-oriented languages, of the time when the term was coined, did not align well with the data model supported by then-existing relational databases, and vice versa.

Post reply on HN