简体   繁体   中英

Buffering Data offline when the database server is not available

I'm new to C#, i have implemented an application which read data from socket and store it using a separate thread in an oracle DB on remote server. My Question is: when the database server is down and i can not save the data in the data base, is there a tools or techniques in C# or .net that allow me to buffer the data locally then send it to the server when the connection is available again. I dont want to lose the information that are coming from the socket, at the same time i would like to preserve on data consistency in my oracle databse becuase i have a sequence and some triggers that save additional information after inserting each record.

You are trying to introduce fault tolerance

Approaches:

  1. A message queue server (best) like MSMQ, RabbitMQ, or similar
  2. A local database such as SQLite or SQL Server Express.
  3. A local file in JSON, XML, or CSV format.

With any of these approaches, they will store records until your database server is available again. The message queue is the most scalable approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM