What types of data queries are too complicated for CouchDB (unlike SQL)? Search for specific examples

I think CouchDB is really cool and wants to use it more. But I would also like to know in advance if there are any types of data queries that are easily executed in MySQL but impossible or very inconvenient to execute in CouchDB.

Please answer specific answers or examples, instead of just saying that "CouchDB is for documents, and MySQL is for relational data." I really don't know what this statement means, since it seems like you can do things functionally equivalent to MySQL relational joins with CouchDB views.

For example, I read that paginating a dataset is a bit inconvenient in CouchDB. This is the answer I'm looking for.

+4
source share
3 answers

The problem I'm currently facing is displaying an AJAX grid with content from the CouchDB database. Equivalent SQL query:

SELECT * FROM the_table WHERE {filter_col} = {filter_value} [ AND ... ] ORDER BY {order_col} LIMIT {n} OFFSET {m} 

This is a fairly simple query to run in a traditional SQL database, but simultaneously filtering, organizing, and swapping in general beyond what CouchDB indexing can control - at least without creating an insane number of different views.

+4
source

Couchdb has difficulty with full-text search (unless external software is used), although mysql is not particularly good at this, the couch is even worse.

Couchdb is not going to do a good job when your data model implies multiple and complex relationships between objects, after all, it is a document-based system, not relational dbms.

In addition, IMO coupe rules.

EDIT: In particular, when you need to relax, of course! :)

+2
source

It all depends on the motivation for changing data warehouses. What problem or architectural problem are you trying to overcome with MySQL that CouchDB can solve? If at the end of the day there is no difference in functionality or performance, then refactoring to change database platforms cannot be justified.

Take a look at some ORM frameworks that, if implemented correctly, will allow you to easily replace databases.

+1
source

Source: https://habr.com/ru/post/1335632/


All Articles