CRUD
Table of Contents
When talking in terms of a objects in a state, or more generically : data, the CRUD acronym represents the overarching operations that one can perform on it. Do note that three of these are explicit mutations of the state but you do need to read a resource to be able to manipuate it.
- Create
- Read
- Update
- Delete
From a Query Language standpoint when talking about persistent data storage systems (DataBases, for instance), These can be mapped to:
- Insert
- Select
- Update
- Delete
1. Prominence
- Standardization : common language to categorize interactions between code and data (side note : see - homoiconicity)
- Essential for Data management : most applications processing and manipulating data relies on CRUD operations or variants thereof.
- Design Principles: the difference in requirements of the individual operations aids in strategizing during the system design phase.
- for instance a system might need to facilitate a much larger number of reads than writes : this influences the choices for internals of your system.
2. Immutability
- you don't need to actually mutate "objects" in the memory (you can't do without overwriting bits, however) to simulate CRUD.
- languages like clojure (another lisp), use persistent data structures and conditional memory sharing to efficiently simulate such operations while maintaining immutability.
- updates are actually replaces in this context
- Another benefit of maintaining immutability is that maintaining logs of all events help exactly reconstruct the underlying state and can replace state backups altogether. (DataBases usually do both)
- This has interesting consequences, consider reading:
- manipulating state is a more computational (than the mathematical) aspect of programming.
- this yielding a theoretical interface between the computation and math when you'd like to simulate immutability on a computer, i.e, the Monad
- also read up on Mutability (side-effects in this context)