{"id":105070,"date":"2025-01-10T23:48:28","date_gmt":"2025-01-10T23:48:28","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=105070"},"modified":"2025-01-11T01:40:48","modified_gmt":"2025-01-11T01:40:48","slug":"hacking-mysql-book-how-you-broke-database","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/hacking-mysql-book-how-you-broke-database\/","title":{"rendered":"I Wrote a Book on How You Broke Your Database \u2013 Here&#8217;s Why You Should Read It"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-preface\">Preface<\/h2>\n\n\n\n<p>If you are a frequent reader of Simple-Talk, it\u2019s possible that you\u2019ve come across blogs about <a href=\"https:\/\/www.red-gate.com\/simple-talk\/databases\/mysql\/optimizing-queries-in-mysql-optimizing-reads\/\">optimizing all kinds of queries<\/a>, <a href=\"https:\/\/www.red-gate.com\/simple-talk\/blogs\/backing-up-mysql-part-2-percona-xtrabackup\/\">tutorials on how to back up your database<\/a>, <a href=\"https:\/\/www.red-gate.com\/simple-talk\/databases\/mysql\/mysql-index-overviews-composite-b-tree-indexes\/\">tutorials on index internals<\/a>, or even <a href=\"https:\/\/www.red-gate.com\/simple-talk\/blogs\/mariadb-server-fest-2024-indexes\/\">speaking at conferences<\/a>. If you\u2019re a DBA, these things should resonate with you because all of those things have their place. These blogs advance your knowledge about database internals and query structure or inform you about things to come. They have their place in your career as a developer because they educate you about things in the tech space, specifically the database world.<\/p>\n\n\n\n<p>One more thing that educated people about all kinds of things of interest for ages were books. Books were a thing before some of us weren\u2019t even born, and it\u2019s an undeniable fact that they\u2019re here to stay. Those who have been in the industry for a while will know that books are a great resource to learn things because:<\/p>\n\n\n<div class=\"block-core-list\">\n<ol style=\"list-style-type:lower-alpha\" class=\"wp-block-list\">\n<li><strong>They provide us with long-form content<\/strong> meaning that you can dive into one specific topic and learn a thing or two or in-depth concepts about the subject that interests you as a reader.<\/li>\n\n\n\n<li><strong>They provide authors with portability to arguments<\/strong> in that if you can show me someone who has written a lengthy book about any topic, I can show you a person who is knowledgeable about the subject that the book is written on.<\/li>\n\n\n\n<li><strong>They teach people<\/strong> \u2013 if the person is knowledgeable about a specific subject and they write books about it, they usually do so because they want to teach others. Spreading knowledge through the written word is not an easy feat, and indeed, not a feat that everyone possesses. But if one possesses the talent to write (and, better yet, <em>influence<\/em> people as they write), they are able to give someone the ability to learn. If they help one person, that\u2019s an achievement to them both, and if they help a lot of people, that\u2019s an achievement to them both, the publisher, and, most likely, some people around the author, too.<\/li>\n<\/ol>\n<\/div>\n\n\n<p>There are multiple other reasons, but most of you reading probably know most of them \u2013 the bottom line being the fact that books are a type of long-form learning resource, and if those long-form learning resources are good enough, they present enormous upsides for you as a reader, the author as a writer, and the publisher as well.<\/p>\n\n\n\n<p>For better or for worse, not all books are the same \u2013 some books are average, some are excellent, and some are bad and not worth reading at all.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-books-about-databases\">Books About Databases<\/h2>\n\n\n\n<p>With that being said, if you\u2019re in the database world, you\u2019d probably agree with me in saying that books about databases often teach us about database performance. There are other books and some of those focus on incredibly specific things (Relational Database Index Design and the Optimizers by Tapio Lahdenmaki and Mike Leach is a good example), and that\u2019s not to say that they\u2019re bad (most of them aren\u2019t), but regardless, saying that most database-focused books focus on how to improve performance is no exaggeration. There are indeed many such books \u2013 <em>but what most of them lack is an explanation of how you broke your database to the point that you need the optimizations described in the book in the first place.<\/em> Think about it: if you optimize something, you start from the bottom, and then work your way to the top, right?<\/p>\n\n\n\n<p>In the database world, however, that\u2019s rarely the case; most books, as I\u2019ve already mentioned, focus on how to improve performance\/security\/availability or walk you through the basics of SQL or database design but lack the driving mechanism that got you to that point.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-hacking-mysql\">Hacking MySQL<\/h2>\n\n\n\n<p>Here\u2019s where <em>Hacking MySQL<\/em> comes in \u2013 <em>Hacking MySQL<\/em> is my first book about the database world and its internal functionality focusing on how, when, and why developers break their databases to necessitate optimization (1), how to optimize their databases (2), and how to secure them from data breaches (3).<\/p>\n\n\n\n<p>The book does have a subtitle \u2013 it\u2019s called \u201c<em>Breaking, Optimizing, and Securing MySQL for Your Use Case<\/em>\u201d and it\u2019s there for a reason; the book is split into three distinct parts telling you exactly how you broke your database to the point where you need optimizations for it, how to optimize your MySQL database instances for performance and availability, and lastly, how to secure everything you\u2019ve just built too (<a href=\"https:\/\/breachdirectory.com\/search\">security is paramount too, eh?<\/a>)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-objectives-of-hacking-mysql\">Objectives of Hacking MySQL<\/h2>\n\n\n\n<p>My book walks you through multiple things to achieve the aforementioned three distinct objectives:<\/p>\n\n\n<div class=\"block-core-list\">\n<ol class=\"wp-block-list\">\n<li>It lets you understand the history of the DBMS as well as its storage engines.<\/li>\n\n\n\n<li>It lets you understand what, why, and how breaks your database management system to the point where you need optimizations described in the documentation\/books\/elsewhere in the first place.<\/li>\n\n\n\n<li>It lets you understand how your database understands and acts upon different kinds of SQL queries.<\/li>\n\n\n\n<li>It walks you through the internals of your server letting you understand the internals behind database errors and other trivia.<\/li>\n\n\n\n<li>It walks you through your schema, data types, and collations as well as optimization techniques for big data and indexing.<\/li>\n\n\n\n<li>It helps you understand how to act upon database backups and recovery and how to squeeze the most out of your particular MySQL database when working with them.<\/li>\n\n\n\n<li>It helps you understand not only how, but when and why you should secure your database instances and walks you through ways to do it.<\/li>\n<\/ol>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-you-ve-helped-me-write-hacking-mysql\">You&#8217;ve Helped Me Write Hacking MySQL<\/h2>\n\n\n\n<p>The book is also packed with a variety of other gems, too \u2013 these gems are in place because I\u2019ve been learning from some extremely bright people in the database world online and beyond and I\u2019d be lying if I\u2019d say that people working at Redgate didn\u2019t contribute to this book either. <a href=\"https:\/\/www.amazon.com\/Hacking-MySQL-Breaking-Optimizing-Securing\/dp\/B0DFGK483D\">As you can tell<\/a>, the foreword of the book was written by <a href=\"https:\/\/www.red-gate.com\/simple-talk\/author\/louis-davidson\/\">Louis Davidson<\/a>, which is something I\u2019m immensely grateful for, too. <a href=\"https:\/\/hackingmysql.com\/book#contents\">The contents of the book can be found here<\/a>, and <a href=\"https:\/\/hackingmysql.com\/\">the website dedicated to the book over at HackingMySQL.com<\/a> will let you read some snippets to help you decide whether the book is something you\u2019d enjoy or be interested in. And if you\u2019re not, that\u2019s fine too \u2013 perhaps you know someone who is.<\/p>\n\n\n\n<p>Books like these wouldn\u2019t be written without all of you, including you reading this blog at this very second. Books like these are comprised of knowledge acquired from people who share it free of charge. This knowledge then gets into the head of the author, is applied in practice, and that practice is then shared in the form of a book or two. For me, practice cultivated in a book that walks you through why your databases are faltering in the first place \u2013 and if you\u2019re interested in hearing the answer, you should probably read it. Or at least let your colleagues know that the answer they\u2019re looking for might be just around the corner. \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-summary\">Summary<\/h2>\n\n\n\n<p>I wrote a book on why, how, and when developers break their MySQL instances and I had a pretty awesome time doing so. Given that people at Redgate have contributed significantly to this book seeing the light of day in the first place, you just read a blog about it on Redgate, too. Hopefully, if you decide to read the book, you will have a good time educating yourself on why your databases might be faltering: <a href=\"https:\/\/www.amazon.com\/Hacking-MySQL-Breaking-Optimizing-Securing\/dp\/B0DFGK483D\">you can find the book on Amazon<\/a> or other stores such as <a href=\"https:\/\/www.barnesandnoble.com\/w\/hacking-mysql-lukas-vileikis\/1146275946\">Barnes &amp; Noble<\/a> \u2013 alternatively, you may consider emailing me (find my contacts on <a href=\"https:\/\/lukasvileikis.com\/contact\">my website<\/a>), and I may be able to hook you up with a PDF in return for a review. I hope that you\u2019ve enjoyed reading this blog too and until next time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog introduces the book &#8220;Hacking MySQL: Breaking, Optimizing, and Securing MySQL for Your Use Case&#8221; by Lukas Vileikis.&hellip;<\/p>\n","protected":false},"author":339547,"featured_media":105079,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,9,143523,145792,159153],"tags":[4363,159239,159240,159238,159237,159145,159183,5854,159241,159182,5013],"coauthors":[146040],"class_list":["post-105070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-books","category-databases","category-mysql","category-resources","tag-books","tag-database-availability","tag-database-books","tag-database-performance","tag-database-security","tag-hacking-mysql","tag-mariadb","tag-mysql","tag-mysql-books","tag-percona-server","tag-sql-books"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/105070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/339547"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=105070"}],"version-history":[{"count":8,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/105070\/revisions"}],"predecessor-version":[{"id":105084,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/105070\/revisions\/105084"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media\/105079"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=105070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=105070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=105070"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=105070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}