Snappy, the Snaplet cat mascot illustrating Snaplet filtered snapshots

Filtered database snapshots: A perfect (data) slice

Easier development and debugging with Snaplet's database subsetting and filtered snapshots

We're excited to announce a feature that will make developing and debugging even easier for developers: Filtered Snapshots! You already know and love Snaplet for its ability to provide production-like data for your development environment, now we're taking it to the next level by enabling you to be super-granular about the exact data you capture into your snapshot.

How do filtered snapshot work?

This new feature lets you create snapshots with specific data based on the criteria you define, giving you the precise data you need to debug or code for specific use cases. Think of it as a perfect slice of exactly the right data when and where you need it.

Let's dive into a practical example of how this feature can be a lifesaver for developers:

Imagine you're part of the development team for MathTutorConnect, a math learning app that connects eager students with experienced mathematics tutors from around the world. You've received reports from several users about a recurring issue: the app is incorrectly displaying appointment times for sessions between students and tutors in different time zones. This glitch is causing confusion, missed appointments, and frustrated users on both sides.

To debug this issue, you need access to highly specific and targeted data that reflects the real-world relationships between students and tutors, as well as their respective time zones. That's where Snaplet's filtered snapshots come to the rescue!

Using the filtered snapshot feature, you can create a snapshot that contains data for students and tutors who were affected by the bug. As you dive into the data of the affected users, you discover that the problem always seems to occur where at least one of the users is in a timezone with a non-integer hour offset (e.g., GMT+5:30, GMT+9:45).

Suspecting a problem, you create a new filtered snapshot that contains only users with non-integer hour timezone offsets. With the help of this filtered snapshot, you can reproduce the issue in your development environment, identify the root cause of the timezone-related bug, and implement a reliable fix. The day (and everyone’s calendars) are saved, thanks to you and your filtered snapshots.

Creating filtered snapshots is possible from within Snaplet Cloud - use the new drop-down on the snapshot list page to start creating a new filtered snapshot. You’ll be able to input your selection criteria, test your query to see how many rows of data are returned, and then create a snapshot with that data.

Select the dropdown to create a new filtered snapshot.

Use the filter to select the relevant data.

If you’re satisfied with the number of rows returned by the query, create a snapshot as usual.

Filtered snapshots are created just like normal snapshots - you can also tag them to help keep things organised. Once your filtered snapshot is created, you can restore as usual to your development environment, or use our new Preview Database feature to instantly spin up a Neon database containing your new filtered snapshot. Preview databases are quick, disposable, and easy to share - perfect for quick collaboration.

Preview databases allow you to quickly create a database you and your team can code against from a snapshot.

That’s it! In a few minutes, you can use Snaplet to create an isolated database containing just the data you needed to diagnose a troublesome bug.

Bonus - using filtered snapshots in conjunction with preview databases can democratise the debugging process - Snaplet Cloud is so easy to use, anyone in your team can use it. For example, your Customer Success team can easily use filtered snapshots to quickly, safely, and easily share relevant information with developers all from inside Snaplet Cloud about users who may be affected by a certain bug. Check out Snaplet team member Jian doing a demo of how this works for real:

With filtered snapshots, you've got the power to not just squash the trickiest bugs with ease but also whip up new features using the exact data you need. Say hello to a more precise, more targeted, more efficient development environment. Happy coding! 🚀

Jian Reis
January 24, 2022