{"id":5564,"date":"2018-07-31T10:45:39","date_gmt":"2018-07-31T14:45:39","guid":{"rendered":"http:\/\/www.dr-chuck.com\/csev-blog\/?p=5564"},"modified":"2018-07-31T10:45:39","modified_gmt":"2018-07-31T14:45:39","slug":"experiences-with-amazon-aurora-serverless","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2018\/07\/experiences-with-amazon-aurora-serverless\/","title":{"rendered":"Experiences with Amazon Aurora Serverless"},"content":{"rendered":"<p>Recently I moved all my Amazon-hosted servers for my <a href=\"https:\/\/www.tsugi.org\">www.tsugi.org<\/a> project from Amazon server-based Aurora to Amazon Serverless Aurora.\u00a0 I was experiencing the classic problem where 98% of the time it vastly over paying for my servers and then when I hit a peak (like after I spoke at the Instructure conference), things would get slow.\u00a0 Then I would upgrade my hardware and pay even more when things were slower.\u00a0 So serverless is *perfect* for me.<\/p>\n<p>I made a serverless cluster &#8211; in Aurora serverless you just make a cluster and do not make instances.\u00a0 I was looking a this Amazon page &#8211;\u00a0<a href=\"https:\/\/aws.amazon.com\/rds\/aurora\/serverless\/\" rel=\"nofollow noreferrer\">https:\/\/aws.amazon.com\/rds\/aurora\/serverless\/<\/a>\u00a0and it has said:<\/p>\n<p><em>You pay on a per-second basis for the database capacity you use when the database is active, and\u00a0migrate between standard and serverless configurations with a few clicks in the AWS Management Console.<\/em><\/p>\n<div class=\"postcell post-layout--right\">\n<div class=\"post-text\">\n<p>I could not find the &#8220;migrate with a few clicks&#8221; bit in the Amazon user interface.\u00a0 So I asked a question on <a href=\"https:\/\/stackoverflow.com\/questions\/51568132\/how-do-you-switch-between-standard-and-serverless-configurations-in-amazon-auror\" target=\"_blank\" rel=\"noopener\">Stack Overflow .<\/a><\/p>\n<p>When I did not get an answer in a few days, I did the conversion two ways with different results so I figured I would share my results here. I would still love to hear a better approach.<\/p>\n<ol>\n<li>When I did the conversion using mysqldump and restore, with a short outage things were fine.<\/li>\n<li>When I used <a href=\"https:\/\/aws.amazon.com\/dms\/\" target=\"_blank\" rel=\"noopener\">AWS Database Migration Service<\/a> it went pretty badly.<\/li>\n<\/ol>\n<p>First, you have to get the binary log format as &#8220;ROW&#8221; and binlog retention to 24 hours. That necessitated server restarts on my old clusters.<\/p>\n<p>Then when I got the data migration working, the new database was badly broken.\u00a0 I lost all my auto increments, then NULL settings in my columns, the UNIQUE clauses and foreign keys in the new tables.<\/p>\n<p>Literally the only thing that migrated correctly was that the actual data and PRIMARY KEY indications. Also, I would recommend migrating one database at a time (i.e. schema) and don&#8217;t try to migrate the mysql internal schemas. I said &#8220;migrate everything&#8221; and the migration tool tried to migrate the MySQL stuff &#8211; sheesh &#8211; you would think it would know better.<\/p>\n<p>The one thing the AWS Database Migration Service did that was\u00a0<em>really cool<\/em>\u00a0was the migrate and monitor (made possible by the binary logging on the rows). You could watch it moving rows.<\/p>\n<p>So the lesson is use mysql dump and restore\u00a0 when moving from Aurors server based to serverless.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Recently I moved all my Amazon-hosted servers for my www.tsugi.org project from Amazon server-based Aurora to Amazon Serverless Aurora.\u00a0 I was experiencing the classic problem where 98% of the time it vastly over paying for my servers and then when I hit a peak (like after I spoke at the Instructure conference), things would get [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5564","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=5564"}],"version-history":[{"count":3,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5564\/revisions"}],"predecessor-version":[{"id":5567,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/5564\/revisions\/5567"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=5564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=5564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=5564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}