Skip to content

Instantly share code, notes, and snippets.

@avesus
Created March 13, 2020 16:25
Show Gist options
  • Save avesus/5d04e4537e78eb448d77da50bb05c855 to your computer and use it in GitHub Desktop.
Save avesus/5d04e4537e78eb448d77da50bb05c855 to your computer and use it in GitHub Desktop.
IO classification over Read, Overwrite, Move, Append

All external world facilities should have wrappers to support unit-testable and simply clean code.

These external world facilities:

a) might return different data when reads are requested because the data can be changed either by external "actors" or by a concurrent thread of the same client (this lambda); Examples: SQL SELECT, HTTP GET

b) do provide write APIs. We classify writes according if they destroy old data or make it unavailable at old locations

- "Append-Only": not destructive operation increasing amount of information.
    Examples: SQL INSERT, HTTP POST, CloudWatch logger.warning(), S3 put a file ("put" to confuse), SQS send_message()

- "Overwrite": destructive write operations potentially hiding (destroying) the old data.
    Examples: SQL UPDATE and DELETE

- "Restructure": reorganizing operations often not damaging data, but making it unavailable at old locations.
    Examples: file or directory move, SQL ALTER TABLE RENAME COLUMN etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment