locked
General question on how to design the middle ware RRS feed

  • Question

  • I have a win form that needs to access SQL server to retrieve data. Winform will be distributed to customer and we do SQL server hosting. Currently, my Winform accesses SQL server directly without middleware. I’d like to develop a middle tier as a data provider.  My question is:

    - What’s the common architecture for the middleware?

    Notes:
    - The data for each request from win form is about 200KB.
    -  I don’t really like to use web service as it is very slow.
    - Is MSMQ  a good option?
    - Data being transfer is custom objects and HTML files
    - Data should be available in real-time (sync calls)
    Tuesday, November 3, 2009 9:35 PM

Answers

  • It depends on your existing application. Go for web service if it really required. The WCF services are not slow. Select correct end points. I think you create a dll project in the middle to interact with database. Use custom objects to transfer data between layers. This is a common data layering implementation everybody use. You can reuse this dll where ever you need data access.
    If you go with a web service you are creating the data access layer as service (refer ‘Software as a service’). It has lot of  plus points but it depends on your need.
    From the question I understand you simply need to implement a layering mechanism, then go with first option.
    • Proposed as answer by PROGRAMMERLIVE Wednesday, November 4, 2009 5:09 PM
    • Marked as answer by CodesCrawler Friday, November 6, 2009 3:39 PM
    Wednesday, November 4, 2009 1:14 PM

All replies

  • Since you need data in real ti'me MSMQ is ruled out.
    I wont completely agree with Web service is really slow", you may want to consider WCF service with appropriate binding based on your needs.
    This will help you consume services in other channels in future like web, mobile etc..

    If you really dont want to use web service, consider building plain middle tier with business layer and data layer built using entity objects and ado.net objects with necessary entity transformation logic between various layers.

    This approach can help you in lightening the currently built Winforms presentation layer and move business logic to middle tier helping improve maintainability of the application.

    hope this helps,

    Regards
    Suds

    Wednesday, November 4, 2009 5:37 AM
  • It depends on your existing application. Go for web service if it really required. The WCF services are not slow. Select correct end points. I think you create a dll project in the middle to interact with database. Use custom objects to transfer data between layers. This is a common data layering implementation everybody use. You can reuse this dll where ever you need data access.
    If you go with a web service you are creating the data access layer as service (refer ‘Software as a service’). It has lot of  plus points but it depends on your need.
    From the question I understand you simply need to implement a layering mechanism, then go with first option.
    • Proposed as answer by PROGRAMMERLIVE Wednesday, November 4, 2009 5:09 PM
    • Marked as answer by CodesCrawler Friday, November 6, 2009 3:39 PM
    Wednesday, November 4, 2009 1:14 PM
  • Hi,

    I think there are some more questions you might want answers for

    * How frequently will the middleware change? If you want to do dlls as the middleware, what are the options for distributing them?

    * Are all the users in the same LAN or do they connect over the internet as well?

    * How will the end client authenticate with the middleware. What are the security options?

    * How mission critical is this application? Do we need to avoid single point of failures at any cost?



    These are just some of the pointers and not the exhaustive list. But for me these are some of the most important.
    Wednesday, November 4, 2009 2:04 PM
  • Thanks for your inputs. I think WCF might be the best option for me so far.
    1. Front end will be a winform, distributed via download. I prefer to host the middleware, only front end (winform) will be distributed.
    2. The application currently connects to DB directly using internet (not LAN)
    3. Data will be provided after I verify subscription. Data is very similar to newspaper news, not very critical. I want data to be accessed as fast as it is now (directly to SQL server).

    "* How will the end client authenticate with the middleware. What are the security options?"
    - No answer. I need your input.
    Wednesday, November 4, 2009 5:04 PM
  • ... You can reuse this dll where ever you need data access....

    I'm building a search engine to provide data, so if using web service, users of winform application will experience slowness... I prefer to host the middle tier (DLL). I'm looking for a way to allow data to be transfered from my SQL server to end-user's winform without delivering DLL
    Wednesday, November 4, 2009 5:09 PM
  • I am not sure I understand what you're trying to say.  It almost seems that you would like to run in process (DLL) yet you don't want to have to ship your DLL to the clients.  Services can be sufficiently fast, just look at the APIs provided by major players like Google.  IMHO if your messages are concise enough (meaning results are paged on the server, etc.) then services don't add enough overhead in most scenarios.  No matter which way you go, you're introducing a wire between your client and the database.  If you use WCF service with a TCP/IP binding you're not introducing much overhead at all.
    Wednesday, November 4, 2009 7:09 PM
  • create a dll project in the middle to interact with database....
    You can reuse this dll where ever you need data access...
    I guess what you meant was to create a WCF solution, configure end-point correctly. Then create another DLL to be delivered with my winform to access this WCF service?

    Wednesday, November 4, 2009 9:36 PM
  • hi,
    WCF service with TCP binding will ease your performance concern as well.
    Additionally also consider Composite Application Block with click once for building Winforms application.
    This will ease your deployment effort of Winforms application.
    Click once help end user download the application over a browser. Also it will take care of downloading the future incremental versions as needed.
    Regards
    Suds

    Thursday, November 5, 2009 4:59 AM