Redis subscriptions and transactions

1, Redius subscription:

Subscribe subscribe using keywords:

 

 Keyword publish release:

 

 After the release, the page will subscribe to published content appears.

2, Redis transaction:

Redis different affairs and the affairs of mysql, mysql transaction is in multiple sql statement, as long as there is a need to roll back the transaction are executed successfully.

 

 multi: open affairs.

exec: commit the transaction.

discard: roll back the transaction.

 Although there is an error in redis, still be able to submit normal, mysql database transaction, rollback operation will not change the contents of the database.

 

 Above demonstrate that the rollback, the previous operation after the rollback is invalid.

Guess you like

Origin www.cnblogs.com/zhai1997/p/11735533.html