architecture check

Posted on 2012-08-16
Last Modified: 2012-09-07
We have a pretty big 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?
Question by:readyset
    LVL 14

    Expert Comment

    Have you looked into the MVC4 asynchronous processing technologies?

    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.
    LVL 16

    Expert Comment

    by:Swapnil Piparia
    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.


    Author Comment

    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.
    LVL 16

    Accepted Solution

    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.

    LVL 14

    Expert Comment

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

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now