[{"data":1,"prerenderedAt":141},["ShallowReactive",2],{"content-paved-path-lift-and-shift-a-web-app-to-serverless-1-introduction":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":19,"contributorPaths":20,"menuType":22,"contentName":23,"slug":24,"readingTime":25,"menu":26,"nextDocItem":38,"previousDocItem":140},"\u003Cp>Customers migrating to the cloud are often looking for the benefits of serverless architecture, like reduced operational overhead and automatic scaling. The idea of moving to a serverless achitecture can be daunting if you&#39;re new to the idea of serverless. Can one really migrate from a traditional web environment to serverless? Absolutely. In this blog post, we&#39;ll recommend ways to perform a &quot;lift and shift&quot; migration -- the fastest way to move a production workload to serverless.\u003C\u002Fp>\n\u003Cp>The term &quot;lift and shift&quot; refers to a process of migrating an exact copy of an application or workload (with no\u002Fminimum modification), along with its required services (like databases and file systems) from one environment to another. Depending on your specific application, you may be able to lift and shift the entire application or only parts. Even if the migration is partial, it can begin to bring the benefits of serverless while enabling the development team to gradually refactor the remaining bits (e.g., using the \u003Ca href=\"https:\u002F\u002Fmedium.com\u002Fnerd-for-tech\u002Fthe-strangler-pattern-microservices-design-patterns-in-practice-made-easy-with-aws-serverless-97437a82b052\">strangler pattern\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>In the next sections, we&#39;ll review high level migration steps that are applicable to nearly all runtimes and frameworks. Our example application will use an Mongo, Express, React, and Node.js (MERN) stack web app. However, the discussions presented in this post apply to other stacks too, including runtimes like PHP, Go, or Ruby.\u003C\u002Fp>\n\u003Ch2>Why migrate a web app to serverless\u003C\u002Fh2>\n\u003Cp>Web apps hosted in a serverless environment benefit most from the capability of serverless applications to scale automatically and for paying for what you use. Imagine that you have a personal web app with little traffic. If you are hosting in a serverless environment, you don’t pay a fixed price to have the servers up and running you pay only when your app recieves requests. If your web app spends the majority of its time idle without receiving requests, using a serverless architecture can reduce your costs. This benefit applies to the opposite case. For an owner of a small ecommerce site running on a server, imagine if a social media influencer with millions of followers recommends one of their products. Suddenly, thousands of requests arrive and make the site unavailable. If the site is hosted on a serverless platform, the application will scale easily to accommodate the traffic that it receives.\u003C\u002Fp>\n",{"title":6,"order":7,"youtubeVideoID":8,"learningGoals":9,"resources":14},"Introduction",1,"O-hSs7aF7JE",[10,11,12,13],"Understand what lift and shift migrations are","Understand the benefits of serverless architecture","Learn how to migrate applications and databases from serverful to serverless","Learn patterns for migrating your services onto AWS.",[15],{"link":16,"text":17,"type":18},"https:\u002F\u002Fblog.marcia.dev\u002Flift-and-shift-a-web-app-to-serverless#heading-requirements-for-migration","Lift and shift to Serverless","text","Customers migrating to the cloud are often looking for the benefits of serverless architecture, like reduced operational overhead and automatic scaling. The idea of moving to a serverless achitecture can be daunting if you're new to the idea of serverless. Can one really migrate from a traditional web environment to serverless? Absolutely. In this blog post, we'll recommend ways to perform a \"lift and shift\" migration -- the fastest way to move a production workload to serverless.\n\nThe term \"lift and shift\" refers to a process of migrating an exact copy of an application or workload (with no\u002Fminimum modification), along with its required services (like databases and file systems) from one environment to another. Depending on your specific application, you may be able to lift and shift the entire application or only parts. Even if the migration is partial, it can begin to bring the benefits of serverless while enabling the development team to gradually refactor the remaining bits (e.g., using the [strangler pattern](https:\u002F\u002Fmedium.com\u002Fnerd-for-tech\u002Fthe-strangler-pattern-microservices-design-patterns-in-practice-made-easy-with-aws-serverless-97437a82b052)).\n\nIn the next sections, we'll review high level migration steps that are applicable to nearly all runtimes and frameworks. Our example application will use an Mongo, Express, React, and Node.js (MERN) stack web app. However, the discussions presented in this post apply to other stacks too, including runtimes like PHP, Go, or Ruby.\n\n## Why migrate a web app to serverless\n\nWeb apps hosted in a serverless environment benefit most from the capability of serverless applications to scale automatically and for paying for what you use. Imagine that you have a personal web app with little traffic. If you are hosting in a serverless environment, you don’t pay a fixed price to have the servers up and running you pay only when your app recieves requests. If your web app spends the majority of its time idle without receiving requests, using a serverless architecture can reduce your costs. This benefit applies to the opposite case. For an owner of a small ecommerce site running on a server, imagine if a social media influencer with millions of followers recommends one of their products. Suddenly, thousands of requests arrive and make the site unavailable. If the site is hosted on a serverless platform, the application will scale easily to accommodate the traffic that it receives.\n",[21],"content\u002Fcontributors\u002Fmarcia-villalba.json","LESSON","Lift and shift a web app to serverless","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F1-introduction","2 min",[27,35,45,53,62,71,80,90,99,108,116,125,133],{"title":6,"content":28},[29],{"title":6,"order":7,"youtubeVideoID":8,"learningGoals":30,"resources":31,"time":25,"path":33,"id":34,"link":24},[10,11,12,13],[32],{"link":16,"text":17,"type":18},"1-introduction","1-introduction.md",{"title":36,"content":37},"Guide",[38],{"title":39,"order":40,"time":41,"path":42,"id":43,"link":44},"Requirements for migration",2,"1 min","2-requirements-for-migration","2-requirements-for-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F2-requirements-for-migration",{"title":-1,"content":46},[47],{"title":48,"order":49,"time":41,"path":50,"id":51,"link":52},"Application overview",3,"3-application-overview","3-application-overview.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F3-application-overview",{"title":-1,"content":54},[55],{"title":56,"order":57,"youtubeVideoID":58,"time":41,"path":59,"id":60,"link":61},"Database migration",4,"Mic2TGzzVXk","4-database-migration","4-database-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F4-database-migration",{"title":-1,"content":63},[64],{"title":65,"order":66,"youtubeVideoID":67,"time":25,"path":68,"id":69,"link":70},"Backend migration",5,"MvVaFPCdiZY","5-backend-migration","5-backend-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F5-backend-migration",{"title":-1,"content":72},[73],{"title":74,"order":75,"youtubeVideoID":76,"time":25,"path":77,"id":78,"link":79},"Web app migration",6,"gQn4XPfpdZE","6-webapp-migration","6-webapp-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F6-webapp-migration",{"title":-1,"content":81},[82],{"title":83,"order":84,"youtubeVideoID":85,"time":86,"path":87,"id":88,"link":89},"Authentication and authorization migration",7,"KRnZvbVT7uk","3 min","7-authentication-and-authorization-migration","7-authentication-and-authorization-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F7-authentication-and-authorization-migration",{"title":-1,"content":91},[92],{"title":93,"order":94,"youtubeVideoID":95,"time":25,"path":96,"id":97,"link":98},"Storage migration",9,"Z4frDpp4PcM","8-storage-migration","8-storage-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F8-storage-migration",{"title":-1,"content":100},[101],{"title":102,"order":103,"youtubeVideoID":104,"time":41,"path":105,"id":106,"link":107},"Testing this application",11,"U_7xD-o5mCA","9-testing-this-application","9-testing-this-application.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F9-testing-this-application",{"title":-1,"content":109},[110],{"title":111,"order":112,"youtubeVideoID":104,"time":25,"path":113,"id":114,"link":115},"How much does this application cost?",12,"10-pricing-of-migrated-application","10-pricing-of-migrated-application.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F10-pricing-of-migrated-application",{"title":-1,"content":117},[118],{"title":119,"order":120,"youtubeVideoID":121,"time":86,"path":122,"id":123,"link":124},"Performance analysis",13,"B0pDPSQcAf4","11-performance-analysis","11-performance-analysis.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F11-performance-analysis",{"title":-1,"content":126},[127],{"title":128,"order":129,"time":41,"path":130,"id":131,"link":132},"Conclusion",14,"12-conclusion","12-conclusion.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F12-conclusion",{"title":-1,"content":134},[135],{"title":136,"order":120,"time":41,"path":137,"id":138,"link":139},"Extra resources","13-extra-resources","13-extra-resources.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F13-extra-resources",null,1789554909432]