We help IT Professionals succeed at work.

architecture check

readyset
readyset asked
on
We have a pretty big asp.net mvc site that has a lot going on. Pretty much CRUD , UI , some calendars and scheduling stuff on the UI side.

When a student schedule is published in our internal site, we need to communicate with external systems (APIs). We need to trigger these calls based on a value in a table for that particular record. My question is we have a couple of ways to do this :

I believe the best optimized way for this to do is an async process. To achieve this we can:

1) write an async controller that calls one of these services depending on the database value

2) windows service that runs on our server and checks the database records that need to be updated to the external systems.


My question is - which one to choose among the two options? If I go with 2) how can I trigger my windows service depending on the record value. I do not want to keep pinging our production database as this will be creating  performance issues once we scale.

Any thoughts or insights would be appreciated?
Comment
Watch Question

Have you looked into the MVC4 asynchronous processing technologies?

http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4

Option 1 ( non MVC 4 ) would probably be a better option.  Im not really sure as far as having a context on the number of possible transactions.
SwapnilSoftware Architect
BRONZE EXPERT
Top Expert 2005

Commented:
Actually it all depends on below questions to know the frequency of trigger. I can see possible option to select as option 2 over option 1.

1. What would be the trigger point, will it be user or system? To elaborate more, student scheduling information publishing on your site is it through UI by some user on some button click / system?
2. Is scheduling happen for all the student at once or it is for individual student?

One more possible option is you can directly call wcf service apis from SQL server by setting it as SQL job which will solve your hitting database from windows service concern.

http://www.codeproject.com/Articles/21149/Invoking-a-WCF-Service-from-a-CLR-Trigger

Thanks,
Netswap.

Author

Commented:
netswap - Thanks. I should have given these details in the first place. Its kind of both!

In our UI system, once a teacher creates a schedule, he/she publishes it. Here it is the user/ button click. Only when the schedule is published then we need to talk to these external systems.

The scheduling happens for all the students at once.


Also, once we talk to these external systems there are two options when errors occur in the first call. We want these to be handled automatically or give user an option to check the errors and then initiate the async call again by click of a button.

 
Please let me know your thoughts now.
Software Architect
BRONZE EXPERT
Top Expert 2005
Commented:
Ok. Then as per my opinion we don't require any scheduling kind of mechanism means sql job / windows service because as per scenario you have explained it is initiated by the user(teacher) and with less frequency as it is created for bunch of student at once.

In this case, I think async call is good option which is option 1 async controller.  Handling of error need to be extra implementation which you need to implement inside async controller action or return user an view / popup with option to ask for correct actions.

Thanks,
Netswap.
Agreed... Netswap thanks for posing these questions.  I should have asked them as well, shame on me.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.