Webclient Attachment Failover via Local Caching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing messaging services face data loss issues when users compose messages with attachments, as these attachments are not saved locally in the webclient and can be lost if the connection to the HTTP server fails before the message is saved or sent.
Innovation Solution
The HTTP server receives and copies attachment content to a storage system, storing metadata associated with the attachment and message, allowing the backup HTTP server to retrieve and send the attachment if the initial connection fails, ensuring data integrity without consuming storage space on the mail server during composition.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of substance
If attachment content is stored only on the HTTP server without local caching in the webclient, then server storage space is optimized, but data loss occurs when the connection to the HTTP server fails
Solution Approach 1:
The system performs preliminary action by storing attachment content in the webclient's local cache before the user finishes composing the message. This advance local storage ensures that if the HTTP server connection fails, the attachment data is already preserved locally and can be recovered, thus preventing data loss while maintaining server storage optimization.
Solution Approach 2:
The webclient acts as an intermediary between the user and the HTTP server for attachment data. It maintains a local cache that serves as a buffer, allowing the user to continue working with attachment data locally even when the server connection is unavailable. The attachment content is stored locally with a reference to the server copy, enabling recovery without requiring continuous server connectivity.
2Reliability
If attachment content is cached locally in the webclient, then data loss is prevented on server failure, but server storage space is consumed
Solution Approach 1:
The system performs preliminary action by storing attachment content in the webclient's local cache before the user finishes composing the message. This advance local storage ensures that if the HTTP server connection fails, the attachment data is already preserved locally and can be recovered, thus preventing data loss while maintaining server storage optimization.
Solution Approach 2:
The system implements discarding and recovering by maintaining attachment content locally only temporarily during message composition. Once the message is successfully sent or the user abandons it, the local cache entry is discarded. This temporary local storage provides reliability during the critical composition phase without permanently consuming server storage space.
3Reliability
If the webclient stores all message content including attachments locally, then data loss is prevented, but device memory consumption increases
Solution Approach 1:
The system extracts only the essential attachment content data needed for recovery purposes and stores it locally in the webclient, while keeping the full attachment files on the server. This selective local storage of minimal necessary data prevents data loss without significantly increasing device memory consumption, as only metadata and recovery information are cached rather than complete copies of large attachment files.
Data Source
AI summary
An attachment received from a webclient for a message in composition can be saved by an HTTP server in a storage system. Location information for the attachment can be stored in a database in a record associated with the webclient. If the HTTP server is unexpectedly unavailable, a backup HTTP server can locate the attachment using the record in the database and provide the attachment to a messaging server when the user is ready to send the message.


