Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

Foreign key constraints are now generally available

Blog post from PlanetScale

Post Details
Company
Date Published
Author
Taylor Barnett, Rick Branson
Word Count
545
Language
English
Hacker News Points
-
Summary

Foreign key constraints, which enforce referential integrity in databases, are now generally available on PlanetScale. Over 2,400 PlanetScale databases have enabled this feature during the beta phase. To enable foreign key constraints, go to your database's "Settings" page and check the box to Allow foreign key constraints. Foreign key constraints ensure consistency between related data in different tables by enforcing rules on how records can be inserted or deleted. While they can help maintain referential integrity, they may also cause performance issues in high concurrency workloads and add complexity to the database. Developers should carefully consider whether to use foreign key constraints based on their specific application needs.