Practical Projects to Learn AWS

Be A Better Dev
22 Feb 202114:52

Summary

TLDRDieses Video bietet einen praktischen Einstieg in AWS, indem es vier Projekte vorstellt, die helfen, die Cloud-Plattform zu erlernen und zu beherrschen. Es beginnt mit dem Hosten einer statischen Website auf S3 und Route 53, führt durch die Entwicklung einer CRUD-Anwendung mit ECS, ECR und RDS und zeigt, wie man Datenverarbeitung mit Kinesis Firehose, S3, Lambda und Elasticsearch umsetzt. Abschließend wird ein serverloses Workflow-Beispiel zur Erkennung von Aktienkursbewegungen mit CloudWatch, SQS, DynamoDB und SES erläutert. Jedes Projekt ist ideal, um AWS-Konzepte zu verinnerlichen und ist für Anfänger und Fortgeschrittene von großem Nutzen.

Takeaways

  • 😀 Der Videoinhalt ist hauptsächlich über das Lernen von AWS und wie man damit anfängt.
  • 🔍 Es wird empfohlen, mit dem AWS Cloud Practitioner-Kurs zu beginnen, um sich mit verschiedenen Diensten und Konzepten vertraut zu machen.
  • 🛠 Um praktisches Wissen zu erlangen, wird vorgeschlagen, verschiedene Projekte durchzuführen, um sich mit AWS vertraut zu machen.
  • 🌐 Das erste Projekt ist das Hosten einer statischen Website mit S3 und Route 53.
  • 📝 Ein weiterer praktischer Ansatz ist die Erstellung einer CRUD-Anwendung mit Docker-Containern und ECS.
  • 💧 Ein drittes Projekt befasst sich mit dem Verbrauch von Twitter-Streams und der Verarbeitung von Tweets mit Kinesis Firehose und Elasticsearch.
  • 📈 Das vierte Projekt ist eine verteilte serverlose Workflow-Implementierung für Aktienkursbewegungen.
  • 📊 Für das Projekt zur Aktienkursbeobachtung wird CloudWatch Events, SQS, Lambda, DynamoDB und DynamoDB Streams verwendet.
  • 📱 Eine Benachrichtigung wird gesendet, wenn signifikante Preisänderungen bei Aktien festgestellt werden.
  • 🎥 Es werden Videos zu jedem der genannten Projekten erstellt, um den Lernprozess zu unterstützen.

