CodePen Radio

383: Soft Delete All


Listen Later

In this show, Stephen and Chris get to talk about an internal technical detail we were improving in our database, which led to a public-facing feature for y'all. The idea is that all (most, anyway) database tables should have a deleted_at column. When you query against them, under regular circumstances, any rows that have a non-null value will be filtered out. This is the concept of "soft" delete. It's not really gone from the database, it just behaves like it is. This has two clear benefits:

  1. Deleting is super fast, it's just manipulating a single value.
  2. It opens the door for un-deleting things that perhaps were mistakenly deleted.

This approach can be slightly more work. You'll need to offer a way to truly wipe data completely for users. You'll probably want a reaper to clean up data that has been deleted long enough. You'll need to comply with regulations about data deletion. You might have to build un-deletion features. You might need to be doing that filtering yourself throughout the app. It's work, but it's generally worth it.

In our case, because we soft delete everything on CodePen now, the Deleted Items area of Your Work now works for all Item Types (Pens, Collections, and Projects). Before, it only worked for Pens, and even there it was a little messy as it didn't retain the URL slug or comments and such — now it does.

Time Jumps
Sponsor: Memberful

Memberful is a best-in-class membership software used by the web's biggest creators. If you're building a membership website for a client, Memberful handles the hard stuff so you can complete your builds quickly and your clients can focus on creating content while earning revenue with ease. It seamlessly integrates with popular tools like WordPress, Mailchimp, and Discord, so they can reach and monetize their existing audience. Memberful maintains GraphQL API, webhooks, and OAuth Single Sign on to make integration even easier.

Help your client monetize their passion. Get started for free at Memberful.com

...more
View all episodesView all episodes
Download on the App Store

CodePen RadioBy CodePen Blog

  • 4.9
  • 4.9
  • 4.9
  • 4.9
  • 4.9

4.9

86 ratings


More shows like CodePen Radio

View all
Hanselminutes with Scott Hanselman by Scott Hanselman

Hanselminutes with Scott Hanselman

384 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

292 Listeners

Startups For the Rest of Us by Rob Walling

Startups For the Rest of Us

702 Listeners

ShopTalk by Chris Coyier & Dave Rupert

ShopTalk

502 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

624 Listeners

Soft Skills Engineering by Jamison Dance and Dave Smith

Soft Skills Engineering

288 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

983 Listeners

Abroad in Japan by Stak

Abroad in Japan

1,918 Listeners

Tech Brew Ride Home by Morning Brew

Tech Brew Ride Home

960 Listeners

Naval by Naval

Naval

2,136 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

141 Listeners

Hard Fork by The New York Times

Hard Fork

5,473 Listeners

PodRocket by LogRocket

PodRocket

58 Listeners

BG2Pod with Brad Gerstner and Bill Gurley by BG2Pod

BG2Pod with Brad Gerstner and Bill Gurley

517 Listeners

Risky Business with Nate Silver and Maria Konnikova by Pushkin Industries

Risky Business with Nate Silver and Maria Konnikova

293 Listeners