Results 1 to 4 of 4

Thread: Server data exchange strategy

  1. #1
    Join Date
    Mar 2009
    Posts
    39
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Server data exchange strategy

    I am wondering.... The idea is to have a database of scores on a server (Apache/Unix) from a small client program. The program would send periodically status of the game data, score and minor details that should be upgraded on the server database.

    What do you think would be the best strategy to implement especially on the server. The simple idea would be a plain php script invoked via http GET or POST passing data as parameters but I see that at each invocation that script would connect to the database, perform the queries and stop connection. If there are many instances of the client software running around I fear for the performance of the server. Any more sophisticated ideas of what to set at the server side?

    Another approach could be connecting the client program directly to the server database and update via SQL but I prefer some sort in intermediate script at the server to filter, validate and eventually distribute processing.

    Thanks for any ideas.

  2. #2
    Join Date
    Jul 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Server data exchange strategy

    i think using a php script to add the data to the database should be ok. the load on database depending to the many connects depends on how many clients you have at a time and how often the data will be send. but the same problem exists, when the clients would do a direct connect to the database.
    i would suggests not to you use get and post for parsing the parameters but using an xml dokument for the parameters you need.
    that gives you good oportunity of changing the data in later versions.

    using php caching on apache would be a god idea to keep the server fast.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Server data exchange strategy

    If you have full access to the server you can also considering "Fortune Server Example". And if you use PHP simply use mysql_pconnect to open a persistent connection.

  4. #4
    Join Date
    Mar 2009
    Posts
    39
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Server data exchange strategy

    Many thanks jörg and Lykurg. I think I will go with php, the mysql persistent connection you menction Lykurg looks like a good compromies for efficiency. Thanks.

Similar Threads

  1. Replies: 2
    Last Post: 2nd June 2010, 12:19
  2. Lock strategy
    By pippo42 in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2010, 11:31
  3. Commands exchange between Client and Server
    By QAlex in forum Qt Programming
    Replies: 8
    Last Post: 23rd November 2009, 17:59
  4. Connect to a server, send data and exit
    By Pepe in forum Newbie
    Replies: 6
    Last Post: 27th July 2007, 12:29
  5. Sql Server cannot retrieve data from select
    By Atomino in forum Qt Programming
    Replies: 10
    Last Post: 7th September 2006, 17:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.