Q & A

  • Wo sollte man als Anfänger mit dem Lernen von AWS anfangen?

    -Man sollte mit dem AWS Cloud Practitioner-Kurs beginnen, der von AWS angeboten wird, um sich mit verschiedenen Diensten und Konzepten vertraut zu machen.

  • Wie kann man AWS praktisch lernen?

    -Man kann durch das Durchführen von Projekten lernen, die auf realen Anwendungsfällen basieren, wie zum Beispiel das Hosten einer statischen Website auf S3, die Erstellung einer CRUD-Anwendung mit ECS und RDS oder das Verarbeiten von Daten mit Kinesis Firehose und Elasticsearch.

  • Was ist der Vorteil des Verwendens von CloudFront anstelle von direktem Zugriff auf S3?

    -CloudFront ist ein Edge-Caching-Dienst, der für Ressourcen, die nicht oft geändert werden, sehr kosteneffizient ist. Es verteilt Dateien zu verschiedenen Edge-Knoten auf der ganzen Welt, um eine optimale Leistung zu gewährleisten.

  • Was ist Route 53 und wie wird es in AWS verwendet?

    -Route 53 ist ein DNS-Webdienst, der zum Bearbeiten von DNS-Einstellungen für das AWS-Konto verwendet wird, um eine benutzerdefinierte Domäne an eine Index.html-Datei oder einen Load Balancer zu mappen.

  • Wie funktioniert die Erstellung einer CRUD-Anwendung mit Docker-Containern in AWS?

    -Man schreibt eine Docker-Datei, lädt das Image in den Elastic Container Registry (ECR) hoch und konfiguriert den ECS-Dienst, um auf das ECR-Image zu verweisen. Der ECS-Cluster wird in einem VPC gestartet, und man stellt eine RDS-Datenbank ein, um die Anwendung zu unterstützen.

  • Was ist Kinesis Firehose und wie wird es in AWS verwendet?

    -Kinesis Firehose ist ein Dienst für das Batch- und Datenverarbeitungsende, der Daten in regelmäßigen Abständen in S3 speichert. Es ist einfach einzurichten und bietet viele verschiedene Parameter, die angepasst werden können.

  • Welche Rolle spielt Elasticsearch in AWS und wie wird es in den Projekten verwendet?

    -Elasticsearch wird für Textverarbeitung und -abfragen verwendet und ist oft die Technologie hinter Autovervollständigungsfunktionen. In AWS wird es verwendet, um Daten aus S3 zu indizieren und über Kibana zu analysieren.

  • Wie funktioniert der serverlose Workflow für Aktienpreisbewegungen in AWS?

    -Es verwendet CloudWatch Events, um alle Minute eine Nachricht an SQS zu senden, die wiederum einen Lambda-Funktion auslöst, die den Aktienpreis von Yahoo Finance API abruft und in DynamoDB indiziert. Wenn sich der Preis signifikant ändert, wird eine Benachrichtigung über den Simple Email Service gesendet.

  • Was sind die Vorteile des Einsatzes von Fargate anstelle von EC2 für die Erstellung einer serverlosen Anwendung?

    -Fargate ist eine serverlose Möglichkeit, Container auszuführen, ohne dass man sich um Server oder Infrastruktur kümmern muss. Es ist einfacher zu verwenden und erfordert keine Verwaltung von Sicherheitsgruppen oder VPC-Netzwerkeinstellungen.

  • Welche Ressourcen bietet AWS für den Einstieg in das Lernen und was sind die nächsten Schritte, wenn man in die Tiefe gehen möchte?

    -AWS bietet viele Ressourcen wie den Cloud Practitioner-Kurs an. Wenn man tiefer einsteigen möchte, kann man sich mit Projekten vertiefen, die verschiedene AWS-Dienste wie S3, ECR, ECS, RDS, Kinesis Firehose, Elasticsearch, DynamoDB und Lambda verwenden.

Outlines

00:00

🌐 Erste Schritte mit AWS: Hosting einer statischen Website

Dieser Abschnitt des Videos konzentriert sich auf die Einführung in AWS und wie man damit beginnt. DerUploader empfiehlt, mit dem AWS Cloud Practitioner-Kurs zu beginnen, um sich mit den verschiedenen Diensten und Konzepten vertraut zu machen. Nachdem man ein grundlegendes Verständnis der Konzepte hat, wird gezeigt, wie man eine einfache Website hostet, indem man eine index.html-Datei in S3 hochlädt. S3 dient als allumfassender Datenspeicher für Rohobjekte verschiedener Größen und Typen. Anschließend wird erläutert, wie man die Website mit Route 53 und CloudFront verbindet, um eine benutzerfreundlichere URL zu erhalten und die Leistung zu optimieren, indem die Dateien an Edge-Knoten weltweit verteilt werden.

05:00

🐳 CRUD-Anwendung mit Docker und AWS ECS

In diesem Abschnitt wird ein praktischer Ansatz für das Erstellen einer CRUD-Anwendung (Create, Read, Update, Delete) mit Docker-Containern und AWS Elastic Container Service (ECS) gezeigt. Der Prozess beginnt mit dem Schreiben einer Docker-Datei und dem Hochladen des Images in den Elastic Container Registry (ECR). Dann wird ein ECS-Service eingerichtet, der auf das ECR-Image zeigt. Der ECS-Cluster wird in einem Virtual Private Cloud (VPC) gestartet, um Isolation und Sicherheit zu gewährleisten. Zusätzlich wird eine RDS-Datenbank eingerichtet und eine Anwendungscode geschrieben, die mit der RDS-Instanz interagiert. Ein Load Balancer verteilt den Datenverkehr auf mehrere Container und schließlich wird eine Route 53 DNS-Eintrag erstellt, um die Domain zu dem Load Balancer zu mappen.

10:02

🔥 Datenverarbeitung mit Twitter-Streams und AWS Kinesis Firehose

