News for hackers. Stuff that matters.
Re:MongoDB has filed to go public by jakereps on Thursday September 21, 2017 @10:10PM (#15308921)
We use it for our database engine, as the nature of our data does not work in a SQL table. I work with DNA sequencing, and we store our data in a sample metadata, feature metadata, and sample-by-feature count table.

So our sample metadata has the generic metadata about each sample (where it's from, when was it collected, etc.). Our feature metadata is the particular feature metadata (DNA amplicon sequence variant, taxonomy, all seven taxa levels pre-split). These would work perfectly fine in a standard SQL database, but the problem is when we get into our sample-by-feature table/collection. Currently, we have over 400k unique features and tens of thousands of samples. If we were to try and map the frequency of each feature in our samples in a standard row/column relational database table, our table would be un-usably large (or just entirely not work as PostgreSQL, MySQL have a hard column limit). Thus, the benefit of MongoDB's document system fixes all the issues this causes.

Each of our documents in the sample by feature table can consist of ONLY the counts of the features that were in the sample, ignoring all the other N-thousand features that may be present in others. Building a pandas DataFrame from a query of this data will just fill the absent features with NaN, and we can just fill those NaN's with zeroes and carry on working with our target subset of the database.

Re:MongoDB has filed to go public by smt88 on Thursday September 21, 2017 @10:42PM (#15309067)
Your entire response seems to be about why you chose document storage instead of relational data. Relational data makes sense most of the time, but not always.

The question, again, is why you'd use MongoDB even for document storage when there are so many alternatives that are safer and better-engineered. Even Postgres has a JSON data type that, by some reports, works better than Mongo and is much safer to use.

Another thread here[1] has gone into some detail about alternatives.

1. https://news.ycombinator.com/item?id=15308214

Re:MongoDB has filed to go public by jakereps on Thursday September 21, 2017 @11:06PM (#15309144)
If that's the case, then it's probably purely marketing. I had no idea PostgreSQL offered a comparable option.
Re:MongoDB has filed to go public by btown on Friday September 22, 2017 @01:23AM (#15309586)
JSON wasn't stable in Postgres until 2012, whereas the "web scale" memes for Mongo started after its initial release in 2009. Mongo indeed had better marketing and a first mover advantage, and it never let go.
Re:MongoDB has filed to go public by cervo on Friday September 22, 2017 @11:01AM (#15312779)
Early versions of mongodb locked the entire database server for every single write. Later versions locked the entire database for every single write. Only since Mongo 3.0 does MMAP only lock a single collection for a write and is WiredTiger available to offer you MVCC. And even in the MongoDB world materials it advertised now you can use more of your hardware.... Granted you could always shard, though that gets very expensive very quickly. Meanwhile postgresql had MVCC all along and its write speed was always faster than mongo on a single server basis. And you always could serialize data that changed into text fields as xml/json/csv/some other format. Mongo was mostly great marketing and a lousy product. Over time it has gotten much better. Mongo 3.2 is a way way way better product than mongo 1.x. But marketing did capitalize on a lot of hype which made no sense. Developers enjoyed just serializing their objects (the ones who didn't think of doing this into a text column in a relational db) and for the ones who did not need 'web scale' they had no idea about the severe concurrency issues introduced by mongo's writes. And for the rest there are plenty of posts about hacking around it or switching from Mongo to something else.
Re:MongoDB has filed to go public by chx on Friday September 22, 2017 @04:21AM (#15310274)
And it wasn't usable until practically 2015 (2014-12-18 if you so want).
Re:MongoDB has filed to go public by smt88 on Thursday September 21, 2017 @11:23PM (#15309193)
Something I don't think is mentioned elsewhere: other databases have shipped with Mongo compatibility. This means you can migrate from Mongo to something better without changing your code.

The most mainstream and interesting of these is Cosmos:

https://docs.microsoft.com/en-us/azure/cosmos-db/connect-mon...

(Cosmos is actually one of the most interesting DB products available for production right now, in my opinion.)

Re:MongoDB has filed to go public by cervo on Friday September 22, 2017 @10:15AM (#15312334)
Even prior to the JSON type you always could have serialized the data for the sample to some kind of string JSON/XML/CSV and put it in the column. But I think the one thing NOSQL data stores e.g. HBase/Cassandra and to a lesser Degree MongoDB has taught me is to pay attention to the tradeoffs number of rows, size of index, etc...
Re:MongoDB has filed to go public by deepsun on Friday September 22, 2017 @12:19AM (#15309370)
Yep, I benchmarked it myself, JSONB column type in PostgreSQL worked faster for me than same data in MongoDB (both reads and writes).
Re:MongoDB has filed to go public by tzmudzin on Friday September 22, 2017 @02:14AM (#15309782)
Maybe I misunderstood your problem, but how about a relational DB model with:

- FEATURES table (~400k rows), primary key: Feature_ID

- SAMPLES table (tens of thousands), primary key: Sample_ID

- OCCURRENCE table (what you observed), with the fields Feature_ID, Sample_ID, Occurrence_Count.

This is pretty much a standard solution well proven in data warehousing...

Re:MongoDB has filed to go public by gaius on Friday September 22, 2017 @11:36AM (#15313109)
If you process this kind of high-throughput data in R then yep, you get it as 3 data.frames as you describe, it's nicely tabular and easy to "join" by just matching index numbers.