 Okay, so the next talk is a good friend of mine and he's going to be talking about containers and serverless and other bus fit bus Buzzwords, that's right Exactly any questions a round of applause a round of applause for him, please Thank you all right Since I'm a bit behind I will skip that first slide doesn't really matter I'm a developer at work at hanging out at conference parties and bitching about other products so that's fine and all right, so What I want to do with this talk is Imagine you have a monolith written go Buzz comes around she tells you modernize it make it cloud native And you go like all right, so we have two options very popular ones containerized microservices on the one hand on the other hand serverless lambda So the model is really very very simple It's called imagine you can upload some Images and it extracts some metadata Very simple, and I'm not going to go into detail here. I'm gonna Right jump into the first option and that is containerized microservices and Now there will be a live demo, which means I'm going to put away the mic for a moment If you want to follow along you can go to that GitHub repo and try it out yourself if you have a community cluster running around That's my job All right, it's just a couple of commands bringing up the storage and Bringing up the app brilliant wow and exposing that front end so Just want to give you a little bit of a feeling How that actually looks like and Now we should see if all the parts are up We should see that front end up here. Okay, cool. Yeah, and now we can you know upload something blah blah blah blah And at some point in time the metadata extraction will kick in which is just a dimension here, and yeah We're not gonna wait for that Yeah, okay, so this is how it looks like Supposed to work now. Thank you. Let's have a look at how it is done First we step back a bit and have a look at what is the underlying platform and that is communities committees is a Container lifecycle management system using the clarity of APIs and control loops And super extensible a lot of moving parts there As a developer you typically don't really have to deal with all these Interfaces and so on you can really focus on developing the application However, if we look at that we end up from that monolith with a couple of microservices One that is essentially serving the static assets of the UI CSS and so on And exposing the HDDP API Along you to upload an image and to list the images and the metadata and The other one is a batch metadata extraction and again the metadata is really just a dimension Here and then I'm using Minio, which is essentially as three clone To store the images and the metadata it essentially this this Container as microservices setup just leverages vanilla communities abstractions deployment services and so on and that's how it actually looks like So you've got these three deployments there with the parts there everything stateless the state is essentially in Minio and then you have the endpoints there and You've just seen how it is deployed. It's it's pretty straightforward The trick is a little bit. How do you? Map or how do you extract how you break down that monolith into one or more deployments there? Alternative system designs I could have just done a lift and shift essentially taking that monolith and put that into a pot I could also have the different Containers in one part and use a local volume to share the images and the metadata Or I could have different parts and using Persistent volume rather than Minio Minio in that case is a little bit more flexible because I'm not dependent on the environment Where I am to see what kind of read write volumes I have available All right, let's move on to serverless Here the demo is luckily a video because it takes a little longer Okay, so there's a make file. I don't think you can really see that very well essentially using Sam. So the serverless application model CLI Which under the hood is just cloud formation You have a couple of buckets there where you have the images the code and so on and then it deploys that taking Too many minutes. We're not gonna wait for that until it's there and yeah, you see the stack coming up and at some point in time The dilemma functions are there All the code is ready the API gateway so that you can hit the functions there and Yeah, at the end of the day All that is needed is essentially in the last step to wire the front end which is statically served from an S3 bucket To the ui so that the the front end actually has the correct HDB endpoints Yeah, okay And result should be the same obviously. Yeah, you've got cloud watch for the locks not so super Interesting but essentially more or less besides the provisioning More or less the same steps all right So what is serverless service is really just an umbrella term For a couple of things like functions of service their databases and data stores object storage message queues query Services and all of that essentially means you don't have to provision anything You're only paying for what you're actually using so not paying all the time when it's running just for what you're actually consuming Typically everything is nicely managed there. There are nice API is there It's really kind of this operation model where you can focus on your business logic and leave the whole operational part to some provider So functions of service that's the service concept that I've been using here to implement that imagine Application is essentially event driven. So you have some kinds of events that could be a HDB call through the API gateway It could be a new Images uploaded into an S3 bucket or whatever You have one or more short-running Stateless functions and because they're a stateless it means you have to externalize the state you need to put that somewhere It could be you know ration database. It could be Nocical database message queue whatever So how does it look like serverless we've got three lambda functions One for uploading the image one for listing the images and the metadata along with it and one that does the metadata extraction again just the dimension and using a three is the shared storage for the images and the metadata and Serving the static as it's for the UI And as you have seen using Sam to deploy the lambda functions if you're using Sam or something else doesn't matter but don't use the low-level stuff don't use the The you know manually doing the deployments of lambda functions and so on you will have a bad day if you look at the Get commit history, you will see how much pin I went through so that it is how it looks like you have the buckets there and lambda functions and the HDB API gateway that triggers the respective functions there and the Metadata extractions essentially triggered by a cloud event every I think one minute or whatever looks into that That bucket and sees if there is a new image extracting that and putting the metadata back then All right, alternatively I could have used a trigger on that Bucket where the image is uploaded to trigger that metadata extraction rather than using Periodic leak a cloud cloud watch event And I could have replaced the two-phase presigned URL that I have there to allow someone to upload something With something like kubin 2 for example But definitely other Options as well these two came to mind All right. Have a look at comparison. How do they compare? Actually quite similar in certain things. They're different But if you look you have unit of deployments part in the function you have some artifacts you need to Put somewhere the container image in the case of communities a zip file in case of lambda Put them into registry and three three buckets The biggest difference there in terms of event triggers is that communities? It's not entirely true with canative now But when look when this doesn't really have this notion of of events that you can use there and in lambda We're pretty much all the the public cloud offerings that offer some functions of service. They are built in State you can't have state stateful sets and other things custom resources In case of lambda it's stateless right. There is no state in that function Latency-wise Yeah, can't be sometimes challenging get back to that in a moment Obstability obviously You bit more locked into if you're using cloud provider there main point as I already mentioned serverless you only really pay what you consume and Essentially with with all the stuff that I've been doing there. My bill was never more than one cent That's pretty much it The main point in terms of lift and shift you can do that with communities You can take an existing application just put it in container and run it not saying that's the best option but you can with the serverless you can't you really need to rearchitect and Local development it's doable in communities. There are a couple of things that allow you to do it less painful Scaffold and many other things with lambda. It's limited. You can essentially only use Gateway And the lambda itself so anything any other like the S3 whatever I would need to go into life It doesn't allow me to emulate that locally So what's the good in Terms of communities definitely provides portability you can start on premises move to cloud another cloud That's awesome. If you're if that is a focus point Serverless definitely I would argue developers can focus on the business logic. So the Sam CLI Gives you quite a lot of leverage and you can more or less focus on on the business logic really And for both of the containers and serverless Solutions Accounted and the ratio of code versus YAML is pretty much the same. So you will have to deal with YAML One way or the other. I'm sorry for that Definitely increases develop Development velocity so you get stuff faster out there Depending on how fine granular you do the microservices could could end up pretty much the same They're not so great In terms of communities can be a bit of a pain point Handling the container images Especially if you think about the overall development cycle So imagine every time you change something in one of the services you have to build a new image You have to push it to a registry communities needs to pull it and deploy it again again As I said, there are certain tools that allow you to shortcut certain of these phases But that turns out to be for many people many organizations quite challenging and the Core DX of cunidis is rather poor. It's not really a nice way for developer to get into that You really need to get the tooling right to to make that not so painful serverless You can have language dependent latencies. So obviously JVM has other cold start characteristics as Python for example And state hydration so that's probably one of the most challenging things imagine your Serverless function your lambda function has some dependency. It needs to pull some state from whatever Some database out there whatever before it doesn't have that state. It can't do it its work Right and that is what is referred to state hydration And because it is stateless you do have to do that every time doesn't matter how warm that that functions if everything is already there You will need that or you will run into that issue All right, the rest is just a couple of resources in Yeah articles and and a few books that I can recommend that you can read there and Yeah, I think we have enough time for q&a and that was actually my main goal because I wanted to Because everything else is there right you can go to that repo and and try it out yourself Should be rather well documented. Just have a look at that repo slides up as well on The website So I'd like to hear from you Where are you? Do you have a boss that comes up to you and says let's modernize it? Do you have any questions any concerns? No one in that position one over there. Should I Yeah If you wanted to run absolutely everything, you know, so your front-end and behind API gateway How straightforward is like authorization and authentication and so on? It was not the biggest problem the biggest problem that I had what was essentially passing the payload Through the API gateway to the Lambda function and that's where I ended up with the pre signed URLs because the Ping and and JPEG just didn't go through So that's one thing I ran into everything else That's just that the normal I am policy dance where you need to decide how to do things, but yeah Not that hard so when you have around like let me say 300 lambda functions and They run and you change something and how do you ensure that everything still runs? So what are the quality? strategies That's an excellent question. It's one of the critique points. I always have with Lambda that Unless so either you have a handful of functions, right? or You're in a bad place if you have a lot of functions. You need some kind of Orchestration effectively that allows you to look all over that. There are certain projects. I know that IBM came up with a project I think there is something at AWS as well But many many functions if you take an existing monolith and you end up with let's say 300 400 whatever Lambda functions you're probably ending up in a place where you need to write that kind of orchestrator yourself, right to figure out What is going on? What is up? What is new? Whatever? Yeah, definitely not the best place Any more questions? Yes I'm just gonna throw that in there You catch right? Thanks a very nice talk. Thank you. Just a question. What do you think about hybrid architectures where Kubernetes will be served as a long term, you know, like main application controller and functions will be used only for heavy stuff like Not to not rent lots of big missions, so it could be probably more efficient So I've got the question right. It's like this hybrid setup where you assume But let's put it that way if you do have a community discussed already if you're subscribed to that Then it's perfectly possible and you probably should be using things like open fast. There's open with There are many many Q-blast. There are many many options that you can run as Frameworks on top of communities if you have already subscribed to the idea of communities, right? Again the main point of communities being that portability, so you're not more or less not locked into a certain vendors API If portability is not that big of an issue So that that's where you have to somehow draw the line or or see what what is what works for you best but definitely What you described as this bang bang or whatever you used. Yes I Subscribe to that idea that if you are already committed to communities if you have communities as the base platform Using serverless platforms on top of that Anything from Kennedy if up to a set of whisker, whatever Definitely a great great way to go not saying that everything is already very mature there. Definitely not compared to lambda, but It's getting there Any more questions? Yes For the serverless, how about the testing? How do you what's what are your approaches on that? So that was probably the biggest pain point. So I initially was like oh cool Sam allows me to do that locally, right? Until I figured out actually all that works is the HTTP API Gateway and the lambda itself So any kind of state I had to go online, which means I ended up doing everything online Right, so essentially change something and that's what the make actually does right? Uploads it to a three-bucket kicks it off deploys it and it's there In average maybe once it's up the initial CloudFormation deployment takes a few minutes, but once it's up a matter of 10 15 seconds until you have the new version there It's not that bad unless you have you know huge dependencies and you're pumping up I don't know 500 megabytes every time, but you end up. That's why I said It's very limited. I'm not saying that this might not change Sam might become more powerful Sam is essentially just using locally docker to emulate that API that is has there, but again it only gives you the HTTP API Gateway and The lambda function everything else you need to go online Yes What about serverless containers? So like Fargate, which is kind of like a manager environment for containers deploying containers Is it like trying to achieve the same abstraction layer the community? This is trying to do but you know in a more in a Provide a more of like a more managed environment Excellent question and I wouldn't have expected anything else from Yana obviously So for the people who don't know what Fargate is essentially you think of it as You already called it serverless container whatever you don't need to manage a communities cluster whatever you just say here is my Container image whatever and here you know run that task is long running or whatever I Find it great in the sense that you know all that management overhead goes away I think we still have to see and then you get up up and running extremely quick The challenge that I see is two-fold on the one hand mentioned already the Main point of community is being this portable system that you can move between different environments Can you do Fargate? I don't know, you know in your on-premise environment and then move to the cloud and the other thing as I said in terms of Extending it if you have the need communities provides you with a wonderful extension mechanism called custom resources that allow you to essentially do any kind of Workload extend communities in a sense that it understands your workload. You might not have the same Yeah possibilities there with with Fargate. These would be the kind of limitations. Otherwise, I would say absolutely Limitations these are the current things that I don't really have a good answer to but otherwise. Yeah, absolutely. No doubt Any more questions we have two minutes okay What's your opinion about? versioning of serverless Lander functions so they got that because when I have APIs and I have versions then I become trouble and if I have even Smaller functions like serverless Lander functions. The trouble gets even bigger. I guess if I Introduce versioning that's kind of like implicitly done so every time you deploy a new function you get essentially a new zip file or whatever in there that's automatically done for you I Haven't I'm not entirely sure if you can actually go back that easily I've never done that But yeah, it's it's automatically done. So we don't really have to care about that in case of lambda I'm not sure. I've never tried that Sorry, oh Sorry, the question was can you use two different versions of a function at the same time and I said I haven't tried it out Might be the case. I'm not sure All right Cool. Thank you