Love, Death and PostgreSQL Triggers (2022)
The GitGuardian engineering team replaced PostgreSQL triggers with Celery tasks to address performance issues. Triggers caused unexpected behavior and complexities, leading to a shift towards simpler asynchronous computation methods for better performance.
Read original articleThe article discusses how the GitGuardian engineering team initially leveraged PostgreSQL triggers to enhance performance but later decided to remove them due to various issues. Triggers were used to precompute aggregates for complex queries, but they led to unexpected behavior and performance problems over time. The cascading nature of triggers caused hidden complexities and performance issues, especially with bulk inserts. To address these issues, the team decided to remove triggers and opt for a simpler approach by computing fields in asynchronous tasks using Celery. This decision aimed to maintain read performance while accepting lower write performance and a slight delay in updating computed fields. The team concluded that while triggers can be useful for enforcing consistency, they must be kept simple and integrated into standard development processes. Despite the challenges faced, some triggers were retained at GitGuardian.
Related
PostgreSQL Statistics, Indexes, and Pareto Data Distributions
Close's Dialer system faced challenges due to data growth affecting performance. Adjusting PostgreSQL statistics targets and separating datasets improved performance. Tips include managing dead rows and optimizing indexes for efficient operation.
Our great database migration
Shepherd, an insurance pricing company, migrated from SQLite to Postgres to boost performance and scalability for their pricing engine, "Alchemist." The process involved code changes, adopting Neon database, and optimizing performance post-migration.
Just Use Postgres for Everything
The article promotes using Postgres extensively in tech stacks to simplify development, improve scalability, and reduce operational complexity. By replacing various technologies with Postgres, developers can enhance productivity, focus on customer value, and potentially cut costs.
How we tamed Node.js event loop lag: a deepdive
Trigger.dev team resolved Node.js app performance issues caused by event loop lag. Identified Prisma timeouts, network congestion from excessive traffic, and nested loop inefficiencies. Fixes reduced event loop lag instances, aiming to optimize payload handling for enhanced reliability.
Eight Years of GraphQL
A critique of GraphQL's viability after 8 years raised concerns about security, performance, and maintainability. Emphasized the importance of persisted queries and understanding trade-offs before adoption.
Related
PostgreSQL Statistics, Indexes, and Pareto Data Distributions
Close's Dialer system faced challenges due to data growth affecting performance. Adjusting PostgreSQL statistics targets and separating datasets improved performance. Tips include managing dead rows and optimizing indexes for efficient operation.
Our great database migration
Shepherd, an insurance pricing company, migrated from SQLite to Postgres to boost performance and scalability for their pricing engine, "Alchemist." The process involved code changes, adopting Neon database, and optimizing performance post-migration.
Just Use Postgres for Everything
The article promotes using Postgres extensively in tech stacks to simplify development, improve scalability, and reduce operational complexity. By replacing various technologies with Postgres, developers can enhance productivity, focus on customer value, and potentially cut costs.
How we tamed Node.js event loop lag: a deepdive
Trigger.dev team resolved Node.js app performance issues caused by event loop lag. Identified Prisma timeouts, network congestion from excessive traffic, and nested loop inefficiencies. Fixes reduced event loop lag instances, aiming to optimize payload handling for enhanced reliability.
Eight Years of GraphQL
A critique of GraphQL's viability after 8 years raised concerns about security, performance, and maintainability. Emphasized the importance of persisted queries and understanding trade-offs before adoption.