couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garren Smith <gar...@apache.org>
Subject Re: Insight regarding the strategy with Mango
Date Mon, 10 Apr 2017 15:40:51 GMT
Hi Reddy,

Some good questions. I don't think Mango will ever replace Map/Reduce
completely. It is an alternative querying tool. What is great about the
Mango query syntax is that it is a lot easier to understand and get
started. And we can use it in a lot of places outside of just querying for
documents. It can be used for replication filtering and the changes feed.
We hope to soon have support for validation doc updates as well.

Underneath Mango is using erlang map/reduce. Which means it is creating a
B-tree index just like map/reduce. What makes it faster is that it is using
erlang/native functions to create the B-Tree instead of javascript. I wrote
a blog post a long time ago about the internals of PouchDB-find [1] which
is the mango syntax for PouchDB. It might help you understand a little more
how the internals work. The key thing to understand is that there is a Map
query part which uses the B-Tree and an in-memory filter. Ideally the less
memory filtering you do the faster your query will be.

I would say that Mango is very much a work in process but the basic ground
work is done. There are definitely things we can improve on. I've seen it
used quite a bit when developers start a new project because its quick and
simple to do basic querying, like find by email address or find all users
with the name "John Rambo".

Hope that helps.

Cheers
Garren

[1]
http://www.redcometlabs.com/blog/2015/12/1/a-look-under-the-covers-of-pouchdb-find

On Sun, Apr 9, 2017 at 1:07 PM, Reddy B. <reddy.b@live.fr> wrote:

> Hello !
>
>
> Could someone address this question raising points increasingly intriguing
> people :
>
>
> http://stackoverflow.com/questions/40753347/couchdb-
> mango-performance-vs-map-reduce-views
>
>
> It relates to how Mango works behind the scenes (to avoid performance
> gotchas), and also asks for clarification for the release notes of 2.0.0
> saying "We recommend all new apps start using Mango as a default." (will
> Map/Reduce be deprecated ?)
>
>
> [https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=
> 73d79a89bded]<http://stackoverflow.com/questions/40753347/couchdb-mango-
> performance-vs-map-reduce-views>
>
> Couchdb Mango Performance vs Map Reduce Views - Stack Overflow<
> http://stackoverflow.com/questions/40753347/couchdb-mango-performance-vs-
> map-reduce-views>
> stackoverflow.com
> I recently tried to switch my app over to using Mango queries, with the
> result of scrapping it completely and switching back to map/reduce. Here
> are a few of my reasons:
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message