In diesem Teil des Videos wird ein Projekt zur Verarbeitung von Twitter-Streams vorgestellt. Es wird erklärt, wie man einen Python-Skript schreibt, um Daten von Twitter-Live-Streams zu konsumieren. Diese Daten werden dann an einen Kinesis Firehose-Endpunkt gesendet, der für das Batching und die Verarbeitung von Daten gedacht ist. Kinesis Firehose sammelt Daten und leert sie entweder alle fünf Minuten oder alle fünf Megabyte in einem S3-Bucket. Wenn eine Datei in S3 hochgeladen wird, wird ein Lambda-Funktion ausgelöst, die die Dateiinhalte abruft und in Elasticsearch indiziert, was für die Analyse von Textdaten nützlich ist. Elasticsearch wird mit Kibana geliefert, einer Benutzeroberfläche, die es ermöglicht, Trends und Analysen über die Zeit zu visualisieren.

📈 Verteilte serverlose Workflows für Aktienpreisbewegungen

Der vierte und letzte Beispielabschnitt des Videos behandelt die Erstellung eines verteilten serverlosen Workflows zur Erkennung von schnellen Preissprüngen oder -stürzen von Aktien. Hier wird CloudWatch Events verwendet, um eine Minute-Intervalle zu setzen, die eine Nachricht an Simple Queue Service (SQS) senden. Diese Nachricht weckt eine Lambda-Funktion, die den aktuellen Aktienpreis von Yahoo Finance API abruft und die Daten in eine DynamoDB-Datenbank indiziert. Mit DynamoDB Streams und einer weiteren Lambda-Funktion wird überprüft, ob es signifikante Preisänderungen gibt, und bei Bedarf wird eine Benachrichtigung über Simple Email Service gesendet, um den Benutzer über signifikante Aktienpreisbewegungen zu informieren.

Mindmap

Keywords

💡AWS

AWS steht für Amazon Web Services und ist ein führender Anbieter von Cloud-Computing-Diensten. Im Video wird AWS als Plattform zum Erlernen und Durchführen von Projekten hervorgehoben, die von Grundlegendem Webhosting bis hin zu komplexen Datenverarbeitungsaufgaben reichen.

💡Cloud Practitioner Course

Dies ist ein Kurs, der von AWS angeboten wird, um neue Benutzer mit den verschiedenen Diensten und Konzepten vertraut zu machen, die für den Einstieg in AWS wichtig sind. Im Video wird empfohlen, diesen Kurs zu beginnen, um ein solides Grundwissen zu erlangen.

💡S3

S3 steht für Simple Storage Service und ist ein Dienst von AWS, der als Speicher für unstrukturierte Daten dient. Im Video wird beschrieben, wie man eine statische Website hostet, indem man eine index.html-Datei auf S3 hochlädt.

💡Route 53

Route 53 ist ein DNS-Webdienst von AWS, der verwendet wird, um benutzerdefinierte Domains an AWS-Ressourcen wie S3 oder CloudFront zu mappen. Im Video wird erläutert, wie Route 53 verwendet wird, um eine benutzerdefinierte Domain für eine statische Website zu konfigurieren.

💡CloudFront

CloudFront ist ein Content Delivery Network (CDN) von AWS, das zum Verbessern der Leistung und zum Caching von Inhalten verwendet wird. Im Video wird CloudFront vorgeschlagen, um statischen Inhalt von S3 zu liefern, um globale Leistung und Caching zu optimieren.

💡ECS

ECS steht für Elastic Container Service und ist ein verwalteter Dienst von AWS, der Containerorchestrierung für Docker-Container anbietet. Im Video wird ECS verwendet, um Docker-Container für eine CRUD-Anwendung zu hosten.

💡ECR

ECR steht für Elastic Container Registry und ist ein Dienst von AWS, der als Speicher für Docker-Container-Images dient. Im Video wird ECR verwendet, um Docker-Images zu speichern, die von ECS für die Bereitstellung von Containern verwendet werden.

💡VPC

Ein VPC (Virtual Private Cloud) ist ein grundlegender Baustein von AWS, der eine isolierte Bereich in der AWS-Cloud bietet, in dem Sie Ihre Ressourcen ausführen können. Im Video wird ein ECS-Cluster in einem VPC gestartet, um die Isolation und Sicherheit der Ressourcen sicherzustellen.

💡RDS

RDS steht für Relational Database Service und ist ein verwalteter Datenbankdienst von AWS, der MySQL und andere relationale Datenbank-Engines hostet. Im Video wird RDS verwendet, um eine MySQL-Datenbank für eine CRUD-Anwendung zu hosten.

