Database / LanceDB Interview questions
What is the difference between checkout and restore in LanceDB?
Both operations move a table's view to a past version, but they differ in whether that move is temporary and read-only or permanent and writable going forward.
| checkout() | restore() |
| Pins the table to a past version for reading. | Creates a new version whose data matches a past version. |
| Read-only while checked out. | Writable immediately; it's now the latest version. |
| Reversible via checkout_latest() with no new version created. | Adds a new entry to version history; doesn't remove intervening versions. |
| Good for inspecting or querying historical state. | Good for rolling back to an earlier state and continuing from there. |
A subtlety worth remembering: restoring version 2 when the table is currently at version 5 doesn't delete versions 3, 4, and 5 from history — it creates version 6, whose data matches version 2, so the full timeline (including the "mistake" versions) remains inspectable if needed later.
More Related questions...