Update Xojo variable with Webdata

My Windows/Mac Xojo based application has a table (like the Stockmarket) that requires periodic updates from a JSON file located on a webserver.

What sort of solution -other than websockets- would be the most suitable and reliable for a desired update frequency of around 1 second without overloading the server with requests and without absorbing considerable server resources.

I would like the solution to be ready to accept approx up to 100.000 connections that’s why websockets may not be a good idea.

Normally you’d use an httpsocket. Does that not work in your case?

Thanks. Never thought about that.
What sort of solution do you have in mind Tim ? Request data from server with a timer ?

Yes, use a get request to grab the contents of the file periodically.

Tim, although that works, it’s not a good idea I would guess :frowning: it’s like refreshing a webpage on your browser every second

You may not need to transmit the whole content, but just what has changed. That would save some bandwidth.

Otherwise, I do not see how you can refresh the content on your app without connecting somehow to the server.

I was wondering if a mySql Connection that could refresh a query every 1000ms would work.
The WebSockets option problem is the limited number of connections :frowning:

I think I will use websockets again … fingers crossed! no time for a 2nd chance
hope it handles 100k connections (latency is not an issue for this one)

Your setup is still a bit nebulous. You have up to 100,000 connections to your app, which makes 1 connection per second to the website? Or do you have 100,000 connections to the website?

1 connection. The server must handle up to 100,000 connections or in other words, 100,000 Xojo applications running on 100,000 different PCs

[quote=124295:@Walter Sander]I was wondering if a mySql Connection that could refresh a query every 1000ms would work.
The WebSockets option problem is the limited number of connections :([/quote]

[quote=124322:@Walter Sander]I think I will use websockets again … fingers crossed! no time for a 2nd chance
hope it handles 100k connections (latency is not an issue for this one)[/quote]

The 100,000 connections is intriguing : will you really have 100,000 desktop apps running right away ? That is a lot of software packages to distribute…

If only 1/10th of them call the server at the same time, that is 10,000 simultaneous connections ! That sounds way over any standard web app possibilities. Even if you simply placed your Json as a file on a URL for grabs by HTTP, you would need strings of servers the like of Google to be able to serve such a massive amount of concurrent queries…

About 2nd chances, HealthCare.gov is a brilliant example how NOT to do things in matters of simultaneous access…

100k is to demonstrate how big it could be. 10k would be fine. I didn’t get the healthcare.gov point sorry.

I think NodeJS with SSE would work okay

[quote=124376:@Walter Sander] I didn’t get the healthcare.gov point sorry.
[/quote]

HealthCare.gov is web site launched last year by the US Government for Americans to obtain helth insurance under the provisions of the Patient Protection and Affordable Care Act (ACA, often known as ‘Obamacare’). Launched in October 2013 it was one of the most blatant examples of poorly designed web site, with a web app that lost records, and never scaled to the size required to serve millions of persons. It was a national scandal.

For such an audience as 10,000 users, you will indeed have no second chance, and better test your server before launching your app to make sure it will hold.

See https://duckduckgo.com/?q=web+site+test+load

I just did a quick test of one my hosted sites in France that has only one HTML index page of 335 bytes (under construction) with http://loadimpact.com an the results are extremely far from even approaching what you may need. It does not look good.

Is the 10,000 apps figure based on projections, or only hope ?

Oh okay I was not aware of that :slight_smile: thanks. 10k apps is based on projections