💡Lambda

Lambda ist ein Serverlos-Computing-Dienst von AWS, der es ermöglicht, Code ohne das Betreiben von Servern auszuführen. Im Video wird Lambda verwendet, um Dateien aus S3 zu verarbeiten und Daten in Elasticsearch zu indizieren oder um Aktienpreisbewegungen zu überwachen.

💡Kinesis Firehose

Kinesis Firehose ist ein Dienst von AWS, der zum Sammeln, Verarbeiten und Laden von Datenströmen in Datenspeicherdienste wie S3 oder Redshift verwendet wird. Im Video wird Firehose verwendet, um Tweets von einem Live-Streaming-Dienst zu sammeln und in S3 zu speichern.

💡Elasticsearch

Elasticsearch ist eine Such- und Analytics-Engine, die auf der Apache-Lizenz basiert und für die Verarbeitung von Textdaten und das Durchführen von komplexen Abfragen verwendet wird. Im Video wird Elasticsearch verwendet, um Tweets zu indizieren und zu analysieren.

💡DynamoDB

DynamoDB ist ein NoSQL-Datenbankdienst von AWS, der schnelle und predictible Leistung für beliebige Datenmengen bietet. Im Video wird DynamoDB verwendet, um Aktienpreise zu speichern und zu überwachen, um signifikante Preisbewegungen zu erkennen.

💡SQS

SQS steht für Simple Queue Service und ist ein verwalteter Nachrichtenwarteschlangendienst von AWS, der asynchrone Nachrichtenübermittlung zwischen Anwendungen ermöglicht. Im Video wird SQS verwendet, um Jobs für Lambda-Funktionen zu verteilen.

💡CloudWatch

CloudWatch ist ein Dienst von AWS, der die Überwachung von AWS-Ressourcen, Anwendungen und Services ermöglicht. Im Video wird CloudWatch verwendet, um Zeitereignisse für serverlose Workflows zu planen.

Highlights

开始学习AWS的推荐课程是AWS Cloud Practitioner Course。

实践学习AWS的第一步是熟悉不同的服务和概念。

通过S3托管静态网站是学习AWS的常见起点。

Route 53用于设置自定义域名并映射到S3托管的静态网站。

CloudFront作为边缘缓存服务,可以提高网站性能。

使用ECS和Docker容器部署CRUD应用。

ECR用于存储和管理Docker镜像。

VPC提供了资源隔离,类似于云上数据中心。

RDS用于设置和管理数据库,如MySQL。

使用负载均衡器在多个容器间分配负载。

通过Lambda函数处理来自Twitter流的数据。

Kinesis Firehose用于批处理和数据流处理。

Elasticsearch用于文本处理和查询。

Kibana提供了Elasticsearch数据的可视化界面。

构建分布式服务器less工作流以监控股票价格变动。

CloudWatch Events用于设置定时触发器。

SQS用于处理应用程序中的背压。

使用DynamoDB Streams检测数据库变更事件。

通过Simple Email Service发送股价变动通知。

这些项目是学习AWS的实用示例,涵盖了多种技术。

Transcripts

play00:00

what is going on guys this video is

play00:01

going to be all about learning aws

play00:04

uh by far the most common question that

play00:06

i get asked is where do you get started

play00:08

learning in aws

play00:09

what are some projects that you can do

play00:11

to just get yourself familiar with it

play00:13

and usually what i do is tell people to

play00:15

start with aws cloud practitioner course

play00:17

which is a great resource that's offered

play00:19

by aws

play00:20

so you can get familiar with some of the

play00:21

different services some of the different

play00:23

concepts that you need to know

play00:24

in order to get started now after you

play00:26

get familiar with some of the concepts

play00:28

the next question is how do i actually

play00:30

learn this stuff in a more practical way

play00:32

because that course teaches you a lot of

play00:34

the different things but it doesn't

play00:35

really tell you

play00:36

about what are things that people are

play00:38

actually working on what are skills

play00:40

or or patterns that people are using or

play00:42

technologies that people are using

play00:44

that are useful for me to get a job and

play00:46

that's what this video is going to be

play00:47

about it's going to be about

play00:48

a variety of different projects that you

play00:50

can learn from a very practical

play00:52

perspective of what people are actually

play00:54

doing with aws

