User Last Access Time for CouchDB

I am new to CouchDB, but this is not related to the problem. The question is simple but not clear to me.

For example: Boris was on the site 5 seconds ago and looked through his profile, which Ivan sees in him.

How to implement this function (user last access time)?

The problem is that if we update the user profile document in CouchDB, for example. last_access_time property, every time the page is refreshed, we will have the most relevant information (with MySQL we did it this way), but on the other hand, we will have the document _rev somewhere around 100000 ++ by the end of the day.

So how do you do this or do you have any ideas?

+3
source share
3 answers

, . .

, , . 5 60 .

, . 86 400 . 5- , 17 280; 60 - 1440.

. , . 5 , . .

. _update CouchDB, , , . POST /db/_design/my_app/_update/last-access/the_doc_id?time=2011-01-31T05:05:31.872Z. : , , .

+2

() , , () , , .

- , Redis , , MongoDB, ( ) , CouchDB.

+1

CouchDB . , MySQL. _rev .

, . CouchDB , , , . ( , .)

  • , ( , , seq_id)
  • .
  • Always have sufficient disk capacity and I / O bandwidth to support compaction. Math worst case: you need 2x database size and 2x write speed; however, most applications require less. Since you are updating documents, not adding them, you will need a way .
0
source

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


All Articles