If I am collecting data that needs to be posted to a web service on a regular (~5 minutes) basis, and that service has temporarily gone offline, what is the best practice to ensure we don't lose any data?Of course, we could simply buffer in memory until the service is back online, but what if the service is offline for a great period of time?  Should we fall back to simply storing the serialized data to the local file system until the service is back online?Are there other considerations/practices?  Any 'out of the box' frameworks that handle this for C#?EDIT: It's business critical that we don't lose any, or very minimal, data as it's for auditing for sensitive temperature controlled environments. We'll be using Json, and they will simply be sensor readings (not a large amount of data). We'll be using Web API, probably hosted on Azure, so the availability of the service should be good. Of course there are other factors such as localised network concerns. Everything will be under our control, apart from the infrastructure where the sensor software will be installed, this will be at client sites. 
Best practice for buffering when posting to a web-service that has gone offline
c#;web services
Since you mention that It's business critical that we don't lose any, or very minimal, data IMHO buffering in memory is not really a good idea - it's volatile and if your machine/process dies for whatever reason that data is lost. Plus in-memory buffering needs extra care (unknown downtime duration, chewing memory resources, etc).On upload failure I'd always fallback to storing the data in a local persistent location which can survive a server reboot. Whenever the current upload attempt succeeds (i.e. the server is back online) I'd retry uploading all outstanding data from the persistent location, maybe in multiple chunks if needed.Shouldn't be that complex to warrant an 'out of the box' framework solely for this purpose.