Consider you have a website visited by millions of people. 50 people or so fill in a registeration form and both press submit at exactly the same moment. Can SQL deal with all these requests at the same time, is there any chance it will accidentally generate the same primary key more than once or completely break?

How can it deal with so many continuous requests, if it will mess up the records in the table or insert incorrectly then is there something which can be done to overcome it?

Recommended Answers

All 3 Replies

Member Avatar for LastMitch

@asif49

Consider you have a website visited by millions of people. 50 people or so fill in a registeration form and both press submit at exactly the same moment. Can SQL deal with all these requests at the same time, is there any chance it will accidentally generate the same primary key more than once or completely break?

How can it deal with so many continuous requests, if it will mess up the records in the table or insert incorrectly then is there something which can be done to overcom

It's a bit confusing what you are saying and asking. Yes if you have enough space on your host server and your database can manage or store that much visitors or traffic. Unless you are don't have enough space then it will crash. So the question is really depend how much space you need to do.

is there any chance it will accidentally generate the same primary key more than once

No. The dbserver I used from Sybase would lock the table before writing anything to it. Table updates are queued up in the system and processed one at a time in sequence. You really need to read up on your database's documentation to find out how it handles multiple simultaneous requests.

Member Avatar for LastMitch

@asif49

You really need to read up on your database's documentation to find out how it handles multiple simultaneous requests.

I agree with AD that you should find out more about your host db guideline.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.