Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:52:20+00:00 2026-06-06T23:52:20+00:00

Im trying to figure out what a highly scalable solution (serving multiple users of

  • 0

Im trying to figure out what a highly scalable solution (serving multiple users of 10000+) would be.

Goal: What I want to achieve is to write a stream of mouse coordinates to a binary file to a server, i.e. the server is directly saved to the server from the userinteraction once stream is closed. The coordinates should be pushed every 20ms (about 50fps) to create a close representation of the mouse movement.

a) I know that nodeJS can be used to do a writestream, but I am not sure if such a high frequency of updates can be handled by such a structure – also if this is done by multiple users, this approach could fall apart.

b)The other possibility would be to locally write the file into binary and then upload it to the server afterwards.

Can anyone comment on the capabilities of these approaches and if there is another method that can be used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:52:21+00:00Added an answer on June 6, 2026 at 11:52 pm

    Based on your comment that the server does not need the data in real-time, you should definitely not send the data to the server every 20ms. Save it on the client and send it in chunks, say every 30 or 60 seconds. This can be done in memory in an array. Saving mouse coordinates is not very intensive.

    Once you’re ready to send it, I think you’ll find XMLHttpRequest sufficiently fast enough for your needs.

    This demo shows how to capture to coordinates and shows that 50fps is doable (I get up to 60fps in Chrome on OS X).

    Demo: http://jsfiddle.net/ThinkingStiff/2Ls3A/

    var coordinates = [],
        count = 0,
        SECONDS = 1000,
        INTERVAL = 5; 
    
    window.onmousemove = function ( event ) {
    
        //move cursor over page for at least 10 secs for an accurate reading
        coordinates.push( [event.pageX, event.pageY] );
        
    };
    
    window.setInterval( function () {
        
        console.log( ( coordinates.length - count ) / INTERVAL + 'fps' );
        count = coordinates.length;
        
    }, INTERVAL * SECONDS ); 
    

    If you really think you need more efficiency in the sending of the data, the lowest-latency method to connect a client and server computer over the internet is a persistent TCP socket. This is available in HTML through the WebSocket API.

    There are libraries in just about every server-side language that handle the end-point using the ws: URL schema (wss: for secure), socket.io for example.

    Client:

    var socket = new WebSocket('ws://example.com/endpoint' );
    
    socket.onopen = function () {
    
        socket.send( 'send some text' );
    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to figure out the best way to set up collection lists for users
Trying to figure out how to read in multiple variables through a file. for
trying to figure out how to write the following in CoffeeScript: var foo =
I'm trying figure out how to query Salesforce with multiple filters where either filter
Trying to figure out an equation to get the current group a page would
Trying to figure out how I can do this properly. The print_r looks like
trying to figure out why this is happening - I have an input text
Trying to figure out why my silverlight app suddenly just displays nothing (right click
Trying to figure out how to type (via events not set the value) on
Trying to figure out a regex for validating a network path ie: \\comp\xyz or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.