[{"data":1,"prerenderedAt":374},["ShallowReactive",2],{"document-library-menu":3,"document-content--docs-technology-mysql-docs":58,"document-library-links--docs-technology-mysql-docs":370},[4,8,12],{"title":5,"path":6,"stem":7,"children":-1},"Resources","\u002Fdocs","docs\u002Findex",{"title":9,"path":10,"stem":11,"children":-1},"Project Initiation","\u002Fdocs\u002Fproject-initiation","docs\u002F1.project-initiation",{"title":13,"icon":14,"path":15,"stem":16,"children":17,"page":-1},"Technology","i-lucide-layers","\u002Fdocs\u002Ftechnology","docs\u002F2.technology\u002Findex",[18,23,28,33,38,43,48,53],{"title":19,"path":20,"stem":21,"icon":22,"children":-1},"Laravel","\u002Fdocs\u002Ftechnology\u002Flaravel","docs\u002F2.technology\u002F1.laravel","i-simple-icons-laravel",{"title":24,"path":25,"stem":26,"icon":27,"children":-1},"Flutter","\u002Fdocs\u002Ftechnology\u002Fflutter","docs\u002F2.technology\u002F2.flutter","i-simple-icons-flutter",{"title":29,"path":30,"stem":31,"icon":32,"children":-1},"Nuxt","\u002Fdocs\u002Ftechnology\u002Fnuxt","docs\u002F2.technology\u002F3.nuxt","i-simple-icons-nuxt",{"title":34,"path":35,"stem":36,"icon":37,"children":-1},"Tailwind","\u002Fdocs\u002Ftechnology\u002Ftailwind","docs\u002F2.technology\u002F4.tailwind","i-simple-icons-tailwindcss",{"title":39,"path":40,"stem":41,"icon":42,"children":-1},"Cursor","\u002Fdocs\u002Ftechnology\u002Fcursor","docs\u002F2.technology\u002F5.cursor","i-simple-icons-cursor",{"title":44,"path":45,"stem":46,"icon":47,"children":-1},"AWS","\u002Fdocs\u002Ftechnology\u002Famazon","docs\u002F2.technology\u002F6.amazon","i-simple-icons-amazon",{"title":49,"path":50,"stem":51,"icon":52,"children":-1},"Cloudflare","\u002Fdocs\u002Ftechnology\u002Fcloudflare","docs\u002F2.technology\u002F7.cloudflare","i-simple-icons-cloudflare",{"title":54,"path":55,"stem":56,"icon":57,"children":-1},"MySQL","\u002Fdocs\u002Ftechnology\u002Fmysql","docs\u002F2.technology\u002F8.mysql","i-simple-icons-mysql",{"id":59,"title":54,"body":60,"description":364,"extension":365,"meta":366,"navigation":367,"path":55,"seo":368,"stem":56,"__hash__":369},"docs\u002Fdocs\u002F2.technology\u002F8.mysql.md",{"type":61,"value":62,"toc":346},"minimark",[63,71,74,85,90,140,144,160,163,167,186,190,217,221,227,259,263,280,283,287,297,301,306,309,313,316,320,323,327,333],[64,65,66,67,70],"p",{},"MySQL is the system of record. Orders, accounts, prices, and the relationships between them are rows in a relational database, reached only through ",[68,69,19],"a",{"href":20},". We standardise on it so migrations, backups, and the expectations of the next developer all refer to the same engine.",[64,72,73],{},"The database product matters less than whether the model matches the process, and whether data loaded on the first day is accurate.",[64,75,76,80,81,84],{},[68,77,79],{"href":78},"\u002F_action\u002Fcontact-us","Start a conversation"," about a data model or a migration, or read ",[68,82,83],{"href":10},"Project initiation",".",[86,87,89],"h2",{"id":88},"at-a-glance","At a glance",[91,92,93,104],"table",{},[94,95,96],"thead",{},[97,98,99,102],"tr",{},[100,101],"th",{},[100,103],{},[105,106,107,116,124,132],"tbody",{},[97,108,109,113],{},[110,111,112],"td",{},"Kind",[110,114,115],{},"Relational database",[97,117,118,121],{},[110,119,120],{},"Fits",[110,122,123],{},"Transactional business data, tenancy, and reporting queries that must be exact",[97,125,126,129],{},[110,127,128],{},"Reached from",[110,130,131],{},"Laravel only",[97,133,134,137],{},[110,135,136],{},"Usually hosted",[110,138,139],{},"As a managed database on AWS",[86,141,143],{"id":142},"when-we-use-it","When we use it",[145,146,147,151,154,157],"ul",{},[148,149,150],"li",{},"Laravel applications whose data is relational: customers, products, orders, permissions, and audit history",[148,152,153],{},"Multi-tenant platforms, where isolation is enforced by the schema and the queries",[148,155,156],{},"Migrations from a spreadsheet, a legacy database, or an ERP extract, where “clean” is defined before the load",[148,158,159],{},"Reporting that must agree with the screen, because both read the same model",[64,161,162],{},"Another store is used only when the data is not relational. A document, a file, or a search index may sit beside MySQL. They do not replace it for the records the business operates on.",[86,164,166],{"id":165},"what-we-rely-on","What we rely on",[145,168,169,172,175,178,183],{},[148,170,171],{},"Migrations in the repository, so the schema is reviewed with the code",[148,173,174],{},"Constraints and indexes that match the queries the application actually runs",[148,176,177],{},"Transactions around operations that must succeed or fail together",[148,179,180,181],{},"A backup and restore path that has been tested, on the managed database described with ",[68,182,44],{"href":45},[148,184,185],{},"Import jobs for one-off and repeating loads, with a reject file for rows that do not meet the definition of clean",[86,187,189],{"id":188},"why-it-fits-the-work","Why it fits the work",[145,191,192,199,205,211],{},[148,193,194,198],{},[195,196,197],"strong",{},"Predictable reads and writes."," The model is visible. A slow screen is usually a query that can be read and revised, rather than a cache whose behaviour is unclear.",[148,200,201,204],{},[195,202,203],{},"Capacity that follows the data."," Indexes, a larger managed instance, and read patterns that match the product. A second database is not introduced to avoid a missing index.",[148,206,207,210],{},[195,208,209],{},"Durability."," Transactions, backups, and a restore that can be rehearsed. Application defects can still occur. Loss of the only copy of the records does not have to follow from them.",[148,212,213,216],{},[195,214,215],{},"Skills that are widely available."," A later team can inspect the schema without a specialist for a database known only to us. That is the main reason it keeps the long-term cost down.",[86,218,220],{"id":219},"how-we-build-with-it","How we build with it",[64,222,223,224,226],{},"The engagement follows ",[68,225,83],{"href":10},". Data is one of the four things settled before production code. It is not left until the end.",[145,228,229,235,241,253],{},[148,230,231,234],{},[195,232,233],{},"Architecture."," Entities, tenancy, and what “clean” means for anything being moved. The first-release model may be smaller than the eventual model.",[148,236,237,240],{},[195,238,239],{},"Development."," Migrations, and the queries behind the screens in the release. Development seed data does not include a copy of production personal data.",[148,242,243,246,247,249,250,252],{},[195,244,245],{},"Hardening."," The database is not reachable from the internet, or from ",[68,248,29],{"href":30}," and ",[68,251,24],{"href":25},". Credentials live with the application configuration. The application user has only the privileges it needs.",[148,254,255,258],{},[195,256,257],{},"Release and support."," Backups, a restore that has been completed at least once, and imports that can be run again when the source data needs correction. After launch, schema changes are released as migrations with the application.",[86,260,262],{"id":261},"how-it-sits-in-the-stack","How it sits in the stack",[64,264,265,266,268,269,271,272,249,274,276,277,279],{},"MySQL sits behind ",[68,267,19],{"href":20},", on ",[68,270,44],{"href":45},". ",[68,273,29],{"href":30},[68,275,24],{"href":25}," do not connect to it. ",[68,278,49],{"href":50}," does not connect to it either.",[64,281,282],{},"Imports and files may use object storage beside the database. The records those files belong to remain in MySQL.",[86,284,286],{"id":285},"in-practice","In practice",[64,288,289,290,296],{},"Platforms we operate, including ",[68,291,295],{"href":292,"rel":293},"https:\u002F\u002Fdcommerce.io",[294],"nofollow","dCommerce",", depend on a relational model: catalogues, pricing, orders, and which account may see them. Client work often adds a migration. Moving the data is part of the build, with an agreed definition of clean, rather than a script run immediately before go-live.",[86,298,300],{"id":299},"questions","Questions",[302,303,305],"h3",{"id":304},"why-mysql-rather-than-postgres","Why MySQL rather than Postgres?",[64,307,308],{},"Both are capable relational databases. We standardise on MySQL so Laravel migrations, operations, and the people who inherit the system are all working with one engine. A project that already runs on Postgres, and must stay there, is a constraint to raise during scoping. It does not require the rest of the stack to change.",[302,310,312],{"id":311},"can-you-migrate-a-messy-legacy-database","Can you migrate a messy legacy database?",[64,314,315],{},"Yes. That is a normal part of the work, and it is likely to fail if it is left until the end. We need the source, the exceptions, and a definition of clean before the new system is expected to treat the old data as already consistent.",[302,317,319],{"id":318},"will-reporting-tools-connect-to-the-database-directly","Will reporting tools connect to the database directly?",[64,321,322],{},"A read-only connection is sometimes appropriate. A report that staff rely on is often better as a query the application owns, so it cannot diverge from the screen. Direct access to the production account that writes data is not used for ad hoc reporting.",[86,324,326],{"id":325},"next-step","Next step",[64,328,329,330,84],{},"If the difficult part is the data you already have, or the model the new system needs, ",[68,331,332],{"href":78},"start a conversation",[64,334,335,336,338,339,338,342,338,344,84],{},"Related: ",[68,337,19],{"href":20},", ",[68,340,341],{"href":45},"Amazon Web Services",[68,343,83],{"href":10},[68,345,13],{"href":15},{"title":347,"searchDepth":348,"depth":348,"links":349},"",2,[350,351,352,353,354,355,356,357,363],{"id":88,"depth":348,"text":89},{"id":142,"depth":348,"text":143},{"id":165,"depth":348,"text":166},{"id":188,"depth":348,"text":189},{"id":219,"depth":348,"text":220},{"id":261,"depth":348,"text":262},{"id":285,"depth":348,"text":286},{"id":299,"depth":348,"text":300,"children":358},[359,361,362],{"id":304,"depth":360,"text":305},3,{"id":311,"depth":360,"text":312},{"id":318,"depth":360,"text":319},{"id":325,"depth":348,"text":326},"The relational database behind the Laravel applications we build, including the data those systems must keep accurate.","md",{},{"title":54,"icon":57},{"title":54,"description":364},"HteWk5kECsq4QO-HhpUXKdemtGShjM9UbKKJ_mi9k_8",[371,373],{"title":49,"path":50,"stem":51,"description":372,"icon":52,"children":-1},"DNS, TLS, caching, and abuse protection in front of the sites and APIs we deliver.",null,1792456194670]