It depends. Mostly I'm interested in the full data of every document so
I'm simply using view collation to get a list of all belonging documents
and transform them into the structure I need later.
Don't pretend to get the data from CouchDB/PouchDB in exactly the
structure you need. CouchDB is good at filtering the documents you need
(range queries) and retrieve them in the correct order. Structure
transforms can be easily done client side, often even in a memory
efficient streaming way.
Johannes
On 24.07.2016 14:22, Matteo Grolla wrote:
> Do you use the approach of relying on views to aggregate the
> information, on couch or on pouch?
> If I understood well couch is much more efficent at recomputing
> aggregates since it keeps partial results on a b-tree, while pouch
> always recomputes the reduce value from map outputs
>
> Il giorno giovedì 21 luglio 2016 19:10:18 UTC+2, Johannes Jörg Schmidt
> ha scritto:
>
> I prefer to design small, mostly immutable documents and use views
> to efficiently aggregate data from multiple documents.
>
> The benefits of using many small documents are mostly
> - less conflicts
> - improved replication performance (a similar optimisation for high
> revisions docs require upcoming CouchDB 2.0)
>
> More about document modelling in CouchDB:
>
http://ehealthafrica.github.io/couchdb-best-practices/#document-modeling
> <
http://ehealthafrica.github.io/couchdb-best-practices/#document-modeling>
>
> Johannes
>
>
> 2016-07-21 14:22 GMT+02:00 Matteo Grolla <
matteo...@gmail.com
> <javascript:>>:
>
> I have to decide between two design
>
> 1) simpler, multiple entities are contained within the same
> pouchdb document
> 2) each entity has it's own pouchdb document
>
> design 1) may lead to hundreds of revisions, even pass the 1000
> revs in few years, design 2 doesn't have this problem
>
> Should I go straight for 2) or is 1) still a good candidate?
>
> What are the cons of having many revisions?
> I've had troubles when I deleted many hundreds of revisions for
> a doc, browser was becoming non responding
> In the hp that I have hundreds of revisions not in conflicts, if
> I compact the db and then delete the last rev I shouldn't have
> problems right? Or is it still inefficent?
> If I have hundreds of revisions in conflicts I have to delete
> them one by one and I had problem in this case (which shouldn't
> happen)
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "PouchDB" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
pouchdb+u...@googlegroups.com <javascript:>.
> <javascript:>.
> <
https://groups.google.com/d/msgid/pouchdb/0d1e92a4-0b69-41ee-8c08-25ae813d6503%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <
https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "PouchDB" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
pouchdb+u...@googlegroups.com
> <mailto:
pouchdb+u...@googlegroups.com>.
> <mailto:
pou...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/pouchdb/b8aa23ae-4f51-4ab8-846f-b7d465b2254f%40googlegroups.com
> <
https://groups.google.com/d/msgid/pouchdb/b8aa23ae-4f51-4ab8-846f-b7d465b2254f%40googlegroups.com?utm_medium=email&utm_source=footer>.