Web services tier for data access?

jhilb

Freshman
Joined
Jan 14, 2002
Messages
27
Has anyone seen data access tiers ran via web services? I am not really sure what I am asking actually, so this sounds weird.

Something like IIS is used for the presentation and business objects, but the data access is passed off to another server via web services?

What is the concept here? The system in which I am told this is happening is very data access intensive.
 
I use this technique at work. Like anything, you may or may not do things the same way depending on your particular needs. Pure Client/Server isn't inheritantly bad, for instance, though you may believe it if you talk to some people.

Anyway, we (my company) develop "components" that are hosted on a website and exposed through web services. What this means is there's a website (.NET of course) that has compiled DLLs for the components and some ASPX/ASMX pages that are basically pass-throughs to the compiled code. The webservices return XML almost exclusively. In some instances, they return or accept DataSets. The web services provide a small layer of abstraction where we can do some authentication and cacheing of often-used lookup tables. The components don't have to be hosted in the same website as the web services - heck, they don't even have to be in a web project at all.

There is a separate website that handles some admin functions and reports. They're mostly ASP pages converted to .NET to help Admins who don't always work at the same machine and want/need a light interface into the system.

That handles the "middle" and "data" tiers, more or less. The front end is Windows Forms. We built our own dynamic loading mechanism that downloads DLLs as needed. All forms, toolbars, and toolbar "snap-ins" (our own design) reside in DLLs. The main "app" is an MDI form and a bunch of common routines for window handling and such. Even the log-in form and authentication process is handled through a DLL that is downloaded as needed.

The whole thing works rather nicely and our clients have loved it so far! The best part is the distibution/setup. The main install wizard only needs the main EXE (and the .NET framework, of course). Everything else is downloaded on demand. This is a bit different than the auto-download you may have heard of when you run an EXE from the Web. Ours uses a standard EXE setup program that creates a folder and copies our main EXE. We decided we needed a little more than what the auto-download features gave us.

Anyway, to answer your original question about using data access tiers via web services, the answer is a resounding yes! :)

You could just as easily substitute in a Web Form in front of the webservices layer. We chose Windows forms because of the rich controls (tabbed dialogs, grids, etc.). I've done both Web and Windows apps - windows for about 5 years, web for about 3.5 and they both have their advantages/disadvantages. Not that you asked, but since I was typing a lot anyway... :p

-nerseus
 
And this is used for both reading and writing data?

So you have a DLL component registered on a .Net web server, somewhere, not necessarily the same web server that is serving up your web presentation, correct?

This is a new one for me. They are using a 'DMZ' where I am at.

So the user via the internet goes through the firewall to the web server. the web server does the presentation.

but for data access it goes through a DMZ (demilitarized ?? this is the new one to me) then on to an 'App' server via web services, which is really another web server the way I understand it. that final web server then connects to the database (directly)

so it sounds like the same thing you are referring to.

anyone know of any urls explaining this maybe?

does this last web services server then handle both the writing and reading of the data? reading obviously because it is tossing back datasets via XML, but what about writing?

AH! I am guessing that is why I saw the serialize tag in all the data access components. So they can serialize to XML for another server or something like that?
 
First, no single solution is right for everyone. The solution I outlined works at my company because it's what the app needs. We've spent years working on n-tier architecture and still, to come up with a robust server setup takes time. We could have done our architecture a number of different ways with different server configs and they'd be just as valid. It comes down to a LOT of issues: scalability, maintainability, etc. etc.

I've heard DMZ used a few times - I think it's used to describe a server behind a firewall - demilitarized zone, yes. I've heard it from time to time but I could be off a little. Even with a firewall in place, you must be able to have your webserver contact other servers behind the firewall. It's really up to you to decide where each tier lies (same server, different server, behind firewalls, same domain, etc.).

If you have more specific questions, I could answer them. My first post was just an outline of one possible way to implement n-tiers in .NET. And, it mostly describes how we do things in development - I didn't even mention our SQL Servers, File Servers, QA environment, Source Safe servers, etc. Coming up with a solution for a large project requires a lot of thought. For smaller projects, you can mostly get by with two servers: a web/component server and a SQL Server. You could put them all on one in a pinch, but I wouldn't recommend it :)

I don't know of any URLs that explain how to build an architecture. I know there are some books that attempt to outline what you should consider when designing one. But there won't be a step by step guide anywhere that defines exactly what you'll need.

You can check out MS's sample sites (eye spy and Fitch and Mather come to mind) which use .NET in an n-tier approach. Or at least they used to... sorry I can't be more specific. I haven't looked at the full demo sites in awhile.

-Nerseus
 
Back
Top