Question

I'm trying to set a reminder in a system to fire at a certain time.

This is a web based app, so it's not like it will be in memory all the time.

Ideally I'd like to avoid using a service or job on the server(mainly out of curiosity, to see if there is a more efficient way to do it)

For example, imagine how many Ebay bids are constantly ending all the times, and emails being sent out seemingly perfectly in time.

Do people recon there is just a big loop going over and over, moving items into a queue etc... Or is there something lower level helping out (stored procedures, triggers etc)

Thanks everyone.

Was it helpful?

Solution

What you have to realize about eBay - and most large database-backed websites - is that the interactions between humans and the database that come through the web server are only a part (sometimes a very small part) of the functionality of the system.

To use eBay as an example, the email that goes out when auctions expire is not handled by a web server. They are far more likely to have that scripted. In other words, there is another program running on a number of their systems that look at the database for ended auctions, do some processing on them, send emails, etc.

If I were doing something similar (albeit on a much smaller scale,) I'd have my web services built in the usual way, but have a job that is run automatically every few minutes to do the maintenance work. It would start up, look at the database for work, process anything that was required, then exit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top