conceptual help required! on web chat

Last post 11-06-2009 11:29 AM by salman4u. 3 replies.

Sort Posts:

  • conceptual help required! on web chat

    11-01-2009, 7:58 AM
    • Member
      29 point Member
    • salman4u
    • Member since 08-19-2009, 12:17 AM
    • Posts 82

    Hello,

    I implemented chatting facility in my website but it uses database. Now i found that using application variables also you can achieve the same. So i want to know which is the right approach ? should i go with database only or should i use application variables and implement it altogether again? What are the disadvantages and advantages of both. If somebody could point me i would be very grateful to him.


    Thanks in advance :) 

  • Re: conceptual help required! on web chat

    11-01-2009, 12:52 PM
    • Member
      101 point Member
    • atarim
    • Member since 07-24-2006, 9:55 AM
    • Kuwait
    • Posts 25

    All the ways are possible but which are correct ?

     

    I did website chatt by using a session variable with database which will not effect the server performance

    Mark as answer if you find this will help you
    Best regards,

    Mohammed Al-Atari
    Sr. System Analyst - Team Leader
    GSM Tel. : (965) 9 7150054
    My Space: http://al-atari.spaces.live.com/
    My Blog : http://www.al-atari.net


  • Re: conceptual help required! on web chat

    11-06-2009, 9:43 AM
    Answer
    • Contributor
      6,114 point Contributor
    • atconway
    • Member since 09-24-2007, 9:20 PM
    • Florida U.S.A
    • Posts 1,259

    Well I have not personally made a full chat program myself, but I can point out to you the pro's and con's of each method you provided.

    With the database, you are going to have the gurantee that your data is written and retrievable even in the case of a web server failure.  Basically, if the chat was abrubtly ended, you could go to the database and retrieve the chat data to be re-posted to the user's to continue chatting.  However, the downside with using a Database (as is always) is the extra communication and latency of talking with the database.  More than likely the db is on another server and that takes a little extra time for the communication.  Realistically though for as small as the chat data is, you probably will not even notice any speed or performance issues, but I just point them out to know they are there.

    As for variables, you mentioned using 'Application Variables' or 'Session Variables'.  Be careful with Application Variables as they are not unique to session and are global across sessions, where as Session Variables are unique to a individual session.  Regardless, the plus side of these variable types is that they are held in memory on the ASP.NET server and are really fast.  The downside is, they will not persist a session timeout, server restart, app crash, etc.  Therfore, if any of the previous events occur, the chat data stored in session would be lost.

    A mix might be to persist the session state to SQLServer if needed.

    Hope this helps! Smile

    Thank you,   >[Blog]<

    "The best thing about a boolean is even if you are wrong, you are only off by a bit." :D
    -anonymous

  • Re: conceptual help required! on web chat

    11-06-2009, 11:29 AM
    • Member
      29 point Member
    • salman4u
    • Member since 08-19-2009, 12:17 AM
    • Posts 82

    Gr8 job !! thanks! for giving such a nice explanation. Now i am very much clear

Page 1 of 1 (4 items)