Scheduler in ASP.NET Application

V

Vijay Kerji

Dear Friends,

please read the following scenario...

- A website which invites different users to register/participate in an
initiative
- Intial time period will be given to the user to access the
site(consider an year to start with)
- at the end of the registrtaion period, an auto generated email should
be sent to the registered user( say on 11th month after registration)
- It can cater to any number of users who participate in the initiative


Any possible ways of sending autogenerated emails to the user with most
efficient design is appreciated... Can it be a windows service or SQL
Job or Windows Scheduler?...


regards,


Vijay Kumar
 
P

Paul Henderson

Any possible ways of sending autogenerated emails to the user with most
efficient design is appreciated... Can it be a windows service or SQL
Job or Windows Scheduler?...

I would probably use a long-running service. Just use .NET to create
and install a basic service with a Timer object that fires once per day
[or thereabouts], and have the event-handler check for the relevant
conditions and send the email (probably using the built-in
System.{Net/Web}.Mail classes). If there's lots of code in the main
website that you wouldn't want to duplicate in the service, either use
a shared assembly, or make the service access a restricted page on the
website, which performs the required actions. The overhead of having a
timer running with such a long delay is negligible, and this method
means that there is no extra load in creating a process to handle the
data [as there would be if you used the Windows scheduler].
 
V

Vijay Kerji

Dear Mr. Paul,


Think you suggested suitable solution which I conceived in my mind
before...
Your given advice is appreciated...


Vijay Kumar
 
V

Vijay Kerji

Is it a wise idea to perform operations from windows service like
database query to retrieve the data, send the email notifications to
the users,
updating the database etc...?

Instead of windows service doing it, can we have a web service do the
detailed operations mentioned above and windows service just calling
the methods of the web service...?

Would like to get suggestions to keep the windows service and
webservice in single system or different system...? (Windows Service in
Web Application System and Web Service in Database server System...)


Efficient suggestions are appreciated...


Vijay Kumar
 
P

Paul Henderson

Is it a wise idea to perform operations from windows service like
database query to retrieve the data, send the email notifications to
the users, updating the database etc...?

There is no particular reason not to, except if you want to keep all
such code centralised in the web application, rather than having some
data access code in the website and some in a service. Putting all such
code in the web application would probably make maintenance easier.
Instead of windows service doing it, can we have a web service do the
detailed operations mentioned above and windows service just calling
the methods of the web service...?

Yes, that is certainly feasible, and would be a fairly neat way of
doing it.
Would like to get suggestions to keep the windows service and
webservice in single system or different system...? (Windows Service in
Web Application System and Web Service in Database server System...)

If the web application needs access to the database anyway, there seems
to be no real advantage in putting the web service (which also needs
the database) on the data server, if it is still going to be accessed
by the web application from its server. Also, if the windows service
does just call methods of the web service, then it would have so little
overhead or attack surface that it could go on either server, with no
real difference in performance or maintainability, although putting it
on the same server as the web service it calls would mean that the web
service does not need to accept remote connections, making it more
secure.

It is still probably best to keep the database on a separate server
(mainly for performance reasons); I would probably have it so the
database server did nothing but the database, and did not host either
of the services or the main application.
 
Joined
Nov 9, 2006
Messages
1
Reaction score
0
I want to know about Schedular

I want to know how to take backup of a particular file in a given time every day .for backup i can copy the files but at given time how to do .This is like sheduling task which is found in control pannel.can anybody help me with code.very urget.this should be done in asp.net:shake:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top