AWS re:Invent 2022 - Building next-gen applications with event-driven architectures (API311-R)
AWS re:Invent 2022 - Building next-gen applications with event-driven architectures (API311-R)
Event-driven architectures can solve many difficult problems in modern enterprise workloads. For example, it can be challenging to work with large amounts of data in different data stores and locations. Teams building microservices architecture often find that integration with other applications and external services can make their workloads more monolithic and tightly coupled. In this chalk talk, learn how to use event-based architecture to decouple and decentralize application components. Discover how you can use AWS messaging services to connect microservices and coordinate data flow using minimal custom code.
ABOUT AWS Amazon Web Services (AWS) hosts events, both online and in-person, bringing the cloud computing community together to connect, collaborate, and learn from AWS experts.
AWS is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.
#reInvent2022 #AWSreInvent2022 #AWSEvents
Content
0 -> all right good morning how y'all doing
3.659 -> all right to the five of you that would
5.88 -> I appreciate it I've been wooed hey I'm
9.599 -> glad y'all are here this is how many for
11.94 -> let's try it again they pay me to speak
13.74 -> here at reinvent isn't that crazy how
15.719 -> many of y'all are here this is your
17.4 -> first session re invent
18.96 -> okay yes all right very cool that's
22.5 -> exciting uh let me tell you where we are
24.779 -> uh we are here to talk about containers
27.18 -> and that's not true
29.58 -> you're like oh I gotta get out so we're
31.199 -> going to be talking about building
32.399 -> next-gen applications with event driven
35.399 -> architectures if you're in the wrong
37.739 -> place stay anyway we're going to have
39.66 -> fun
40.8 -> okay I can't see you just so you know so
43.92 -> if I ask you to raise your hand oh there
46.26 -> there you're still out there so uh my
48.66 -> name is Eric Johnson
50.7 -> tell you a little bit about who I am uh
53.1 -> why I should even be up here I probably
54.96 -> shouldn't but they let me anyway uh I am
57.42 -> a principal developer advocate for AWS
60.48 -> I am a father of five that is not a typo
63.739 -> our house is crazy now I'm gonna
67.32 -> interrupt there for a moment
69.119 -> uh has anybody ever heard me speak
71.159 -> before
72.18 -> okay a couple of you okay well we're
74.28 -> gonna go over the rules anyway okay when
76.979 -> I speak There Are Rules okay and here
79.74 -> they are and you think of yourself how
81.54 -> do you get to make rules I have the mic
83.88 -> so there we go so rule number one is
87.659 -> this is any number I want it to be
91.74 -> okay I'm gonna hold this up at some
94.08 -> point and I'm gonna say I have five kids
96.299 -> and there's always somebody in the back
98.46 -> says that's not a five that's a one
100.92 -> okay I can get to four if I take my
103.799 -> shoes off but it gets real awkward for
105.54 -> everybody
106.68 -> okay so that's any number I want it to
109.02 -> be rule number two
111.96 -> which one
113.46 -> all right good for those listening
115.56 -> someone coming in late saying I don't
116.88 -> get it these are quotes
119.159 -> not apostrophes
121.619 -> and I know that because this looks silly
125.759 -> Never Never Fails is he doing a bunny
129.539 -> I'm not doing a bunny unless I am and
133.44 -> it's contextual you have to figure it
135 -> out okay and the last rule is these are
137.34 -> thumbs
138.48 -> okay I do this all the time I'm like hey
140.7 -> you good
141.9 -> and they're like I'm good but I don't
143.34 -> know what you're pointing at yourself
144.239 -> but I'm not putting out myself unless I
146.7 -> am so I I was born this way I didn't
149.16 -> wake up this way for the first time
150.78 -> today if I did I would not be here with
153.239 -> you okay I like to make lots of jokes uh
157.56 -> I'm comfortable with that if that makes
160.379 -> you uncomfortable I'm also comfortable
163.14 -> with that so
165.36 -> either way I'm good all right so let's
168.239 -> get started so continue on I'm a brand
170.64 -> new grandpa I took everything in me not
172.62 -> to put a bunch of slides of my grandson
174.66 -> up there thank you uh I'm a drummer that
177.66 -> used to say musicians but people are
179.34 -> like really so I am a drummer I went
181.92 -> through college playing drums and here's
184.08 -> what I learned I'm a phenomenal drummer
188.28 -> for one finger
190.68 -> past that I'm pretty average and
193.019 -> nobody's going to pay me all right it's
195.239 -> always fun to go in I played in a lot of
197.04 -> churches in college I would go in you
198.84 -> could always see because I was hired out
200.4 -> they would call me and when I would get
201.72 -> there you could always see them going oh
202.92 -> no
204.18 -> what have we gotten ourselves into
206.64 -> that was always fun because they're a
208.019 -> church they can't tell you never mind
209.04 -> we're not paying you so I like to sit
210.659 -> down and take one stick of my hand and
211.98 -> go okay let's rock
214.5 -> so
215.64 -> lots of fun I am also foodie obviously I
218.879 -> do like to eat I often people ask me how
222.12 -> do you feed yourself oh I feed myself
224.879 -> I figured it out so all right enough
226.68 -> about me about me let's jump into this
228.54 -> today we're going to be talking like I
229.739 -> said about uh
232.2 -> occasions with
234.42 -> event right so we're going to talk about
236.519 -> some of the challenges some of the some
238.92 -> of the things that we want to be aware
240.599 -> of uh and so let's jump in
243.18 -> so we're going to cover three things
244.44 -> kind of break it down uh first is we're
247.019 -> going to talk about Enterprise
247.68 -> Integration patterns what does that even
249.48 -> mean we're going to be uh okay we hear
251.64 -> this word all the time but what does it
253.62 -> mean we're going to talk about
254.76 -> event-driven architecture right we we've
257.4 -> been throwing this word around for quite
258.9 -> a while Eda is not new we didn't invent
261.9 -> it but we're really doubling down on it
264 -> we think it's the it's really the best
265.62 -> way to build architectures uh so we'll
268.08 -> kind of talk about that idea and finally
269.88 -> we'll talk about handling event
271.56 -> duplication using item potency and and
274.5 -> this one's always a challenge when we
276.78 -> talk about that and a lot of times when
278.04 -> we talk and I've done it myself when we
279.419 -> talked about uh Eda or any kind of
282.419 -> architecture we talk about building
283.86 -> large distributed systems we say and
286.919 -> make sure they're they're built for item
288.54 -> potency
289.5 -> and then we leave it at that and you see
291.24 -> everybody going okay that makes sense
294.18 -> I don't know what you're saying but I'll
295.5 -> do that so we're going to dive into a
297.66 -> little bit what does that mean today
301.8 -> I've already been asked this is not that
303.419 -> Dr Pepper
304.62 -> because my wife made me promise to drink
306.3 -> water while I'm talking so it'll be diet
308.88 -> Dr Pepper later all right so we're gonna
311.639 -> jump in here so the first thing
313.56 -> Enterprise Integration patterns
316.979 -> when we talk about integration patterns
318.66 -> one of the things we talk about a lot is
320.22 -> coupling we throw this word around you
322.32 -> decouple your apps be careful you're not
324 -> tightly coupled all these kinds of
325.68 -> things and coupling is integration's
327.96 -> magic word right and it's this A to B A
331.199 -> requires B it's this this this when we
333.96 -> say couple it's this idea of I'm reliant
337.44 -> on you and coupling is is the measure I
340.259 -> love this it's the measure of
341.759 -> independent variability between
343.44 -> connected systems because coupling can
346.139 -> be variables sometimes entirely if
348.84 -> you're down I'm down sometimes it's
351.06 -> kinda if you're down I could survive but
353.1 -> I need you to come back up pretty soon
354.419 -> okay
355.919 -> decoupling has costs when we build
359 -> distributed architectures
361.8 -> decoupling has cost both at a design
364.68 -> time and run time
366.479 -> coupling isn't binary okay sometimes
369.419 -> it's more than one thing it goes is a
371.1 -> lot of things and finally coupling isn't
373.02 -> one-dimensional so there's a lot of
375.06 -> different things that that can relate to
376.979 -> that and when it was starting to put
378.12 -> this together we're starting to think
379.199 -> about this it's like how many different
380.58 -> ways can we couple so we put down a list
382.56 -> here this probably isn't all of them but
384.96 -> when you think about coupling you may
386.34 -> not have thought about some of these we
387.9 -> have technology dependencies like what
389.699 -> language well we can only build in Java
392.34 -> and before we start building
393.72 -> applications with something like a
395.759 -> Lambda function that's kind of what we
397.8 -> did when we're going to build this is
399.84 -> the language we build in you're tied to
402.6 -> that there's no changing now Lambda kind
405.24 -> of change that Paradigm because we said
406.56 -> you know what you can have a function
407.639 -> that's in Python you could have a
408.72 -> function that's a function that's in
410.039 -> Java whatever is best for that
412.74 -> particular
414.06 -> function that you need to do
416.88 -> okay you can have location dependency
418.68 -> only this IP address
420.539 -> data format dependency data type
423.3 -> dependency
424.56 -> semantic dependency one we're going to
426.3 -> talk about quite a bit today is temporal
427.74 -> dependencies sync versus async
429.78 -> interaction style dependency how are we
432.24 -> talking and and conversation dependency
434.759 -> pay adjacent things like that
436.8 -> so different ideas and coupling that and
440.46 -> and coupling we say this because you
442.62 -> hear it's like you should always
443.4 -> decouple decoupled a couple decouple
445.38 -> coupling is not an evil word but you
448.139 -> want to understand your coupling okay
450.72 -> and I love this quote
452.34 -> this is Gregor hope who actually works
454.44 -> for AWS he says the appropriate level of
457.02 -> coupling depends on the level of control
458.88 -> you have over the endpoints
461.699 -> okay how much control you have over the
464.4 -> endpoints is going to decide how much
466.44 -> you're reliant on that or should and
468.66 -> sometimes like look I need I can't help
470.52 -> it we've got to have it we're going to
472.319 -> use it so whatever they dictate we're
474.06 -> going to do
475.259 -> but sometimes like look we have no
477.06 -> control over that if they go down we go
479.4 -> down so we need to pull back our
482.34 -> coupling make that less reliant on those
485.52 -> systems
487.979 -> so let's talk about some of those things
489.84 -> as we're looking at building
492.36 -> applications we're looking at building
494.16 -> distributed applications let's talk
496.199 -> about uh the the two the types of of
498.479 -> patterns that we would use so the first
500.819 -> and this is I when I speak to developers
503.039 -> a lot of times they really struggle with
504.599 -> this idea of synchronous versus
506.52 -> asynchronous so let's kind of talk about
508.44 -> this a little bit and and point this out
510.24 -> so the first we're going to talk about
511.08 -> is the synchronous request response
513.06 -> model so the synchronous response
515.88 -> request response model that's a that's a
517.979 -> big those are big words
519.899 -> um this is basically what this looks
522.3 -> like okay so you have this you have a
523.979 -> sender you have a receiver you make the
526.68 -> request it comes back and this is often
528.6 -> what we call also a blocking call
530.279 -> because what it means is when I've made
532.5 -> that call I can't do anything else until
534.48 -> you respond to me I am completely
536.58 -> reliant on you know there's some
538.019 -> advantages of this there's very low
539.88 -> latency right it's a quick call it's
542.399 -> simple yes I'm not having to do a lot of
544.32 -> distributed stuff and finally it's a
546.72 -> fast fail okay how many of y'all look at
549.48 -> fast fail as an advantage
551.82 -> okay good good that's right fast fails
555.12 -> are good for us because we want them to
556.32 -> fail when we're developing
557.88 -> okay it's always beautiful to get a
560.04 -> fully distributed system in and four
561.899 -> steps down is where it's failing and I
563.64 -> don't know until it's in production
565.8 -> right I've been there anybody been there
568.08 -> yeah exactly if you didn't raise your
570.839 -> hand lucky dog or liar
573.779 -> so okay
575.88 -> but disadvantages
578.1 -> you know what if your receiver fails so
580.5 -> we talked about this if my receiver
582.48 -> fails my sender's dead in the water well
585.839 -> okay I'd love to take your payment but I
588.42 -> gotta wait okay that's something because
591 -> the client what client in the world is
592.8 -> going to go oh oh you can't make payment
594.24 -> processing right now I'll wait
596.519 -> no they're gonna you know what I can go
598.26 -> over to a little startup called
600.54 -> amazon.com and buy that
602.58 -> okay so they they you you want you don't
605.279 -> want your client down you want them up
607.14 -> and running okay so that's first thing
608.88 -> the second thing is throttling okay so
612.72 -> as you start building more and more
614.94 -> systems talking to this this is your
617.04 -> central point of failure okay or a
619.92 -> single point of failure would be a
621.06 -> better way to say I can do that one
622.2 -> single
623.7 -> single point of failure okay so that's
626.94 -> what that could cause problems right so
628.92 -> you have receiver failure you have rehab
630.6 -> you have throttle failure or receiver
632.399 -> throttle it may not be down
634.38 -> but it's definitely slowing down right
636.899 -> and and to today's culture slow is
640.14 -> broken right slow is the new broken
642.66 -> there you go I'm gonna put that on a
644.7 -> shirt somewhere
646.92 -> all right so let's jump the other one
649.019 -> and I'll tell you here's a pattern we
651.839 -> always recommend always go asynchronous
654.839 -> when you can there are times for
656.7 -> synchronous I am not here to tell you
658.26 -> use synchronous and you're not a 10x
660.959 -> developer whatever that means right
662.94 -> there are some times when you need
664.5 -> synchronous but try asynchronous first
667.2 -> when you can use asynchronous do it but
669.839 -> there are some advantages and
670.8 -> disadvantages on that so let's look at
672.24 -> these so there's a couple of ways of
674.22 -> doing asynchronous the first we're going
675.839 -> to talk about is the point-to-point
677.04 -> model or a q
679.26 -> so what does that look like
680.88 -> so you have you have a sender and you
682.8 -> have a receiver much like before but now
684.899 -> you have a Q in the middle of it right
686.339 -> so you could be sending things into the
688.5 -> queue and then as as the receiver is
691.44 -> ready they'll handle that but this
692.82 -> becomes an asynchronous model what the
695.459 -> sender gets if you're not familiar with
696.959 -> this model what the sender is going to
699.12 -> get a sink or synchronously I know we're
701.519 -> talking about async but synchronously is
703.26 -> a I got your request thank you very much
706.44 -> we'll get back to you okay it's an
708.839 -> acknowledgment of this of the data the
712.14 -> event whatever being sent in right then
715.079 -> later they'll need to either pull or or
717.54 -> websocks or somehow and get the response
719.64 -> back if we need to this is what we often
721.68 -> call fire and forget
723.839 -> excuse me
727.2 -> sorry you have to hear me slurp on the
728.76 -> mic there apologize for that okay
731.519 -> again you have it
732.839 -> it's a temporal coupling we've now our
735.12 -> Cinder is not broken okay if if the
738.12 -> receiver breaks down the sender is still
740.7 -> working uh if they if you know if they
743.519 -> need to they're just it's just going
744.839 -> into the queue and when the receiver is
747.18 -> ready you can grab more so if it goes
748.74 -> down and we bring it back up we haven't
750.42 -> lost those requests
752.1 -> it's resilience receiver failures we
754.019 -> just talked about and the receiver
755.459 -> controls consumption rate right so
758.22 -> that's important okay this is a little
760.56 -> statement down there if you think about
762.44 -> Downstream applications a lot of times
765.54 -> I've been there and I won't ask you to
767.339 -> raise your hand but I will mine when we
769.2 -> come in we work for a company it's like
770.76 -> hey we have this Legacy system that can
774.12 -> handle three requests per day
777.6 -> right that's probably an exaggeration a
779.639 -> little bit but it can do three requests
781.8 -> per second but unfortunately we're
783.899 -> getting a billion requests per second we
786.779 -> need you to make that work
788.519 -> all right well let's rebuild it no no no
790.26 -> no
791.16 -> no we want you to make that work
793.92 -> okay but let's add more to it no no no
796.98 -> so what happens is you you need to
799.139 -> maintain these Legacy systems that can't
801.3 -> handle that traffic so this is where a
803.459 -> queue becomes very handy because one
805.92 -> you're not invoking that system you're
807.42 -> not running that system for each and
808.98 -> every event coming in you're now able to