开发者

AJAX Polling in an API for commercial use [closed]

开发者 https://www.devze.com 2023-03-13 19:14 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. 开发者_高级运维 Want to improve this question? Update the question so it can be answered with facts and citation
Closed. This question is opinion-based. It is not currently accepting answers.
开发者_高级运维

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed last month.

Improve this question

Currently I'm developing an API that uses AJAX interval polling, it polls at 900bytes every 1.5 minutes, does not seem to put a heavy load on MySQL and is only one AJAX stream. I plan on upgrading to a node.js server once I get enough revenue from this start up but as of now I can only afford buying a shared host that uses apache.

In terms of scalability would this be viable? Also, would this be acceptable from a commercial standard, since other solutions like comet are now available?


"does not seem to put a heavy load on MySQL"

For some number of users it must eventually put on a "heavy" load, but that's not a "bad thing".

For any application, architected in any way, there will be some point at which some part of the infrastructure creaks. That's not an intrinsic reason to adopt some more sophisticated solution (and move the bottleneck elsewhere).

So gather some empirical data, such as : for what number number of uses does this polling load become significant? Do some load tests, not just of polling but of the other work these users are doing. They surely are not just polling they are doing other stuff that will also load MySQL. When does this creak? At that point would the resulting revenues allow you to buy more capacity? Or would you have confidence that a different architecture would fix the problem. In other words do you have a realistic "out"?

My guess is that if polling becomes an issue you have some good intermediate solutions such as caching, or reducing the polling frequency, in addition to the possibility of introducing Comet. And so it's reasonable to start with your simple polling strategy.

0

精彩评论

暂无评论...
验证码 换一张
取 消