play00:56

in real life uh so that if you're

play00:57

looking for a job or you're just trying

play00:59

to hone some of your skills

play01:00

uh this video is gonna be for you and

play01:02

the good news is that i'm gonna be

play01:03

making videos on each of these different

play01:05

projects i'm gonna put in front of you

play01:07

today

play01:07

uh so that if you try it and you get

play01:08

stuck don't worry i'm gonna show you how

play01:10

to do it later

play01:11

okay so that's what this video is going

play01:12

to be about so let's start with it by

play01:14

looking at our first

play01:15

project and we're going to start simple

play01:17

and progress a little bit

play01:19

to more advanced topics as we go along

play01:22

so the first one

play01:23

is static website hosting this is

play01:25

probably the most common thing that you

play01:26

see when people are suggesting

play01:28

uh learning aws it's just start with a

play01:30

basic website and host it on s3 so let's

play01:32

take a look at how this may work if

play01:34

you're trying to set up this project

play01:36

so the first thing that you do is you

play01:38

upload a index.html file to s3

play01:41

and just as a reminder s3 is your

play01:43

all-purpose data store for storing

play01:46

raw objects of a variety of different

play01:48

sizes and types

play01:50

for this purpose this would just be an

play01:52

index dot html file that contains some

play01:55

just raw javascript you can also upload

play01:57

upload your

play01:58

css or javascript assets as well from

play02:01

there

play02:02

we get an ugly url after we do that

play02:04

although this index.html is publicly

play02:06

accessible the url will be very ugly

play02:09

from there you want to hook this up to

play02:10

route 53 and run 53 is where you would

play02:13

edit your dns settings

play02:15

for your aws account so you can set up a

play02:18

domain that maps your custom domain

play02:21

to your index.html file so you can get

play02:24

something like

play02:25

be a betterdev.com and that'll point to

play02:28

this index.html file now you can stop

play02:31

there if you want so if a user is

play02:32

accessing your website or trying to

play02:34

access your website through chrome

play02:36

they would just type in your website

play02:37

name it would go to raw53 that would

play02:39

resolve to

play02:39

the s3 file and that's totally fine this

play02:42

will completely work

play02:43

i would suggest though instead of

play02:45

hooking it up directly you use

play02:46

cloudfront which is a

play02:48

edge caching service that is very cost

play02:50

effective

play02:51

for resources that change uh not so

play02:54

often so

play02:55

instead of going directly to s3 you tell

play02:57

rel53 to go to cloudfront instead

play03:00

and cloudfront would then synchronize

play03:02

its data with s3

play03:03

and it'll deploy your files to different

play03:06

edge nodes that are located

play03:07

all across the world for optimal

play03:09

performance

play03:10

so this is a very simple thing if you

play03:12

already know how to do this maybe you

play03:13

can skip over it but for beginners this

play03:15

is

play03:16

probably the most common example of

play03:18

things that

play03:19

uh folks tell beginners to learn is just

play03:21

get familiar with the basic concepts

play03:23

and the good news is that if you choose

play03:25

to learn these different things

play03:26

cloudfront s3 and rel53 that's something

play03:28

you just need to know if you're going to

play03:30

be working with aws

play03:32

so these are skills that are going to

play03:33

apply outside of this example

play03:35

all right so let's move on to the next

play03:38

one here and this is a

play03:40

crud app and by crud i mean create read

play03:43

update and delete so let me just erase

play03:45

all this and reveal what we have okay so

play03:47

we're going to be using

play03:49

a docker containers for this so

play03:51

optionally you can do this with ec2 but

play03:54

i'm going to do it using ecs which

play03:56

stands for elastic container service

play03:59

and this allows you to upload docker

play04:02

files to the cloud and deploy them using

play04:04

a managed service called ecs

play04:06

so how this works from a practical

play04:08

perspective some of the things that

play04:09

you're going to need to do

play04:10

are first you're going to need to write

play04:12

your docker file then you're going to

play04:13

upload

play04:14

the image to ecr which stands for

play04:16

elastic container repository

play04:18

and think of ecr kind of like a s3

play04:21

that's dedicated for docker images

play04:24

that's essentially what it is

play04:25

then when you set up your ecs service

play04:28

what you're going to do is point a point

play04:30

it to an ecr

play04:32

image and that's going to be the image

play04:33

