HT/VT Web Site

Discussions around miscellaneous technologies and projects for the general membership.
User avatar
mkmurray
Senior Member
Posts: 3266
Joined: Tue Jan 23, 2007 9:56 pm
Location: Utah
Contact:

#31

Post by mkmurray »

brado426 wrote:Additionally, as a developer, I prefer to have full access to the application's database that I am working on... otherwise I think things would take much longer.
It's more for maintaing complexity and introducing modularity. You want to be able to "plug-and-play" the different parts of your application, in case changes in implementation have to be made. This is called "decoupling" the various parts of the application. When you get to complex applications, you typically don't want your Web Tier interacting directly with your Data Tier. There is usually some sort of abstraction in between, a Service Tier. This would allow you change the database being used to store the data, without having a direct influence on your web interface.

Especially in this circumstance where the Church would want to keep the database schemas and connection strings secure, I would think that would be another argument for not going straight at the tables in the database.
User avatar
thedqs
Community Moderators
Posts: 1042
Joined: Wed Jan 24, 2007 8:53 am
Location: Redmond, WA
Contact:

#32

Post by thedqs »

I have to agree with Mike on this one. If you start crossing levels then you have to maintain a lot more code for simple changes. Example the church could have a method getHeadOfHousehold(int FamilyID) which just searches through database and gets the person with PositionInFamily = 1 AND FamilyID = userinputFamilyID.
Now if they change the databases to have a HeadOfHousehold as a boolean value the getHeadOfHousehold method would change BUT the external program stays the same. So really having the database give no advantage and in my opinion gives actually a disadvantage to the programmer.
Give me a standard API and an secure socket connection to it and I'm happy. :D
- David
User avatar
brado426
Member
Posts: 313
Joined: Sun Feb 11, 2007 9:50 pm
Location: Foothill Ranch, CA
Contact:

#33

Post by brado426 »

thedqs: I know what you're saying, I always do as you say and put database calls in their own methods so the database connector can be changed to whatever is necessary. As long as these methods return the datasets in the correct format, everything should work.

I guess what kind of bothers me is that it seems inefficient to be transmitting all that XML back and forth between the application server and the data server. Perhaps that is an old-school concern with today's abundance of processor, memory, and bandwidth.

Brad O.
User avatar
thedqs
Community Moderators
Posts: 1042
Joined: Wed Jan 24, 2007 8:53 am
Location: Redmond, WA
Contact:

#34

Post by thedqs »

brado426 wrote:I guess what kind of bothers me is that it seems inefficient to be transmitting all that XML back and forth between the application server and the data server. Perhaps that is an old-school concern with today's abundance of processor, memory, and bandwidth.

Even then I think we still need to be sparse but what is larger: An entire database of church information (cut down to what the user could use), or a short response to a query?

What I mean is though you may reduce total traffic, the speed of a 56 Kbit modem could handel the speed needed to transmit the XML formatted data that a human interacting through a program could use in real time. For example (might not apply to this thread but the idea is the same):
Someone has written a program that interfaces with LUWS ward list and displays photos if avaliable. (The photo part might take longer to do since over 56 Kbits that can bottleneck)
The program connets to the API interface (less then 5 KB of data or less then a second for connection time)
Program sends an XML formatted command to the API to get a list of ward members and it gets back an XML formatted list of members with phone address and picture IDs (I'll be generous and say that was 15 KB of data or abour 2 seconds). (The program then starts to download each picture by sending a XML request with the picture ID (This could end up in the MBs but since it is being run in the background as another thread the user only notices that the pictures take time to show and not any interference with the program)
The person wants to look at a detailed view of the family (maybe children with ages and personal email address and cell phone numbers) they click the family and the program sends a request for that family ID to get an XML table of the information of that family (5KB or less then a sec)). (The photo thread is still in the background getting pictures so there might be a slight delay for one image to complete and to get this request through but some good multi-threaded code should be able to make this effect disappear)
The user got his information and then closes the program and to the user it seems that the program was very fast.

Now if you download the entire database first (let's say pictures are store in the database too) you will have to download a multi-MB file before you could even start and the user has to wait a long time.

Hopefully this example shows why I think getting the entire database is not only wasteful but a bad idea personally.
- David
User avatar
WelchTC
Senior Member
Posts: 2085
Joined: Wed Sep 06, 2006 8:51 am
Location: Kaysville, UT, USA
Contact:

Web Services

#35

Post by WelchTC »

At the Church we don't even let the developers mess around with the database. We really try to force all code to go through a middle tier to ensure security and maintainability. So just because I said we use Oracle, does not mean that you would need to access Oracle directly. We (the Church) would develop the necessary API's to touch the database. It may seem inefficient but actually Web services offer a lot of advantages.

If this project gets off of the ground, we would work with the community to provide them with the necessary tools to do all of their development with. This would include web services to a "dummy database" that could be used for testing, etc.

Tom
User avatar
brado426
Member
Posts: 313
Joined: Sun Feb 11, 2007 9:50 pm
Location: Foothill Ranch, CA
Contact:

#36

Post by brado426 »

Interesting. I guess one needs to be pretty sure that their database schema is accurate before having the church set up the middle-tier web-service you are referring to. No matter how much I plan, I always end up changing at least a few things in the database schema during development.

Is there any way to give the developer the ability to change the schema on the middle-tier so that they would not need to bother someone at the church every time? My concern is innundating church resources with requests during development. I'm sure an application could be written to allow this, but it sounds like a big job just to write that application. What process do developers at the church use now to get database schema changes made?

Brad
User avatar
thedqs
Community Moderators
Posts: 1042
Joined: Wed Jan 24, 2007 8:53 am
Location: Redmond, WA
Contact:

#37

Post by thedqs »

I am sure that the church wouldn't mind getting the requests basically since everyone probably wants the same functionality and the church most likely wants to review each request for immediacy and necessity. Also I am sure the church wants to keep a tight hold on the API tier.
- David
User avatar
brado426
Member
Posts: 313
Joined: Sun Feb 11, 2007 9:50 pm
Location: Foothill Ranch, CA
Contact:

#38

Post by brado426 »

Sorry to have caused all this "back and forth" over this issue. Handling the back-end of the application this way is a new concept for me. However, I think you guys have me convinced that it is the best way to go... at least for the Church.

Brad O.
User avatar
WelchTC
Senior Member
Posts: 2085
Joined: Wed Sep 06, 2006 8:51 am
Location: Kaysville, UT, USA
Contact:

#39

Post by WelchTC »

brado426 wrote:What process do developers at the church use now to get database schema changes made?

Brad
During initial development many programmers may have access to a database while the DB schema is in flux. Once, however, it is fairly solid, the engineers work with a DBA to make the necessary changes. Yes, it is slower and inconvenient but it does protect the Church from one developer making an inadvertent change that messes up a whole bunch of other apps depending upon the same data.

Tom
User avatar
brado426
Member
Posts: 313
Joined: Sun Feb 11, 2007 9:50 pm
Location: Foothill Ranch, CA
Contact:

#40

Post by brado426 »

I don't mean to open up another can of worms here, but I thought I should post some feedback I received after doing some additional research. Your comments have intrigued me quite a bit and I have asked a few people that I know about the proper use of WebServices that I consider more experienced than I in applications development.

I have compiled all of their comments into a few bullet-points:
-
  • WebServices should only be used for exchanging data between two systems that would otherwise be incompatible
  • Using WebServices require parse/deparse time
  • WebServices are more likely affected by network latency
  • WebServices include HTTP overhead
  • To keep developers from affecting the database schema, have the DBA lock it down
  • Use an API that provides "direct-access" to the database
-
I guess it is fine to use a WebService as the sole method of database interaction, as long as the trade-offs are fully understood.

Brad O.
Post Reply

Return to “Other Member Technologies”