CouchDB Document modellingMongoDB or CouchDB - fit for production?Principles for Modeling CouchDB DocumentsAggregating data with CouchDB reduce functionCouchDB - Basic design for joins dataCouchDB map/reduce by any document property at runtime?Using CouchDB and Redis together for transactional dataWhen to use CouchDB over MongoDB and vice versacouchDB: view that returns NOT NULL values, doesn't return NULL valuesWhy do CouchDB Reduce Functions have to be Commutative?Sum values in CouchDB documents
Phonetic distortion when words are borrowed among languages
Creating specific options in `Manipulate[]`
The differences amongst f[x_], f[x__], and f[x___]
How do my husband and I get over our fear of having another difficult baby?
Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails
French license plates
Beyond Futuristic Technology for an Alien Warship?
What is the logical distinction between “the same” and “equal to?”
How important is knowledge of trig identities for use in Calculus
How to stop the death waves in my city?
How to study endgames?
Why isn't there armor to protect from spells in the Potterverse?
What would happen if I build a half bath without permits?
Isn't the detector always measuring, and thus always collapsing the state?
Is the "spacetime" the same thing as the mathematical 4th dimension?
If someone asks a question using “quién”, how can one shortly respond?
Can you cure a Gorgon's Petrifying Breath before it finishes turning a target to stone?
How do we know neutrons have no charge?
Is there an in-universe explanation of how Frodo's arrival in Valinor was recorded in the Red Book?
Can an energy drink or chocolate before an exam be useful ? What sort of other edible goods be helpful?
How to add the real hostname in the beginning of Linux cli command
How does Monks' Improved Unarmored Movement work out of combat?
Avoiding dust scattering when you drill
How to work around players whose backstory goes against the story?
CouchDB Document modelling
MongoDB or CouchDB - fit for production?Principles for Modeling CouchDB DocumentsAggregating data with CouchDB reduce functionCouchDB - Basic design for joins dataCouchDB map/reduce by any document property at runtime?Using CouchDB and Redis together for transactional dataWhen to use CouchDB over MongoDB and vice versacouchDB: view that returns NOT NULL values, doesn't return NULL valuesWhy do CouchDB Reduce Functions have to be Commutative?Sum values in CouchDB documents
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
[TLDR] Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
Background info:
In my Point of Sale (POS) application, all the transactions are logged and created separate document.
"_id": "sale_transactions_1234124", "Quanity Added": 0, "Quanity reduced": 10, "Is Discarded": "false", "saleid": "sales_523"
"_id": "Purchaseorder_transactions_1234124", "Quanity Added": 5, "Quanity reduced": 0, "Is Discarded": "false" , "purchaseid": "purchase_2352"
Whenever the inventory is modified, relevant documents are created as transactions
it is _id field. So instead of store Total sold, Quantity in hand
in Item
document, have plan to create map reduce view to retrieve every time.
Every time when I make a sale, Quantity in hand
map reduce function should be called, to check whether the quantity is greater than zero. For this approach will I encounter any performance issue, or did you recommend create Total sold, Quantity in hand
in Item document
So every time we call map reduce function, is couchdb some how cache non-modified document results and process new and modified documents, or is it process all the documents in every time?
couchdb
|
show 3 more comments
[TLDR] Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
Background info:
In my Point of Sale (POS) application, all the transactions are logged and created separate document.
"_id": "sale_transactions_1234124", "Quanity Added": 0, "Quanity reduced": 10, "Is Discarded": "false", "saleid": "sales_523"
"_id": "Purchaseorder_transactions_1234124", "Quanity Added": 5, "Quanity reduced": 0, "Is Discarded": "false" , "purchaseid": "purchase_2352"
Whenever the inventory is modified, relevant documents are created as transactions
it is _id field. So instead of store Total sold, Quantity in hand
in Item
document, have plan to create map reduce view to retrieve every time.
Every time when I make a sale, Quantity in hand
map reduce function should be called, to check whether the quantity is greater than zero. For this approach will I encounter any performance issue, or did you recommend create Total sold, Quantity in hand
in Item document
So every time we call map reduce function, is couchdb some how cache non-modified document results and process new and modified documents, or is it process all the documents in every time?
couchdb
1
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
I would just edit this one.
– Flimzy
Mar 29 at 8:10
|
show 3 more comments
[TLDR] Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
Background info:
In my Point of Sale (POS) application, all the transactions are logged and created separate document.
"_id": "sale_transactions_1234124", "Quanity Added": 0, "Quanity reduced": 10, "Is Discarded": "false", "saleid": "sales_523"
"_id": "Purchaseorder_transactions_1234124", "Quanity Added": 5, "Quanity reduced": 0, "Is Discarded": "false" , "purchaseid": "purchase_2352"
Whenever the inventory is modified, relevant documents are created as transactions
it is _id field. So instead of store Total sold, Quantity in hand
in Item
document, have plan to create map reduce view to retrieve every time.
Every time when I make a sale, Quantity in hand
map reduce function should be called, to check whether the quantity is greater than zero. For this approach will I encounter any performance issue, or did you recommend create Total sold, Quantity in hand
in Item document
So every time we call map reduce function, is couchdb some how cache non-modified document results and process new and modified documents, or is it process all the documents in every time?
couchdb
[TLDR] Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
Background info:
In my Point of Sale (POS) application, all the transactions are logged and created separate document.
"_id": "sale_transactions_1234124", "Quanity Added": 0, "Quanity reduced": 10, "Is Discarded": "false", "saleid": "sales_523"
"_id": "Purchaseorder_transactions_1234124", "Quanity Added": 5, "Quanity reduced": 0, "Is Discarded": "false" , "purchaseid": "purchase_2352"
Whenever the inventory is modified, relevant documents are created as transactions
it is _id field. So instead of store Total sold, Quantity in hand
in Item
document, have plan to create map reduce view to retrieve every time.
Every time when I make a sale, Quantity in hand
map reduce function should be called, to check whether the quantity is greater than zero. For this approach will I encounter any performance issue, or did you recommend create Total sold, Quantity in hand
in Item document
So every time we call map reduce function, is couchdb some how cache non-modified document results and process new and modified documents, or is it process all the documents in every time?
couchdb
couchdb
edited Apr 10 at 6:04
Nest
asked Mar 28 at 20:07
NestNest
882 silver badges17 bronze badges
882 silver badges17 bronze badges
1
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
I would just edit this one.
– Flimzy
Mar 29 at 8:10
|
show 3 more comments
1
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
I would just edit this one.
– Flimzy
Mar 29 at 8:10
1
1
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
I would just edit this one.
– Flimzy
Mar 29 at 8:10
I would just edit this one.
– Flimzy
Mar 29 at 8:10
|
show 3 more comments
1 Answer
1
active
oldest
votes
Yes CouchdDB caches your map/reduce documents. So if you query the same view multiple times Couch will give you the cached version. If additional datasets are added to the database Couch will update the view.
To see that Couch caches the views you can try to create a new view on a database with a lot of documents:
- Call the view for the first time and you will see that it takes some time to get your result.
- Call your view again and it will be ready immediately.
- Add a few new documents to your database
- Call your view and it will be ready very fast if not immediately.
- Add a lot of new documents to your database
- Call your view again and it will take more time than when you just added a few new documents. But will be ready immediately after it is build up.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406041%2fcouchdb-document-modelling%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes CouchdDB caches your map/reduce documents. So if you query the same view multiple times Couch will give you the cached version. If additional datasets are added to the database Couch will update the view.
To see that Couch caches the views you can try to create a new view on a database with a lot of documents:
- Call the view for the first time and you will see that it takes some time to get your result.
- Call your view again and it will be ready immediately.
- Add a few new documents to your database
- Call your view and it will be ready very fast if not immediately.
- Add a lot of new documents to your database
- Call your view again and it will take more time than when you just added a few new documents. But will be ready immediately after it is build up.
add a comment
|
Yes CouchdDB caches your map/reduce documents. So if you query the same view multiple times Couch will give you the cached version. If additional datasets are added to the database Couch will update the view.
To see that Couch caches the views you can try to create a new view on a database with a lot of documents:
- Call the view for the first time and you will see that it takes some time to get your result.
- Call your view again and it will be ready immediately.
- Add a few new documents to your database
- Call your view and it will be ready very fast if not immediately.
- Add a lot of new documents to your database
- Call your view again and it will take more time than when you just added a few new documents. But will be ready immediately after it is build up.
add a comment
|
Yes CouchdDB caches your map/reduce documents. So if you query the same view multiple times Couch will give you the cached version. If additional datasets are added to the database Couch will update the view.
To see that Couch caches the views you can try to create a new view on a database with a lot of documents:
- Call the view for the first time and you will see that it takes some time to get your result.
- Call your view again and it will be ready immediately.
- Add a few new documents to your database
- Call your view and it will be ready very fast if not immediately.
- Add a lot of new documents to your database
- Call your view again and it will take more time than when you just added a few new documents. But will be ready immediately after it is build up.
Yes CouchdDB caches your map/reduce documents. So if you query the same view multiple times Couch will give you the cached version. If additional datasets are added to the database Couch will update the view.
To see that Couch caches the views you can try to create a new view on a database with a lot of documents:
- Call the view for the first time and you will see that it takes some time to get your result.
- Call your view again and it will be ready immediately.
- Add a few new documents to your database
- Call your view and it will be ready very fast if not immediately.
- Add a lot of new documents to your database
- Call your view again and it will take more time than when you just added a few new documents. But will be ready immediately after it is build up.
answered Apr 11 at 10:52
Jay BeeJay Bee
761 silver badge7 bronze badges
761 silver badge7 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406041%2fcouchdb-document-modelling%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Is your question simply: Does CouchDB cache and reuse the results of map/reduce functions for non-modified documents?
– Flimzy
Mar 29 at 7:20
Yes. If it always cache, instead of storing values, is it good practice to rely map-reduce function.
– Nest
Mar 29 at 7:34
You could just ask that question, without all the unnecessary background info :)
– Flimzy
Mar 29 at 7:36
You are right. Shall I edit this question or ask new question?
– Nest
Mar 29 at 8:08
I would just edit this one.
– Flimzy
Mar 29 at 8:10