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 database servers. 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. @shopify Senior Software Developer Adrianna Chang explores why the Trilogy client was built and why Shopify wanted to adopt it. Links: https://rubyonrails.org/ #RailsWorld #RubyonRails #rails #opensource #MySQL #ActiveRecord #Trilogy
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 presentation, Adrianna Chang, a Senior Software Developer at Shopify, discusses the migration process of Shopify's core Rails monolith from MySQL2 to Trilogy, a client library for MySQL-compatible databases. The talk outlines the motivation behind adopting Trilogy, a database client that promises improved performance, better portability, and fewer dependencies compared to MySQL2. Key points of the presentation include: - **Trilogy Overview**: Trilogy, written in C with Ruby bindings, is self-contained with minimal dependencies, making it simpler to install than MySQL2, which relies on the external libmysqlclient library. This design helps avoid client-server version mismatches and offers better memory efficiency. - **Reasons for Migration**: Migrating to Trilogy aimed to enhance developer experience by simplifying the setup process, achieving higher query performance, and aligning with a library maintained by active contributors from GitHub. - **Migration Steps**: The migration involved setting up Trilogy in the application, handling API differences, and updating error handling practices. Chang emphasized the importance of ensuring feature parity and mentioned the development of multi-statement support as a critical addition for Shopify’s needs. - **Production Deployment**: The deployment strategy involved initially running Trilogy on 1% of the production traffic to ensure stability before scaling up. Change tracking, CI management, and success metrics were closely monitored throughout this phased approach. - **Results**: The results showed a speedup with Trilogy performing significantly faster than MySQL2, with average requests times reducing drastically. - **Upstreaming to Rails**: After successfully running Trilogy in production, the team collaborated with GitHub to add Trilogy support to Rails 7.1. This collaborative effort aimed to enhance the adapter's ownership and integration within the Rails framework, ensuring better maintainability. In conclusion, the migration journey from MySQL2 to Trilogy at Shopify reflects a strategic decision to leverage a modern database client while contributing back to the Rails ecosystem, enhancing both performance and community resources. Adrianna encourages developers to consider adopting Trilogy in their Rails applications and to get involved with its ongoing development.
Suggest modifications
Cancel