Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strategy for Ensuring Cached Data is Current
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Strategy for Ensuring Cached Data is Current
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01540720
Message ID:
01540720
Vues:
75
Here's a simplified example of our current caching strategy:

Assume products table with Onhand field (a cached field because it's not practical to calculate sum of total purchased-total sold).
At any time, buyers can place order for product A

Pseudo-code:
Web Process 1 starts processing order for Product A from Buyer Y
Web Process 2 starts processing order for Product A from Buyer Z
at this time both Process 1 and Process 2 see there are 4 onhand
So they both simultaneously submit an update
Update products onhand=3 where product=A

(The actual real world application is much more complex so I can't just issue 'update products set onhand=onhand-1 where product=A')

I'm looking to use Semaphore Locking, but I wanted to check with the gurus here for any other strategies I should consider for ensuring the cache is up-to-date.
Brandon Harker
Sebae Data Solutions
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform