Solved

Performance evaluation: VBscript session variables, 9000 hits per day, and stuff

Posted on 2002-05-31
15
207 Views
Last Modified: 2011-09-20
Okay, I have a complex problem. Lots of questions.

First, the details.

I'm building a web-based interface for some database advanced querying. I have 5 facultative forms. Each user can choose any number of forms, then fill them one after the other, then see the result. So I'm building a SQL query completely undetermined from start (from 0 to 14 search criteria). The forms are generated by server-side VBscript and they make one different page each (won't do otherwise).

Now, the problem. I need to keep the user inputs somewhere as the forms are being filled out one after the other (i.e., as new pages are loaded). At the end, a subroutine analyses everything and build the proper SQL query. I'm proudly done with that part, but the earlier step is still unsolved.

Why, the easiest would be session variables... but these are tricky and I'd like to avoid them. Moreover, I'd need from 0 to 14 separate session variables! But it's also true that my dual 866mhz server with 1gig of RAM has 9000 hits per day and that only an very, very little portion of these hits involve the search engine I'm talking about here. Yet, how are 9000 hits per day? Does that qualify for a medium-sized website? Or large already? Those 100 000 hits/day then are large or extra-large? I really need a better knowledge of this.

Back to my problem. Maybe I could build my SQL query progressively as the forms are being processed, and so I could keep only ONE session variable at a time. But the tricky part is that I need to build another form where the user reviews all his/her inputs before finally pressing 'fire'! So that would involve parsing the SQL query to extract the data. Seems more straightforward to me to keep everything distinct all along for the final review form, after which everything can be lumped into a nice and ready to use query.

So, what else is there for me beside session variables? Querystrings? Seems a bit crude. With something up to 14 search criteria, wouldn't it make URLS that are ridiculously long? A database table? Each user being anonymous, what kind of identifier could I use to keep apart several simultaneous queries? Hidden forms? I'm not sure how this can be done. A text file? Well... session variables seem so much of an easy way out of this. Will I go in Hell for that? :-)
0
Comment
Question by:JfSmith
  • 6
  • 5
  • 4
15 Comments
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
You could do the following:-

Use an application scope XML FreeThreaded DOM Document. The Nodes/Elements will each have a timestamp as well as a user id/session id and state id. These elements can be flushed every 48 hours or a time interval determined by you.

This method will avoid the difficulties of using session objects, yet be flexible for the future. It is not difficult to add another attribute with value to each tree. Moreover, this can allow for an in-place upgrade, that is to say you have decided on a new search criteria, with proper coding, users with the old regime will be unaffected.

What you can do is ditch the session variables, as well as the query string urls as what you are talking about seems to be some sort of web wizard. If you need users to book mark the wizard (I can't see how you'd want that, but let;'s say you do), then using querystrings seem to be the only solution. If you do want to maintain state and ditch query strings, you must have some way of identifying the user, it would seem that cookies might be a good way, or use ONE SINGLE Session Variable just to identify the user.

The Application-Scope FreeThreaded XML Document will then hold all the data in-memory so you won't have any I/O problem.
0
 
LVL 11

Accepted Solution

by:
mouatts earned 300 total points
Comment Utility
Firstly with the load you are taking about session variables are not going to be an issue so certainly there is no real problem with them. (I have had one system that stored 30 or 40 session variables per user and had around a million users per day and it presented no problems) Possibly the only thing that you need to bear in mind is if someone is coming to the set of forms for a second time that you clear out all the old session variables, but this shouldn't be a big problem.

Hidden fields are of course your second choice. Again no real problem in doing this. If server loading is a concern then this is prehaps the better choice in that you are not using the server to store anything. All you need to do is in the creation of the second form you would include hiiden fields for the values completed from the first form.
If you use the syntax along the lines of
FOR EACH FIELD IN REQUEST.FORM%>
    <INPUT TYPE="HIDDEN" NAME="<%=field%>" VALUE="<%=request(field)%>">
NEXT

Then it becomes pretty oblivious to change and will work on each subsequent form.


You can also put them in the URL as you have suggested but personally I loath sites that have a URL fourteen miles long! In addition you can run into problems here if the URL starts getting to long.

So far as using an application scope XML FreeThreaded DOM Document - why!
Computing rule number 1 K.I.S.S Keep it simple stupid.

HTH
Steve
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
It is simple and I completely disagree with mouatts. Numerous web sites are using the FreeThreaded DOM Model to persist data across user activity. It is simple and not stupid.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
But many more aren't
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
not many developers are good, not many sites are great. does that mean we must limit ourselves to the lowest denominator? get serious here.
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
for that matter, though there are a proportion of web developers who

1. are totally unaware how compelling XML is for web applications.

2. afraid of being displaced by a newer and increasingly proven technology.

3. just want to be in their comfort zone and do not prefer change.

These often interact with the recommendations put forward.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
This is not the place for such an arguement. It is a place, however, to assist in jfsmiths problem, something neither of your last two comments do.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:JfSmith
Comment Utility
Well, thanks guys. Some more thoughts.

For starters I'd like to find good web resources regarding the FreeThreaded DOM. I'll judge by myself what's the simplest, because in my situation it's not all about what *I* think is simple or not, but also what other people after me will be able to do (I'm just a research assist. in an educational institution, really nothing to do with professional developing) and what the other project teams (with less powerful servers) to whom my application is destined are ready to take. In such a situation I'm seeking for transparency more than simplicity for its own sake.

That is why mouatts' reply comforts me, because he also answered my question about my server load and so I know session variables wouldn't be an overkill. However, unless I'm mistaken, they automatically involve cookies and I don't want to force anybody to use them.

I really didn't think about the possibility to use the FOR EACH ... IN statement with the hidden forms. How silly of me. Now that makes this solution very, very attractive.

Although I don't doubt that the XML Freethreaded DOM is simple in itself (even if I ignore everything of XML but the name and the hype), I'm not convinced it's the most straightforward method for my situation. In my question, I mentioned alot of possibilities, one of them being storing some user session information, but assuredly I'm not bound to that. Now that I know how I can use hidden forms, this seems the best.

Any new insights?
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
no worries, JFSmith, what works for you is what really matters. All I am saying is not to discount the XML approach and don't let those who say it is not simple to sway you. The hidden form inputs is equally valid as say the FreeThreaded DOM Method. topxml.com is an example of a largely successful website that implements this. How do I know this? Because I know the owners and have seen the inner code workings.

It is one thing to put forward an idea, any idea. It is quite another to say some method is "stupid" without putting forward reasons and facts the way mouatt has done. That, I strongly object to, regardless of whether it refers to XML or any other method.

0
 

Author Comment

by:JfSmith
Comment Utility
I understand. I actually don't think he meant it was stupid though - and he rather said the opposite, his only use of the word was in the context of his computing rule that is difficult to disagree with.

Do you have URLs for good reference about XML?
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
http://www.w3schools.com
http://www.zvon.org
http://topxml.com

download MSXML3 SP2 | MSXML4 SP1 from
http://msdn.microsoft.com/xml
the links on the right hand --> MSXML3 SP2 | MSXML 4 (SP1)

download the SDK for examples.
0
 

Author Comment

by:JfSmith
Comment Utility
I understand. I actually don't think he meant it was stupid though - and he rather said the opposite, his only use of the word was in the context of his computing rule that is difficult to disagree with.

Do you have URLs for good reference about XML?
0
 

Author Comment

by:JfSmith
Comment Utility
I understand. I actually don't think he meant it was stupid though - and he rather said the opposite, his only use of the word was in the context of his computing rule that is difficult to disagree with.

Do you have URLs for good reference about XML?
0
 

Author Comment

by:JfSmith
Comment Utility
Err... what the hell happened?

Anyway, thanks for the URLs.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
JfSmith:

Absolutley right about the Stupid in K.I.S.S

So far as session variables and cookeis are concerned. The browser must allow per Session cookies or temporary cookies (different name but same thing). With IE5 there are two seperate options for cookies (per session) and normal cookies. So your users will need to turn on the former ones but all the arguements and reasons that I have ever heard of for not having cookies turned on do not apply to per session cookies. Third party cookies (as they are called in IE6) which are probably the biggest reason are not possible with per session cookies.

But regardless of that if you pass the values from form to form then you don't need session variables anyhow.

Steve
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select distinct 25 60
Summernote required 3 56
Video will not go into background 20 27
Adding a hidden div to each row in a table 6 22
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

744 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

17 Experts available now in Live!

Get 1:1 Help Now