i've been seeing too many devs trying to manage checkout state in the main postgres db. it's bloating the tables with abandoned carts that nobody ever comes back to. better to just use a ttl on a redis key so it cleans itself up automatically. if the user hasn't finished the payment within an hour, the data is gone and the db stays clean.
never store transient session data in your primary relational store.
SETEX checkout_session:user_123 3600 '{"items": [45, 99], "total": 120.50}'it's basically free cleanup work for the engine. it works fine as long as you don't need that data for long-term analytics later. anyone else still using postgres for temporary cart states?