that's used for the service when you set

play04:35

up your ecs cluster as well you're going

play04:37

to have to put it within a vpc

play04:39

and a vpc stands for virtual private

play04:42

cloud it's essentially a way in which

play04:44

your resources are isolated from other

play04:46

aws customers think of it like

play04:48

a cloud-based data center essentially

play04:51

that's kind of what it is and you're

play04:53

shielded from what other customers are

play04:55

doing no one's able to access your

play04:57

network

play04:58

you're able to lock down all the ports

play05:00

and everything to do

play05:01

with networking within this application

play05:04

so you're going to have to launch your

play05:05

ecs cluster into a vpc

play05:08

you're going to want to set up a rds

play05:09

database which in this example

play05:11

is just using aws rds with mysql which

play05:15

is very easy to set up

play05:16

i have a video on setting this up as

play05:17

well and on ecs actually i actually have

play05:19

a video on a bunch of these different

play05:21

things i'll put links in the description

play05:22

section below

play05:24

and then you're going to want to code up

play05:25

your application code so that it

play05:27

interacts with this

play05:28

rds instance from there you're going to

play05:30

want to set up a load balancer

play05:32

so that you can distribute load across

play05:34

multiple different containers that

play05:35

you're hosting and so you would point

play05:37

your load balancer to your ecs

play05:39

endpoint and then you again you'd create

play05:41

a route 53 dns

play05:43

entry to map your domain name to your

play05:45

load balancer

play05:47

and then finally when someone comes

play05:48

along and tries to hit your website of

play05:50

course it'll go

play05:51

to route53 first it'll hit the load

play05:53

balancer the load balancer will

play05:55

distribute the request to one of the

play05:56

containers on ecs

play05:58

and then you know it'll go to rds and

play06:01

retrieve your data create your data

play06:03

update it whatever you're trying to do

play06:04

and return that all the way back to the

play06:06

caller so i would consider this to be a

play06:08

very good example because this is what

play06:10

people are usually doing these days

play06:12

serverless really seems to take over

play06:15

if you're using ecs you can you have two

play06:17

options running in a serverless way

play06:19

using fargate

play06:20

or running it in a non-serverless way

play06:22

using ec2 i would suggest fargate for

play06:24

this example just to get familiar

play06:26

the ec2 one is a little bit more

play06:28

complicated requires some different

play06:29

permissions to change uh security group

play06:32

settings a whole bunch of vpc networking

play06:34

things that you'll need to know about

play06:35

there

play06:35

but i think fargate is a good way to

play06:37

start again this is

play06:39

a very useful example a lot of

play06:41

applications these days are built

play06:42

using a very similar framework than what

play06:45

i just showed you here

play06:46

so definitely definitely definitely

play06:48

invest the time in learning

play06:50

through this example okay so let's move

play06:51

on to the third one which is going to be

play06:53

more in terms of data processing which

play06:56

is an interesting one

play06:57

so i had fun putting this one together

play06:59

and this is going to be fun when i

play07:00

actually build this thing

play07:02

because it's kind of interesting so

play07:03

let's talk about what this is and this

play07:05

is going to be aimed at

play07:06

consuming twitter streams or consuming

play07:09

twitter

play07:09

tweets i should say rather so twitter

play07:12

has an endpoint where you can read off

play07:14

of

play07:15

live streaming tweets as they come in

play07:17

and all it requires is setting up a

play07:18

developer account and getting an api key

play07:21

so what you would do is just write a

play07:22

python script that's going to consume

play07:24

data from that stream and it can be

play07:26

consuming that data

play07:27

constantly or on a timer or something

play07:29

you may choose

play07:30

and it's going to consume individual

play07:31

tweets there and then

play07:33

what we're going to do there to process

play07:35

this data is we're going to

play07:36

put the tweets to a kinesis fire hose

play07:39

endpoint i have a

play07:40

video on kinesis firehose that you

play07:42

should check out it's great for batching

play07:43

and data processing

play07:45

so what kinesis firehose is going to do

play07:47

is we're going to set it up so that

play07:49

every five megabytes worth of data or

play07:52

every five minutes

play07:53

whichever comes first we're going to

play07:56

take all that data and put it into one

play07:59

file and dump that into s3

play08:01

so kinesis fire hose by the way it does

play08:03

all of this automatically like doing

play08:05

these things is just clicking buttons

play08:07

it's very very easy

play08:08

to actually set this stuff up and

play08:09

there's a whole bunch of different

play08:10

parameters that you can set as well

play08:12

so every five megabytes or five minutes

play08:14

we're going to deliver a file

play08:16

to s3 we're going to wire up our s3

play08:19

bucket

play08:20

that we allocate for this data to

play08:23

a put notification and that put

play08:24

notification is going to trigger

play08:26

a lambda function so this lambda

play08:28

function is going to be invoked

play08:29

every time a file is uploaded to s3 now

play08:33

the

play08:33

payload of the notification or what's

play08:35

inside the the notification is just

play08:37

going to be the location

play08:39

and the name of the file that was

play08:41

created so it'll be

play08:43

like index dot csv

play08:46

or data.csv or something like that from

play08:49

there we need to code our lambda such

play08:51

that

play08:51

it goes back to s3 and actually pulls

play08:53

the entire

play08:54

file contents back and then from there

play08:57

we can index it in elasticsearch

play09:00

now if you've never used elasticsearch

play09:03

text processing is basically what it's

play09:04

used for a text

play09:06

kind of querying it's used in a lot of

play09:08

um

play09:09

autocomplete databases or you know when

play09:11

you're searching on google and there's

play09:12

auto complete you type a character

play09:13

something comes up elasticsearch is

play09:15

usually the technology behind the scenes

play09:16

or something like it

play09:18

to give you that kind of functionality

play09:20

so in this case it would be great for

play09:22

analyzing text so we would take the

play09:24

entire file contents upload that into

play09:26

elasticsearch so that we can analyze it

play09:29

and the cool thing about elasticsearch

play09:31

on aws is that it comes pre-installed

play09:33

with kabana

play09:34

and kabana is like a ui

play09:37

for this stuff and it'll show you kind

play09:39

of trends over time

play09:40

and uh you can also do things like word

play09:43

clouds or

play09:44

or different types of queries by

play09:45

different grouping mechanisms so it's a

play09:47

very intuitive and easy way to observe

play09:50

and analyze your data through the

play09:51

comfort of a ui and all of that data is

play09:54

going to be sitting inside elasticsearch

play09:55

so that's how we would access it

play09:57

so i think this is a pretty good example

play09:59

that allows you to touch on a lot of

play10:01

different technologies for the purpose

play10:02

of data processing

play10:04

so i'd highly encourage you to check

play10:05

this one out let's move on to

play10:07

the fourth and final example now and

play10:10

yeah so this one's

play10:11

kind of fascinating i just came up with

play10:12

this a few

play10:14

hours ago and this is a distributed

play10:16

serverless workflow for

play10:18

stock price movements and the motivation

play10:20

for this one

play10:21

is i'm sure some of you were following

play10:23

gme or gamespot

play10:25

and uh you wanted to know when it was

play10:26

rising or falling very rapidly you

play10:28

couldn't sit at your computer all day

play10:30

just looking at a stock price uh so the

play10:32

the idea here is to set up a

play10:35

distributed uh serverless workflow that

play10:37

will automatically detect when

play10:39

jumps or drops occur in very short

play10:42

intervals

play10:43

in a stock price okay so i think it's

play10:45

pretty interesting given what's happened

play10:47

in the world pretty recently

play10:48

so what are we going to be using here so

play10:51

there's a bunch of different pieces

play10:52

and let me just center this on the

play10:54

screen so you don't get distracted

play10:55

okay so first of all we're going to be

play10:57

using cloudwatch events

play10:59

and we're going to set them up so that a

play11:02

cloudwatch event

play11:03

triggers on one minute timers think of

play11:05

these things like cloud-based

play11:06

cron jobs and i have a video on these by

play11:08

the way that you can learn more

play11:10

but essentially you set a timer based on

play11:13

some interval

play11:14

or some day of the week cadence in this

play11:17

case we'll just do it every minute

play11:19

and from there this is going to be kind

play11:20

of our our way to trigger

play11:22

our workflow so it's going to be

play11:23

happening every minute so we're going to

play11:25

set up cloud watch so that it

play11:27

sends a notification to sqs and sqs

play11:30

is called stands for simple q service

play11:32

it's a great way to back pressure or

play11:34

have back pressure

play11:35

