News for hackers. Stuff that matters.
Re:How to make MongoDB not suck for analytics by lomnakkus on Monday July 02, 2018 @02:32AM (#17439697)
Without wishing to put words in their mouth, I think parent poster's point might be that PostgreSQL will do at least a decent job at most things you'll want to throw at it.

This is not the case for most of the NoSQL databases where you'll pay for lack of certain features either by a) having to write a lot of code, or b) bad-to-crippling performance for use cases it wasn't meant to solve.

So, unless you're already very clear on what your exact use case is going why the spend time analysing before even getting your project off the ground?

Re:How to make MongoDB not suck for analytics by 198394549 on Monday July 02, 2018 @09:30AM (#17441438)
>This is not the case for most of the NoSQL databases where you'll pay for lack of certain features either by a) having to write a lot of code, or b) bad-to-crippling performance for use cases it wasn't meant to solve.

Can you give a common example of these? This article is referring to issues related to row vs column data stores, not sql vs nosql.

Re:How to make MongoDB not suck for analytics by stickfigure on Monday July 02, 2018 @03:19PM (#17444592)
Having implemented effectively the same customer-facing analytics problem in BQ, Keen, Mongo, and Postgres, I'll tell you specifically:

* Column stores like BQ and Keen don't let you efficiently slice and dice data by factors other than time. If you're slicing by customer or product, your queries become incredibly slow and expensive. You start writing hacky shit like figuring out when your customer's first sale was so you can narrow the time slightly, but that barely helps.

* MongoDB doesn't do joins. So you denormalize big chunks of your data, and now you have update problems because 1) you have to hunt all that down and 2) you don't have transactions that span collections. Also the aggregation language is tedious compared to SQL, requiring you to do most of the work of a query planner yourself.

* Some other person in this thread said MongoDB was faster than Postgres, but I found quite the opposite to be true. For the same real-world workload, basic aggregations on an index, we found Postgres to be much faster than Mongo. No idea what that other person is talking about.

Re:How to make MongoDB not suck for analytics by lomnakkus on Wednesday July 04, 2018 @08:07PM (#17460092)
Very well put... and this was the point I was making about "decent" performance. If you have super-special requirements (you don't), you'll probably discover it along the way to SUCCESS. If you don't any old SQL database will probably be more than sufficient AND it will be flexible enough to allow you to evolve your schema along the way.
Re:How to make MongoDB not suck for analytics by threeseed on Monday July 02, 2018 @05:05AM (#17440252)
> So, unless you're already very clear on what your exact use case is going why the spend time analysing before even getting your project off the ground?

Because if you don't know what you want you are almost guaranteed to pick the wrong technology.

Re:How to make MongoDB not suck for analytics by GenericsMotors on Monday July 02, 2018 @08:23AM (#17441035)
> Because if you don't know what you want you are almost guaranteed to pick the wrong technology.

That's one way to look at it...but a bit shortsighted.

Requirements can and do change, and a well designed model in an RDBMS will be far more extensible than a similar one in NoSQL document store. So RDBMS' aren't the "wrong" technology, they the safest bet; not to mention most modern relational DBs already out-perform mongo, so the point is sort of moot anyway.

Re:How to make MongoDB not suck for analytics by threeseed on Monday July 02, 2018 @08:49AM (#17441177)
How does one design a proper ER model without understanding the domain, query patterns etc ?

Because that sounds like magic.

Also MongoDB destroys any RDBMS (minimum 10x faster) if you have embedded structures instead of joining against 10 tables in a normalised design. Hence the importance of understanding your query patterns and domain before selecting the database.

Re:How to make MongoDB not suck for analytics by sb8244 on Monday July 02, 2018 @09:16AM (#17441333)
The world is messy. The application will grow over time and those requirements can't be known. I think the point parent is making is that a rdms will allow for that future flexibility whereas NoSQL comes with a lot of caveats that make flexibility challenging.
Re:How to make MongoDB not suck for analytics by 198394549 on Monday July 02, 2018 @09:29AM (#17441430)
What is this lack of flexibility you are speaking about? As in, actual specifics.
Re:How to make MongoDB not suck for analytics by stickfigure on Monday July 02, 2018 @04:00PM (#17444876)
I feel like this should be pretty obvious. I'm pretty sure there are students in a bootcamp somewhere learning "joins make it easy to construct complex queries; denormalization eliminates expensive joins but sacrifices flexibility and adds potential data inconsistency".

Real world example: Consider an Order table and a Visit table; conversion rates aggregate orders over visits. In Mongo you can denormalize some of the Visit data into Order, but what happens when you change the logic for computing conversion ratios? Or you want conversion ratios broken down by web browser, source tag, or any of the other data elements that live in Visit but you didn't denormalize ahead of time?

Re:How to make MongoDB not suck for analytics by mercer on Tuesday July 03, 2018 @10:38AM (#17450536)
Is that speed increase still there if you use Postgres' JSON(B) storage?