Best way to handle concurrency issues

后端 未结 11 1218
迷失自我
迷失自我 2021-02-07 23:27

i have a LAPP (linux, apache, postgresql and php) environment, but the question is pretty the same both on Postgres or Mysql.

I have an cms app i developed, that handle

11条回答
  •  庸人自扰
    2021-02-07 23:33

    First off only update the fields that have changed on when writing to the database, this will decrease database load.

    Second, query the timestamp of the last update, if you have a older timestamp then the current version in the database then throw the warning to the client.

    Third is to somehow push this information to the client, though some kind of persistent connection with the server, enabling a concurrent two way connection.

提交回复
热议问题