- WAL: Write-Ahead Logging. A log written in advance. A method of recording changes in a log before actually modifying the DB data
- CDC: Change Data Capture. Detecting in real time what data changed in a DB and passing it to another system.
- CDC can use several methods. One of them is log-based CDC, and WAL is a way of recording that log. Other methods include trigger-based (recording change events with DB triggers), query/polling (querying the DB periodically), and application-level (the application publishes an event at the same time as the change).
- WAL's original purposes include crash recovery, durability, and replication (replicating the data from one DB to another DB), but it can also be used for CDC
- WAL is written in a low-level language understood by the DB engine => Logical Decoding is needed to decode it into a form readable like SQL statements. In other words, WAL -> Logical Decoding -> CDC