Skip to content

No foreign key constraints? #339

@Simbiat

Description

@Simbiat

Consider not using foreign keys. This could help with #338
GitHub does not use them github/gh-ost#331 (comment) allegedly
PlanetScape does not recommend them either https://planetscale.com/docs/vitess/operating-without-foreign-key-constraints

Considering that I added FKCs to help remove queries to clean-up some stuff this could be a step-back, but on the other hand, if it will improve overall performance and storage (some columns may not require index, but index is created due to FKC) - it may be worthwhile still, and could provide a bit more control from code level. And it would be a more explicit deletion, too.

This could also allow more data restoration logic. For example, I could delete a thread with all posts, but actually delete only the thread first, and then delete posts after a grace period. That way I can "recreate" a thread during that grace period without losing data.

This would require update to Cron, at least, from perspective of libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureIssue is related to architecture of the service

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions