D
D
Dmitrii Solovev2016-01-18 17:51:56
MongoDB
Dmitrii Solovev, 2016-01-18 17:51:56

In what case will MongoDB be more productive?

In which of the two cases will MongoDB perform better?
There are accounts and transactions, each transaction has an amount and a link to the account.
It is necessary to display information to the user for each of his accounts, how much was spent, how much was earned, the balance.
The first option is to display information using the agreggation framework.
The second option is to keep fields on the account, earned, spent, total .... and update them when adding/changing a transaction. When displaying information to the user, a simple find'om will display the object.
Which option is better and more efficient?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2016-01-18
@dimonnwc3

2nd is more productive, fewer requests* - works faster.
But you need to take care that the numbers do not disperse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question