Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

New to web development, backend question

KernelKiller69

New Coder
when deploying my website, does the web works like threads in default,
for example, I have a global array variable (my website has low data transfer, so my global variables are not large)
does person A press a button and the array is filling with person A data
meanwhile, person B comes in and presses the same button, does the data collide or it's individual threats like?
 
Depends a bit of what you are using. In common backend engines and languages, each request is its own instance, so if person A is manipulating a global value of his instance, it does not affect on person b instance.
 
(my website has low data transfer, so my global variables are not large)
That should absolutely not be a consideration ! Either you're doing it right or you're doing it wrong, not 'halfway right' depending on usage.

I think @EkBass is right in saying with common webservers (e.g. Apache) each client request is running in their own thread and you should not worry about it. It would be very strange if one web client suddenly sees data that was entered by another web user somewhere else in the world !
But when in doubt, by all means test it out. It should not be hard to force the situation and see what happens.
 
Each person's interaction with your website is separate, so if one person is filling up an array with their data, it won't collide with someone else pressing the same button. The data will be separate for each person, so you don't have to worry about conflicts.
 
It depends totally on the software and architecture you are using. Eg if, as a beginner you have coded a server that listens for connections and spawns a new thread to handle each one (a common example on tutorial web sites) then yes, the threads will share any global variables and “collisions” will follow. If you use an architecture designed for purpose then they will definitely avoid this problem.
In any case using global variables for a thread’s data is terrible design. Don’t do it.
 
Each person's interaction with your website is separate, so if one person is filling up an array with their data, it won't collide with someone else pressing the same button. The data will be separate for each person, so you don't have to worry about conflicts.
Oh, and if you're into shopify web development, that's awesome. Shopify is a great platform for creating online stores. It's super user-friendly and has lots of cool features. When you're working on Shopify, just remember to focus on making the user experience smooth and easy. That means having clear navigation, buttons, and layouts that work well on different devices. Also, make sure your website loads quickly because nobody likes waiting around for a slow site.
 
Last edited by a moderator:
Oh, and if you're into shopify web development, that's awesome. Shopify is a great platform for creating online stores. It's super user-friendly and has lots of cool features. When you're working on Shopify, just remember to focus on making the user experience smooth and easy. That means having clear navigation, buttons, and layouts that work well on different devices. Also, make sure your website loads quickly because nobody likes waiting around for a slow site.
Great information. I totally agree with your point that it is very important that websites have good speed because it impacts on user stability towards the website.

Thanks
 
Back
Top Bottom