Company
Date Published
Author
Mahmoud Abdelwahab
Word count
1067
Language
English
Hacker News points
None

Summary

Neon's branching feature offers a flexible solution for instant data recovery by allowing users to restore data to a previous state in a serverless Postgres environment. This is achieved through creating isolated copies of the Postgres cluster, known as branches, using a copy-on-write method that is both fast and cost-effective. Branches can be created from any point within a seven-day data history window, leveraging Write-Ahead Log (WAL) records to ensure data integrity. The feature also supports maintaining the same compute endpoint during data restoration, eliminating the need for connection string changes. This process can be managed programmatically via the Neon CLI or API, and a TypeScript script example is provided to guide users in implementing this functionality. Users are advised to delete or rename old branches to manage storage costs effectively.