30

I'm considering MongoDB for my next big project, but I have a couple of concerns. In particular, how can I do reporting?

My understanding is that I can't do the same kinds of joins and aggregation I would normally do in a relational database. The reporting I had in mind involves aggregating a lot of data from different "tables" with strict criteria.

Is this easily doable in MongoDB, or is it going to be a big headache?

mpen
  • 272,448
  • 266
  • 850
  • 1,236
  • 1
    Pre-aggregation and incremental MR help immensely here: http://docs.mongodb.org/manual/use-cases/pre-aggregated-reports/ – Sammaye Jan 11 '13 at 17:25
  • 1
    @Sammaye: This "pre-aggregation" sounds like it requires an immense amount of forethought. At the beginning of my project I don't know what reports are going to come down the pipeline, which means I will have to write a script to "re-build" these aggregate docs, and then go back and refactor pretty much everything to keep them up to date and pray I haven't missed anything. How is this even manageable? – mpen Jan 11 '13 at 18:38
  • If it's relevant, these reports don't really have to be up-to-the-second and don't need to run in a heartbeat. Maybe 30 seconds to generate, and accurate within ~24 hours is reasonable. – mpen Jan 11 '13 at 18:41
  • So did you use MongoDB ? Were you successful in pulling out reports ? What challenges did you face ? – BeingSuman Apr 05 '20 at 11:24
  • @BeingSuman No, I don't think I ever ended up using Mongo. Requiring 3rd party tools to do something that's a non-issue in SQL just didn't seem worth-while. – mpen Apr 05 '20 at 18:47

7 Answers7

20

While Pentaho and Jaspersoft and other legacy reporting solutions have ways to pump data out of MongoDB, there are two newer solutions designed explicitly for analytics and reporting on MongoDB data:

  • JSON Studio. This is a commercial solution that lets you visually build aggregation pipelines and connect them to charts.
  • SlamData. This is an open source solution that lets you run SQL queries directly on MongoDB (including JOINs, GROUP BY, HAVING, etc), through the GUI interface or an API. The current version of the project has data visualization baked in, and allows you to create and embed reporting dash boards into MongoDB applications.

Because both of these run on top of MongoDB (versus the other approach, i.e. pumping the data out and normalizing it for reporting in Mondrian or something), they are much easier and more natural for MongoDB reporting. The flip side is that because the data is not loaded into all-memory cubes (for example), the reporting experience can suffer if you try to do complicated report generation in real-time.

Disclaimer: I'm a contributor for the SlamData project, although I have no affiliation with JSON Studio.

John A. De Goes
  • 568
  • 3
  • 7
4

It seems that the open source tools like JasperReports and Pentaho can connect to MongoDB, also if you want to jump to the NoSQL ship but without jumping to the NoSQL ship, you may use an ODBC or OLE DB driver like Simba's one, and then use any normal SQL reporting tool like DBxtra

Miguel Garcia
  • 806
  • 5
  • 9
2

In general do not use mongodb just because you wanna try something new in a production environment: that is what will bring you a lot of headaches. There is a great Stackoverflow post about when to use it: https://stackoverflow.com/a/1477354/1248724

Regarding reporting: Map-Reduce, especially incremental one will help you a lot, but you can't treat mongoDB as a relational database. It just isn't one. For example the Query for a subdocument madness. The mongoDB Aggregation-Framework will do well in most cases but has its limits compared to SQL.

Community
  • 1
  • 1
Zarathustra
  • 2,853
  • 4
  • 33
  • 62
2

If you are using .NET, easy to write reports using DexExpress reports. It works well with MongoDb .NET driver, only one limitation, you have to have strong types for each aggregation that you are using in your data. All types you can use from your main application db provider, so it will not be a big headache. If your MongoDB collections are similar to SQL data tables, you can use ODBC drivers, this way is very limited but you can use any reporting services that works with ODBC connection. I prefer to use first: "DevExpress" XtraReports.

Eugene Bosikov
  • 840
  • 10
  • 12
  • Are you affiliated with DexExpress? – mpen Nov 18 '15 at 23:59
  • No, never was affiliated. I'm just using their components for Windows and Web .NET – Eugene Bosikov Nov 24 '15 at 17:01
  • @EugeneBosikov , how do you bind the reports to the data source? any good documentation for getting started? thanks – omer schleifer Aug 11 '16 at 04:54
  • Your mongoDB data must be in strong typed format, not just a BSON type. After that you can use object source on your reports. – Eugene Bosikov Aug 25 '16 at 21:13
  • 1
    @omer-schleifer You also can download trial version devexpress, they have a very good documentation and desktop and web demo. So you just have to get right sample for you. Object source and Linq will work fine with MongoDB. – Eugene Bosikov Aug 25 '16 at 21:22
1

Not sure you can do in MongoDB all your reporting plus have sufficient response time. So you could add a tool on top of MongoDB for that purpose. E.g., icCube is now supporting MongoDB for this kind of usage. It makes no sense to extract the whole set of data but most of the time data for the reporting and analytics represent only a fraction of the whole and it makes sense to connect an in-memory OLAP tool for reporting and analytics.

Marc Polizzi
  • 9,275
  • 3
  • 36
  • 61
1

MongoDB reporting is made easier because it has the aggregation framework which provides an api that can be connected to a reporting software. Here is an article that provides details on MongoDB reporting and visualization http://blog.jinfonet.com/mongodb-reporting-visualization-jreport/

Bon
  • 21
  • 1
0

as far as I know there is no easy way to perform joins, aggregations, etc. the same way you would in a relational database in Mongo. There are different external analytics tools you can use for this. At my company we use Sisense and connect it to MongoDB via an ODBC driver, which lets us use SQL-like functionality on our data and it works great. However, I do not know of a way to do this natively in MongoDB.

Dan
  • 9
  • 1