I answered on LinkedIn about how transaction log, redo log, and WAL are the same.
In practice MSSQL transaction log ~= Oracle redo log ~ PostgreSQL WAL
but with more details: 🧵👇🏻
1. A transaction log must include:
- undo log
- redo log
- transaction boundaries
for A,C,I properties of ACID
It can be in memory but must be synced to disk at commit (#LogForceAtCommit) for the D property of ACID
2. For performance, writing data buffers to disk is deferred and reordered because random writes are slow. The changes lost after a crash can be rolled forward from the redo log to recover the on-disk state
3. The state on disk can have incomplete or uncommitted transactions. This is why the transaction log (with undo) must be written to disk before, with #WriteAheadLogging, to be able to rollback uncommitted transactions after a crash
There are some implementation variations. For example, Oracle redo log indirectly includes undo log (as the redo of the rollback segment). Similarly, PostgreSQL undo log is the redo log of xmin/xmax changes.
Oracle can bypass the buffer cache for some operations (direct-path load) and then does #WriteBehindLogging for it. @Yugabyte writes provisional records so that there are no incomplete transactions in regularDB so WAL is lighter and rollbacks faster
0⃣ I've heard many misconceptions about restoring tablespaces in @OracleDatabase so here a a little #backToTheBasics restore+recover concepts & how-to
👇
1⃣ A tablespace is a subset of the (monolith) database. There are physical operations (backup, transport, snapshot,...) that you don't want to do for the whole TB database. Then you dedicate some tablespaces to applications, datastores, large tables, read-only workloads,...
2⃣You may want to restore some data as-of yesterday (because you dropped a table by mistake for example) without having to restore the whole database. This is Tablespace Point In time Recovery (TSPITR). Let's say you dropped the tablespace USERS by mistake at 11:42 👇
5 critical features of managed DB services @awscloud RDS PostgreSQL checks all five 👍
1/5⌚✅be able to recover to a point-in-time beyond the last backup (any point-in-time within the retention)
2/5⏱️✅enable automatic backups (and be warned if not). They occur during the defined window but do not block the database activity. And RDS takes an initial backup at creation.
3/5🦺✅ prevent accidental deletion of an instance (remember in case of sh.t happening, you are in stress and can make things worse)