mongodb - CouchBase NOSQL announced JOIN support. What are the disadvantages to use them? -


i assumed nosql (cassandra, couchdb, couchbase, mongodb, etc.) document oriented (no join). typical sentence: "if need join, use sql database (mysql, postgresql, etc.)"

but now, couchbase announced n1ql (developer preview 4) join support:

http://blog.couchbase.com/introducing-developer-preview-for-couchbase-server-4.0

try online:

http://query.pub.couchbase.com/tutorial/#42

so, confusing. couchbase first nosql database join support? there disadvantages in using it? why others nosql database (like mongodb, couchdb, cassandra, etc.) did not implement it?

yes, several nosql databases use json document model (e.g. couchbase, mongodb). however, document-oriented not have mean "no joins". rdbmss postgresql , mysql expect disassemble objects flat tables writing, , use joins reassemble objects reading. called impedance mismatch.

json document databases can store full objects directly, there no impedance mismatch. however, objects have relationships other objects, , need query across relationships. example, movies , actors related objects, , if wanted list movie details along how many awards actors have won, need join.

in summary, rdbmss postgresql , mysql have impedance mismatch, must use joins both object assembly , relationships. json document databases not have joins not allow query across relationships, must implement logic in application, using multiple queries. finally, json document database provides joins, gives benefits of both: (1) there no impedance mismatch , no disassembly / assembly, , (2) can query across relationships between objects. why couchbase providing joins in n1ql.

there no reason have disadvantage when using joins in couchbase. joins useful when used right reason (relationships), , couchbase data model (json) allows avoid "bad" joins (for impedance mismatch , assembly / disassembly).


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -