How to bring coordination between file system and database?

后端 未结 4 1419
一向
一向 2021-01-02 12:24

I am working on a online file management project. We are storing references on the database (sql server) and files data on the on file system.

We are facing a probl

4条回答
  •  难免孤独
    2021-01-02 12:57

    Treat the two events (managing the reference, and managing the file) as a single transaction. If either one fails, back the other one out. Then you should find it hard to get into a situation where the two are not in sync. It's easier to rollback database operations than filesystem operations.

提交回复
热议问题