Multiple users on my Nodejs server accessing the same variable

Asked

Viewed 79 times

1

I’m having a question about how a nodejs server works with multiple users. To contextualize:
Say I create a server-side variable, the value of that variable will be overwritten if someone else also accesses the same route at the same time ?

1 answer

1


Imagine that there is only one flow of execution. When a request arrives, it enters this stream, the Javascript virtual machine checks what has to be done, delegates the activity (query data in the database, for example) and again meets new requests while this parallel processing is happening. When the activity ends (we already have the data returned by the database), it goes back to the main stream to be returned to the requester.

Some links that can help you better understand Node.js:

  • Now I understand thank you very much . I will check these links! Vlw even

Browser other questions tagged

You are not signed in. Login or sign up in order to post.