[PYTHON] Learn more about AWS serverless web applications

From the concept, don't forget.

concept

・ I don't want to spend money, so I study AWS almost for free. → Starting a small service tends to be quite expensive. ・ Aim to ensure a high level of security → Prevent fraudulent use of your account as you will be charged a ridiculous amount

Yesterday I tried "Think about dynamic content distribution with AWS Lambda", but I can implement it, but the screen (HTML) implementation is not good. I felt a sense of discomfort. After that, I thought I'd take a look at "Tutorial I tried the other day", but this is quite hard. Workshop related programs are included in the set, and the related parts are \aws-serverless-workshops-master\WebApplication\1_StaticWebHosting\website\js It's a matter of course, but the amount of source code is large and difficult. However, there is also the fact that the hurdles have risen considerably because I have no experience with Javascript.

What should I do on the client side?

Yesterday's "Think about dynamic content distribution with AWS Lambda" was doing HTML conversion with API Gateway. I don't think I can make complicated screens with this, so I will study again. On the AWS site, https://aws.amazon.com/jp/serverless/patterns/serverless-pattern/ There is a serverless design pattern on it, so let's take a look. Of these, the serverless web application is the one I did in the tutorial in the upper left. Well, I understand the atmosphere, but that's not the case, so I'll ask Google Sensei.

I've researched it quite a bit, but many of the articles I've tried rely on API Gateway. So, when I changed the keywords further, I found a page that was easy to understand. It is a page of Mr. Kurameso who is always indebted. "Serverless SPA with Angular: Let's implement a" read more "pattern using DynamoDB", but the configuration diagram is well described It is easy to understand. Javascript system is refreshing, but I used Angular on the client. Even though I don't know, I know the keyword level that there are other things such as React and Vue.js, so I'm convinced that "Yes, I should use a client-side framework." Certainly, if you place these on S3 and access the server side from there via API Gateway, it seems possible to build a large-scale application without a server.

image1.png

What should I do on the server side?

I have somehow imagined the client side, so I wonder if the server side can be left as it is. Looking at the AWS blog, I found something that interests me. Chalice seems to manage API Gateway and Lambda well. https://aws.amazon.com/jp/blogs/startup/event-report-chalice-handson/ I see. I think that things that everyone thinks are similar. I haven't programmed for about 15 years now, but it's easy to imagine that you'll want to hit such a wall right away.

By the way, the explanation of Chalice https://qiita.com/tukkyr/items/b1f54b467375ba29facf This article was easier to understand.

I have some doubts here. If you are an engineer who enjoys implementation purely, you can jump to Chalice, but I have a long experience with engineering plastics, and I am definitely negative about vendor lock-in. Isn't there something that is versatile because it's just a little longer? I did some research, but it's still this! There is no such thing. I thought this article was neutral when I found it. https://www.serverless.com/blog/state-of-serverless-multi-cloud/

If you start talking about vendor lock-in, the story will shift more and more, so if you want to implement it, I think you should try using Chalice. By the way, I also checked Openwhisk and Knative a little, but they said something different. I think serverless is not an evolution of K8s, but how to use managed services in the cloud. The point is where to put the systematic abstraction layer, but it can be a serverless framework or another layer. I will omit that story today.

How to make "easy" and "decent Web application" at present

I think there are various ways to do it, but it seems that the key points are client-side framework selection, server-side implementation, and connection with API Gateway. Basically, I think that the client side will be a Javascript framework, so I'm worried about whether to use Javascript on the server side as well. Considering the server-side processing and compatibility with AI, Python is inevitable. I personally have no experience with Javascript, so Python is still better (although I can't talk about Python because I haven't done full-scale programming for more than 10 years, as I wrote earlier). But doing so requires dual wielding of the language.

I'm going to worry a little more, but today's conclusion is -Client side: Select from Angular, React, Vue.js -Server side: Python-based management including API Gateway using Chalice I think that is better. I hope I can do a little more research and make a sample app. .. ..

Recommended Posts

Learn more about AWS serverless web applications
Learn about programming
AWS Official "Building Modern Web Applications" Hands-on Hamari
Learn about Go slices