duanchuli5647 2018-04-02 00:41
浏览 59

如何优先处理后端mysql访问

I made a website using mysql (InnoDB), php-mysqli and PDO to track progress data.

Originally, there are massively simultaneous SELECT-UPDATE queries at the backend. In one transaction, two statements are presented: SELECT id FROM ... WHERE started = 0 FOR UPDATE, UPDATE ... SET started = 1 .... They are separated because of some pre-processing. The backend works quite well.

Now I'm coding a frontend monitoring the database and plan to use statements like SELECT COUNT(started) FROM ... WHERE started = 0. I'm unsure about which kind of lock mysql will use under such circumstance. As I needn't guarantee every frontend call is successful, the success rate of the backend is more important.

To clarify, "backend" here is several PHP files that would be accessed by program as REST API; "frontend" is a PHP accessed by user.

Q: May these monitoring SELECT result in backend failures? If so, is there a way of prioritizing backend access?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号