for processing in your application so

play11:38

it's going to signify that there's a job

play11:40

to be done

play11:41

we're going to hook up our lambda

play11:42

function to sqs

play11:44

so that anytime a message gets put in

play11:46

sqs our lambda function is going to wake

play11:48

up and perform whatever it's going to do

play11:50

now what is it going to do well it's

play11:52

going to go to

play11:53

yahoo finance api which has a great api

play11:56

that you can access

play11:57

if you're interested in a price for a

play11:59

particular ticker we can use i know i

play12:01

said gme so let's just keep on going

play12:03

uh with that example here so we're going

play12:05

to query for gme it's going to give us

play12:07

back things like stock price

play12:08

number of shares that are available all

play12:10

that kind of stuff we'll consume that

play12:12

data and then we're going to

play12:13

index it in a dynamodb database so this

play12:16

is going to be a completely serverless

play12:18

example there's no servers here involved

play12:20

at all which is

play12:22

kind of a neat thing and where the

play12:23

industry seems to be going as a whole

play12:25

so we're going to index that data in

play12:28

dynamodb for every

play12:29

tick basically every one minute we're

play12:31

going to have a different row

play12:32

that says the stock price was this at

play12:34

this time so if we think of like a table

play12:37

like this

play12:38

uh if we have t1 for instant one and

play12:41

then

play12:41

t2 for instant two or maybe this is

play12:42

minute one minute two and this is

play12:45

our price uh maybe we would have

play12:48

something like eight dollars

play12:50

in at the first minute and then ten

play12:52

dollars

play12:53

in the second minute so you can see here

play12:55

the jump between these two minutes

play12:57

is very high it's a two dollar

play12:59

difference and it and if you convert

play13:01

this to percent it's a pretty large

play13:02

percent

play13:03

so we would want to send out a

play13:04

notification or somehow become aware

play13:06

when this happens so the question is how

play13:08

do we do that

play13:10

well the way i want to do it just for

play13:12

the purpose of teaching you more things

play13:14

in this example and this isn't

play13:16

necessarily the best way to do it but it

play13:17

teaches you different concepts

play13:20

is i would hook up this dynamodb table

play13:23

using dynamodb

play13:24

streams and dynamodb streams allow you

play13:27

to detect

play13:27

change events so when we wire this up to

play13:30

our lambda function

play13:31

every time a record gets inserted in the

play13:34

database say t2 gets inserted into the

play13:36

database in this example

play13:38

we're going to get a notification sent

play13:39

to our lambda function

play13:41

and it's going to show us the entire

play13:43

contents of the record so

play13:44

all this data that exists in the row so

play13:47

we're going to take that data

play13:49

then we're going to query again we're

play13:51

going to go back to dynamo

play13:52

but we're going to look for t1 which is

play13:54

the minute before it

play13:56

and then compute this difference and if

play13:58

the difference is significant enough

play14:00

maybe beyond a certain percentage

play14:02

we're gonna send a notification through

play14:04

simple email service

play14:06

to our phones so we get a text message

play14:08

or an email to say hey daniel the stock

play14:10

price dropped or the stock price raised

play14:11

by x amount go and buy or sell some

play14:13

shares

play14:14

so i thought this was a pretty

play14:15

fascinating example so i think these are

play14:18

four examples that are great for

play14:20

learning aws from a very

play14:21

practical perspective all these things

play14:23

are things that you would probably have

play14:25

to do at some point in your career maybe

play14:27

not interact with stock prices or the

play14:28

twitter api

play14:30

but the technologies that you're going

play14:31

to be using are very

play14:33

interchangeable with different use cases

play14:34

so i'd highly suggest you try some of

play14:36

these projects

play14:37

out and if you get lost don't worry like

play14:39

i said i'm going to have videos coming

play14:40

out

play14:41

on each of these different projects and

play14:42

i'm going to be doing them and walking

play14:44

you through how to do them

play14:45

so look forward to that as well if you

play14:47

like the video don't forget to like and

play14:48

subscribe and i'll see you next time

play14:50

thanks so much guys

Rate This

5.0 / 5 (0 votes)

関連タグ
AWSCloud-LernenPraktische ProjekteS3 HostingECS DockerData ProcessingServerless WorkflowTwitter APIStock MarketAWS Services
英語で要約が必要ですか?