April 2024 Summaries
6 posts from PlanetScale
Filter
Month:
Year:
Post Summaries
Back to Blog
The text discusses how a consistent lookup Vindex is implemented in Vitess to ensure data consistency without using 2PC (Two Phase Commit). Vitess uses Vindexes, or indexes, to associate rows in a table with a designated address known as Keyspace ID. This enables efficient routing of queries in a sharded database. The consistent lookup Vindex is a type of Secondary Vindex that further enhances the efficiency and reliability of this mechanism by maintaining consistency between data tables and lookup indexes without using 2PC for all DML operations. Vitess uses three connections to perform DML operations, with carefully defined sequences of operations ensuring consistency even when record in the Vindex tables may be inconsistent. The text also provides examples of delete, insert, and update operations using consistent lookup Vindexes.
Apr 29, 2024
1,526 words in the original blog post.
The MySQL Adaptive Hash Index (AHI) is an optimization technique that improves the performance of B-tree lookups in relational databases, particularly when using the InnoDB storage engine. ABI works by creating a hash table in memory for frequently accessed values or value prefixes from a B-tree index, allowing faster direct lookups compared to traversing the B-tree structure. The ABI adapts its usage based on workload characteristics and can be enabled or disabled via configuration settings. In testing scenarios with large datasets and different query patterns, the ABI has shown performance improvements ranging from 16% to 20%.
Apr 24, 2024
2,240 words in the original blog post.
PlanetScale has introduced global replica credentials that automatically route reads to the closest replica from anywhere on the planet. This feature simplifies utilizing extra compute by creating a single password dedicated for replica use, which automatically load-balances across replicas in a region. The underlying architecture, PlanetScale Global Network, manages this without requiring users to reconnect and seamlessly routes to the read-only region with the lowest latency even as new regions are added or removed.
Apr 17, 2024
1,392 words in the original blog post.
The text discusses how to profile the memory usage of a MySQL connection using built-in mechanisms in MySQL. It covers memory statistics, finding usage for a connection, collecting usage over time, and plotting memory usage with visualizations. The author provides Python scripts that can be used to monitor memory usage during query execution and generate live stack plots showing the top memory usage categories. This detailed profiling of memory usage can help in identifying when and why MySQL may cause memory pressure on the system or if a memory upgrade for the database server is needed.
Apr 11, 2024
2,095 words in the original blog post.
Arvind Murty interned at PlanetScale from May to July 2023, working on Vitess, a database sharding system. His task was to find as many bugs in the Vitess planner as possible using SQLancer, a tool for testing DBMSs. However, due to Vitess' unique features and complexities, they decided to build their own random query generator. Murty worked on improving the fuzzer by adding most types of queries, modifying the query simplifier, and enhancing the expression generator. He suggests future improvements such as complicating or randomizing the schema and VSchema, and refactoring the codebase. Overall, his experience at PlanetScale was valuable in terms of practical contributions and learning about team-based software development.
Apr 09, 2024
922 words in the original blog post.
PlanetScale has developed an efficient process for making schema changes using GitHub Actions and their own platform. They aim to make this process as smooth and safe as possible, especially for larger teams with frequent deployments. The main steps include separating schema migrations from code deployment, utilizing online schema change tools like Vitess, ensuring application code is compatible with the new schema, and automating the process using a custom GitHub Actions bot. This workflow allows developers to make changes quickly while maintaining confidence in their impact on production. PlanetScale's schema change process can be adapted for other applications and CI tools as well.
Apr 04, 2024
1,430 words in the original blog post.