We have a system in which customers are provided with a product based on the first priority.
Our product table contains an incremental primary key that started from zero, which we use to track how many products have been distributed, that is, the user reserves the product and receives allocation 1, the next user receives 2, etc.
The problem is that potentially hundreds of thousands of users will gain access to the system in any hour. All of them will hit this table.
Since we need to ensure that only one product is allocated to each client and keep track of how many products have been allocated, we use row locking for each client accessing the system to ensure that they are written to the table before the next client accesses the system - that is, compliance with the first-order rule of the first order.
We are concerned about the bottleneck, which is the processing time for each query included in SQL Server 2008 Enterprise Edition and the row lock.
We cannot use multiple servers, because we need to ensure the integrity of the primay key, so anything that requires replication will not work.
Does anyone know of good solutions that are especially effective at processing a large number of queries in a single database table?
A bit more info:
In this table, there are essentially only two fields - ID and CustomerID. The solution is to give away a million products free of charge - therefore, the expectation of high demand and why using a primary primary key as a key makes sense to us - as soon as the key reaches a million, more customers will not be able to register. In addition, the products are all different, so distributing the right key is important, for example. the first 100 customers introduced receive a product with a higher value than the next 100, etc.