Performance is a retention factor. Users who experience a slow product churn at 2–3x the rate of users who experience a fast one. These 7 optimizations are the highest-ROI performance improvements for most SaaS products.
1. Fix N+1 Database Queries (Biggest Impact)
The N+1 problem: fetching a list of 50 items, then making an additional database query for each item to get related data — resulting in 51 queries instead of 2. Use database joins or Supabase's nested select syntax to fetch related data in a single query. This is the most common performance problem in SaaS applications.
2. Add Missing Database Indexes
Run EXPLAIN ANALYZE on your slow queries in Supabase. If you see "Seq Scan" (sequential scan) on tables with more than 1,000 rows, you need an index on that column. A single missing index can cause a 100x performance improvement when added.
3. Implement Optimistic Updates
Instead of waiting for a server round-trip before updating the UI, update the UI immediately and sync with the server in the background. Using React Query's useMutation with onMutate for optimistic updates makes your app feel 10x more responsive with 0 actual performance improvement on the backend.
4. Paginate Large Lists
Never fetch all records from a table. Implement cursor-based or offset pagination for any list that could grow large. Fetching 10,000 projects where a user needs to see 20 is wasted compute, wasted bandwidth, and a terrible user experience.
5. Optimize Images
Use Next.js's <Image> component for automatic WebP conversion, lazy loading, and proper sizing. An unoptimized 2MB hero image loading on a dashboard makes everything feel slow, even if your database queries are fast.
6. Add Proper Loading and Skeleton States
Perceived performance is as important as actual performance. A page that shows a skeleton loader for 500ms feels faster than a blank white page for 300ms. Add loading skeletons to every data-fetching component.
7. Cache Expensive, Rarely-Changing Data
Data that changes rarely (user profile, subscription status, organization settings) should be cached client-side with React Query's staleTime. This eliminates redundant API calls for data the user already has.
Build a Performant SaaS From Day One
I take 2 clients per month. Ship your SaaS in 2–4 weeks with a developer who has done it 350+ times.
Start on Fiverr →