Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2019 - Postgres & Rails 6 Multi-DB: Pitfalls, Patterns, Performance by Gabe Enslein _________________________________________________________________________________________ Cloud 66 - Pain Free Rails Deployments Cloud 66 for Rails acts like your in-house DevOps team to build, deploy and maintain your Rails applications on any cloud or server. Get $100 Cloud 66 Free Credits with the code: RailsConf-19 ($100 Cloud 66 Free Credits, for the new user only, valid till 31st December 2019) Link to the website: https://cloud66.com/rails?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 Link to sign up: https://app.cloud66.com/users/sign_in?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 _______________________________________________________________________________________ This is a sponsored talk by Heroku. Rails 6 has officially added Multiple database support, and the options are overwhelming. We're here to help you make the right architecture decisions for your app. In this talk, we will look at performance gains and pitfalls to some common patterns including: separation of concerns, high-load tables, and data segmentation. We'll talk about read replicas, eventual consistency, and real-time (or near real-time) requirements for a Rails application using multiple Postgres databases.
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 the talk titled "Postgres & Rails 6 Multi-DB: Pitfalls, Patterns, Performance" delivered by Gabe Enslein at RailsConf 2019, the new features of Rails 6 regarding multiple database support are explored. The speaker discusses the overwhelming options available with this feature, emphasizing the importance of making informed architectural decisions for applications using Rails and Postgres. Key Points Discussed: - **Multiple Database Support**: Rails 6 allows developers to specify read and write databases at various levels of the application, including rake tasks and Active Record models. - **Performance Challenges**: As applications grow, performance issues arise, such as slow query times for high-load tables when handling large datasets. Enslein provides an example of a successful self-help business experiencing slowdowns due to millions of users updating profiles and uploading content. - **CAP Theorem**: The discussion incorporates the CAP theorem, explaining the trade-offs between consistency, availability, and partition tolerance, and how this applies to the design of a Rails application using multiple databases. - **Optimizing Queries**: Techniques like moving expensive read queries to replicas, creating appropriate indexes, and analyzing query performance using "EXPLAIN ANALYZE" are highlighted to alleviate performance issues. - **Pitfalls of Replicas**: Enslein addresses issues related to follower lag in read replicas, caused by the workload on the primary database affecting replay speed on the replicas, leading to inconsistent data being served to users. - **Partitioning**: The advantages of partitioning large tables to improve performance and manageability are discussed, especially for the quotes table, which can help in better resource utilization and caching strategies. - **Sharding**: As the application grows, the potential to shard databases is introduced as a means of separation of concerns, ensuring that the main user-access database remains performant. - **Network Latency and Connection Management**: The importance of managing connections properly across multiple databases is discussed, acknowledging the added complexity and potential bottlenecks introduced by network latency and connecting to multiple databases. Enslein emphasizes the need for proper connection pooling and monitoring. Conclusions and Takeaways: - It is essential to make careful architectural choices when implementing multi-DB support in Rails applications, particularly regarding expected performance and scaling. - Understanding PostgreSQL's features, such as partitioning and connection pooling, can drastically improve application performance. - Proactive measures, such as implementing monitoring tools and adjusting database connections, can prevent performance issues before they affect users, ensuring a smoother experience as application traffic grows.
Suggest modifications
Cancel