Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Trilogy is a client library for MySQL-compatible databases. It was open sourced along with an Active Record adapter by GitHub this past year. With promises of improved performance, better portability and compatibility, and fewer dependencies, Shopify’s Rails Infrastructure team decided to migrate our core Rails monolith from Mysql2 to Trilogy. In this talk, we’ll embark on a journey with database clients, Active Record adapters, and open source contributions. We’ll learn about MySQL protocols, dig into how the Active Record adapter manages the Trilogy client under the hood, and look at some of the missing features we implemented as we moved from Mysql2 to Trilogy. Finally, we’ll discuss the end result of migrating to Trilogy, and the impact it had on Shopify’s monolith in production.
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 her RailsConf 2023 talk, Adrianna Chang discusses the migration of Shopify's core Rails monolith from MySQL 2 to the newly open-sourced Trilogy client library. Trilogy, which was introduced by GitHub, promises better performance, fewer dependencies, and easier installation compared to MySQL 2. The presentation covers the technical aspects of the migration process, from understanding the Trilogy client and its integration with Rails through Active Record, to the challenges and rewards encountered along the way. **Key Points Discussed:** - **Introduction to Trilogy:** - Trilogy offers a Ruby client library for MySQL-compatible databases. - It eliminates the need for the MySQL client C library, thus simplifying installation and reducing potential version mismatch issues. - **Challenges of Migration:** - Identifying potential incompatibilities between MySQL 2 and Trilogy. - Addressing missing features, specifically multi-statement capabilities essential for bulk fixture inserts. - **Code Implementation:** - Demonstrated how Shopify worked on adding multi-statement support within the Trilogy client. - Explained the use of protocol capabilities during the authentication phase for database connections. - **Deployment Strategy:** - Shopify initially rolled out Trilogy to 1% of production traffic using an environment variable to test the new library under real load conditions. - Faced challenges when ramping up to 50% production, leading to connection overloads at the primary shard. Discovered that differences in protocol capabilities between MySQL 2 and Trilogy caused excessive load from the proxy SQL connection management. - **Performance Outcomes:** - After successful migration, they observed improved request times and query performance, demonstrating Trilogy's effectiveness over MySQL 2. - **Conclusion and Future Work:** - The successful migration allowed Shopify to contribute the Trilogy adapter back into Rails, making Trilogy easier to integrate into future Rails applications. - Offered guidance on adopting Trilogy in existing applications and encouraged the community to contribute to the ongoing development of Trilogy's tools. Adrianna's talk emphasizes the journey of adopting open-source technologies in a large application context, illustrating both the technical hurdles and the benefits of such migrations.
Suggest modifications
Cancel