Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Being part of gnarly production outages isn’t uncommon. In this talk, I will share short entertaining stories about a few head scratching production outages we faced and how we used efficient and simple PostgreSQL features in Rails to build scalable solutions. I will also discuss how and when to use certain PostgreSQL concepts in Rails, such as optimistic and pessimistic locking, using real-life examples that power core customer features. Finally, I will discuss uses of Postgres mutex to manage concurrent access to shared resources and wrap up by sharing our own experiences and lessons from other production outages. This will help you avoid common operational pitfalls and improve your application's reliability and query patterns.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this talk at RailsConf 2023, Shayon Mukherjee discusses practical PostgreSQL techniques that can improve the reliability and scalability of Rails applications, especially in the context of production outages. Key points covered include: - **Understanding Production Incidents**: Mukherjee shares anecdotes from production outages, emphasizing the learning opportunities they present to refine systems and processes. - **Case Study of a Production Incident**: He narrates an incident involving dynamically scheduled jobs where a race condition in their scheduling system led to missed job executions. This incident highlighted critical flaws in their earlier approach and prompted a system redesign. - **PostgreSQL Locking Mechanisms**: The talk delves into optimistic and pessimistic locking, explaining how they are applied in PostgreSQL. Mukherjee particularly emphasizes the advantages of optimistic locking in ensuring robust concurrency control. - **New Scheduler System Design**: Post-incident, the team implemented a new scheduling system that runs jobs based on a fan-out approach, reducing complexity and ensuring that even if jobs are slightly late, they won’t be completely missed. - **PostgreSQL Features**: Various PostgreSQL features like skip locking and advisory locks are discussed. Skip locking helps minimize contention in high-concurrency scenarios, while advisory locks allow application-level control over locks for coordinated access to shared resources. - **Operational Best Practices**: Mukherjee concludes with practical advice on query timeouts, connection pooling, and auto-healing applications to enhance resilience during database outages. The session emphasizes that while technology can fail, careful design and the right PostgreSQL techniques can prevent significant production issues, thus improving application reliability and performance.
Suggest modifications
Cancel