query on linked documents properties (v3)

27 views
Skip to first unread message

Marco

unread,
Aug 20, 2014, 4:28:46 PM8/20/14
to rav...@googlegroups.com
Two separate documents

COMPANY with Id, Name, Addresses, etc.
ORDER with CompanyId, CompanyName, OrderLines, etc.

What is the proper way to support querying like:
- all companies in country X with no orders
- all companies in country X with orders with a specific product
etc..

mind the etc. .. i can't predict every possible query demand from the customer.

I understand that you can use LoadDocument inside an index, but with potential performance issues..Correct?

Thanks

Chris Marisic

unread,
Aug 20, 2014, 5:30:57 PM8/20/14
to rav...@googlegroups.com
Can you probably solve all those queries with indexes? Sure. Is that a great solution? Not really.

The real answer is you export / replicate the data to a OLAP system for adhoc querying. RavenDB is built for OLTP, "take my order, make business money". OLAP is built for "answer my random question of the moment". Note that this could be all kind of things such as ROLAP using standard Sql Server, Access, even Excel; or it could be a datawarehouse in Sql Server, Teradata, Informatica, Cognos, SAP etc.

Kijana Woodard

unread,
Aug 20, 2014, 6:42:54 PM8/20/14
to rav...@googlegroups.com
Chris' answer is good depending on the depth of the queries and on how "ad hoc" they truly are. You don't want to go spelunking through your oltp production database. People do that with rdbms all the time and it seems fine....until some stray query crashes the app during peak sales time.

That said, you may be able to satisfy some of your requirements with http://ravendb.net/docs/2.5/client-api/querying/dynamic-aggregation.


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco

unread,
Aug 21, 2014, 2:51:25 AM8/21/14
to rav...@googlegroups.com
So may i conclude that full dynamic querying is not possible without replicating the information to a relation database?

How are other people solving this? because from the customer point of view 'the information is stored in the database so why can't you give me the results for my question/query''?

Thanks

Oren Eini (Ayende Rahien)

unread,
Aug 21, 2014, 3:26:48 AM8/21/14
to ravendb
We _can_ give you those results, sure. The question is what sort of queries you need to do.
The queries you listed are pretty easy to handle via multi map/reduce indexes.
The issue is whatever you just want to explore the data (possible, but not a core scenario for RavenDB) or you know what sort of reports you need, in which case RavenDB will blow most other solutions out of the water.



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811



Marco

unread,
Aug 21, 2014, 3:41:06 AM8/21/14
to rav...@googlegroups.com
But can we create complex queries over multiple 'related' documents (multiple levels) without performance problems? (where the number of the total documents is at max 300.000)

Oren Eini (Ayende Rahien)

unread,
Aug 21, 2014, 3:46:35 AM8/21/14
to ravendb
Yes, you can, if you specify the thing you want to pull in advance
Reply all
Reply to author
Forward
0 new messages