October 2022 Summaries
9 posts from PlanetScale
Filter
Month:
Year:
Post Summaries
Back to Blog
MySQL offers various integer types, including INT, BIGINT, MEDIUMINT, SMALLINT, and TINYINT, each with its own range of numbers. The INT type can store up to 4,294,967,296 values, but MySQL also has a signed 32-bit value with 31 bits for the actual number and one bit for the sign. This allows it to store negative numbers by default unless otherwise specified. MySQL also permits using UNSIGNED keyword when creating a column, which tells the database engine that all values should be positive. The choice of integer type depends on whether you need to store negative numbers or how large the numbers are.
Oct 31, 2022
932 words in the original blog post.
Vitess 15 is now generally available with new enhancements designed to make it easier to use, more resilient, and easier to scale. The new VTOrc cluster monitoring and recovery component eliminates manual intervention and automates recovery, making Vitess fully self-healing and resilient to MySQL server failures. Additionally, VTAdmin provides a single control plane for managing multiple Vitess clusters, reducing the operational burden and downtime for users. Progress has also been made on VEP-4, reorganizing code to improve usability, and VDiff v2 has been updated with significant improvements in memory efficiency and resumability. Further enhancements have been made in MySQL compatibility and performance, including improved query plans and benchmarking infrastructure. The new release encourages users to try it out and invites feedback via GitHub or Slack.
Oct 26, 2022
548 words in the original blog post.
Vitess is an open-source database clustering system for MySQL that enables resiliency, scalability, and performance by running multiple instances of MySQL on one or more servers, with a lightweight proxy routing queries to the proper instance. It allows horizontal sharding with minimal application changes, balancing the load across multiple servers, and automatically detects when a MySQL instance goes offline, determining the best candidate to take its place as the primary process to serve queries for a given table. Vitess also improves performance by managing connections between subsystems, establishing lightweight connections to VTGate, which then maps them to a smaller pool of MySQL connections managed by VTTablet, resulting in lower resource utilization. PlanetScale leverages Vitess to offer a serverless database that scales and increases developer velocity, with all the benefits of Vitess infrastructure spun up in mere seconds for developers to start building on.
Oct 21, 2022
779 words in the original blog post.
Vitess is an open-source database clustering system for MySQL designed to increase resilience, scalability, and performance by running multiple instances of MySQL on one or more servers, using a lightweight proxy to route queries intelligently, and automatically detecting when an instance goes offline. It enables horizontal sharding with minimal application changes, balancing the load across multiple servers, and improves performance through efficient connection management, allowing thousands of clients to be handled simultaneously without overloading individual MySQL processes. PlanetScale leverages Vitess to power its databases, providing a scalable and performant database platform that increases developer velocity while eliminating the need for managing underlying infrastructure.
Oct 21, 2022
784 words in the original blog post.
Laravel's safety features can help prevent painful mistakes, including N+1 prevention, partially hydrated model protection, attribute typos and renamed columns, mass assignment protection, model strictness, polymorphic mapping enforcement, preventing stray HTTP requests, and long-running event monitoring. These features are designed to ensure application correctness and performance, and can be enabled in various environments to prevent issues such as data loss, overwriting data, and silent failures. By enabling these protections, developers can focus on writing correct code rather than worrying about potential pitfalls.
Oct 19, 2022
3,552 words in the original blog post.
Arewefastyet is an automatic benchmarking tool that runs daily micro and macro benchmarks to monitor Vitess performance. It utilizes PlanetScale's Insights tool for database monitoring, which provides detailed query-level insights. By leveraging Insights, Arewefastyet was able to detect slow queries and improve their performance by 85% through the addition of indexes. The tool allows users to easily identify problematic queries, debug issues, and make data-driven improvements in a timely manner.
Oct 11, 2022
542 words in the original blog post.
INNER JOINs return only records with matching keys in both tables. LEFT JOINs return records from the first table if they are referenced by the second table, while RIGHT JOINs return records from the second table if they are referenced by the first table. FULL OUTER JOINs return all records from both tables, even if there is no match. WHERE can be used to filter results to show only records with NULL keys, and UNION combines the results of two queries into one result set. With a good understanding of joins, developers can write powerful and efficient queries in MySQL.
Oct 07, 2022
1,599 words in the original blog post.
MySQL joins allow you to combine data from multiple tables by linking related records together, enabling you to return columns from more than one table into a single set of results. INNER JOINs return only matching records between tables, while LEFT and RIGHT JOINs return all records from the left or right table, respectively, even if there's no match in the other table. FULL OUTER JOINs return all records from both tables, but are not supported in MySQL; instead, you can use a UNION of LEFT and RIGHT JOINs with a WHERE clause to filter out matches. Understanding how to use these different types of joins is crucial for performing powerful and efficient queries in MySQL.
Oct 07, 2022
2,052 words in the original blog post.
MySQL gives us the JSON data type back in mid-2015 with the release of MySQL 5.7.8, allowing us to escape rigid column definitions and store JSON documents of various shapes and sizes. However, direct indexing of JSON columns is not possible in MySQL due to the lack of Generalized Inverted Index (GIN) support. Instead, we can use generated columns or functional indexes to indirectly index parts of our stored JSON documents. Generated columns are calculated columns that can be used like any other column, while functional indexes are implemented using a hidden generated column. To create a functional index on a JSON expression, we need to cast the value to a type that is not LONGTEXT, and explicitly set the collation of the cast to utf8mb4_bin. Functional indexes come with some pitfalls, but can be a powerful tool for indirect indexing of specific keys. While direct JSON indexing may not be available in MySQL, indirect indexing can cover most use cases, and generated columns and functional indexes can be used across various types of common patterns.
Oct 04, 2022
1,788 words in the original blog post.