Real-Time database update at specified time
Given a Database that has a table Called [Bid Transactions], which contains records of all available auctions that are currently running on an ASP.net website .. something similar to Ebay.com, when the deadline of the auction passed, I should close that auction, Send a notification message to both the item owner and the bidding winner to inform them.
how should I keep track of all open auctions? how could I monitor all their ending time and update the Auction status to be "Closed" on Real-time basis? ..
(1) Using SQL jobs ? .. that should reduce system performance .. shouldn't it ?
(2) A back-end service that is running on the server and uses Threading ? .. I have no clear background about that solution, but should it help ?
anything else ? .. which solution would be b开发者_JAVA百科etter ?
I would have the item-class do a check for now > auctionendtime on every pageview of the item and then display the auctionstatus accordingly. That makes sure that anyone viewing the page after auctionendtime sees it as closed.
Then I would run a back-end service that checks the database for expired auctions every minute or so and updates auctionstatus and sends out notifications etc.
It doesn't have to happen "real time". If everyone who views the page sees the correct auctionstatus and notifications gets sent out within a minute - that would be fast enough.
精彩评论