I have the web application that provides user with the interface to edit its character. When user makes some changes and saves them, I store it as delta in MongoDB. UI and backend communicate via REST.

But in addition, I want to store any change that user made on UI - like clicking the button, or updated some parameter without saving yet. Something akin a separate mechanism that tracks user actions.

Will REST suffice for that? Or will it lead to spam of REST requests? Because user or multiple users may do a lot of changes thus it will lead to multiple REST calls.


Yes, you see this commonly with heatmap generation and marketing tools for websites.

As the processing power for each request is small, simply an insert, a webserver can easy handle lots of requests.

If you could choose your protocol you might go for UDP rather than HTTP over TCP, but you are limited by having to have your code run in a browser over the internet

  • so REST is way to go? I thought Websockets or something else will be faster.
    – lapots
    Apr 4 '19 at 8:46
  • Websockets seems more appropriate than REST API Webs. You are not transferring/managing resource's state representations and you either are navigating through a hierarchy of resources. You are rather sending small bits of information to the server, asynchronously, continuously without the need for feedback. Fire-and-forget.
    – Laiv
    Sep 2 '19 at 11:43
  • conceptually websockets is good. but i think it would be impractical for this kind of mass tracking. Whether an API that accepts the actions over http is 'truely RESTful' is a bit academic for me. http api that accepts json == REST
    – Ewan
    Sep 2 '19 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.