 Well, hello and welcome to another dev nation We got a lot of things to show you today We're gonna be moving fast and I'm actually very excited because we have some really great content I'm gonna share my screen now But I'm also gonna paste in a link to the slide deck so everyone has it and I'm gonna share my screen where we can see it And I'm gonna show you what the agenda is for today. Okay, so we got a lot to cover Let me get started here and here we go. All right So we're gonna talk to you today about Quarkus our so supersonic subatomic Java Quarkus.io is the website. You're gonna hear from myself today You're gonna hear from Jason Green and Edson Yanaga and so we're gonna rock and roll really fast You're gonna actually see a few slides up front But we're gonna spend most of our time in live demonstrations Jason's got some really awesome stuff to show you with the library load how you actually set up a new Quarkus application Edson's gonna show you about how to connect to a database and build database applications I'm gonna show you some serverless stuff as well as really fun interactive applications So if you stay around to the end I have an application that I've built that I'm gonna actually let you also test with me live in today's session So we have a large number of you today So just be prepared for that do throw your comments and questions into the chat tab And make sure you get access to this link in this deck as my fact I can see if you're connecting now there you go Look a whole bunch of you start to connect at this point So we're gonna get you guys connected to the lab deck So one of the things I'd like to start off with when it comes to Java in general because people are asking us all the time Why are you doing this for Java? Why are you bothering doing anything for Java? I've had that direct question Why did you make an investment in Java? And so I like to say that the reports of my death are greatly exaggerated This is my Mark Twain Duke here as a matter of fact We've been talking about Java as being dead for almost 13 years now This is the oldest reference I could find to it But at this point it's kind of an old joke Java certainly not dead Java's doing incredibly well as a matter of fact Java's still the number one language on the taeobi index. It is still up there in the top three for red mock It's still the top two for hacker rank. So Java is doing incredibly well So for all those folks out there in the audience are like, why would you do anything for Java? This is why it is a multi-million user base It is my heart and soul where I come from and where Edson comes from or Jason comes from So we are super excited about Java and the Java language and we want to make it better fast or stronger Okay, so as Java the reason Java has been so successful though There's so much goodness in its ecosystem There's so much capability in terms of tools and frameworks as that you could have as far as utilities and frameworks and tools that you have In the Java ecosystem that you know and love so we've taken full advantage of these things and we use them throughout our daily lives as a Java developer and There's a challenge with that though with so much to consume Java kind of has put on a little bit of weight. Okay So this is really where Java has put on some weight Not Java the programming language or say and not even the JVM But all the frameworks and technologies to sit above that really are where some of the challenges lie So a lot of great flavors out there You can have my nice donuts and some nice ice cream there but so many flavors to consume and things get notably tight if you will noticeably Hard or heavy when we put that Java in a container So if you think about a Linux container or Docker container when we put that Java in there Things can get a little bit hard Especially when we actually lock them down We want to constrain the resources associated a container Which is what you normally do in a container environment with Kubernetes, etc And then Java blows up so you actually have we have a whole blog post on this concept It's been known for quite some time that if you just put Java in a container by default with Java 8 and you don't do Anything it'll blow up by default. It'll consume too much memory It'll consume some CPU and actually get shut down So you'll see the out of memory killed message often in a Kubernetes architecture when it comes to running Java And I also have these great quotes here because I was thinking about the serverless problem And I was googling around on the internet and I found this great reddit Section that basically we were talking about well, why what about spring boot for Amazon Lambda? What about using Java for Amazon Lambda? You can kind of see some of the quotes here, right? You know a lot of modern Java frameworks assume that memory is abundant and cheap Which it is not in a serverless use case in a lambda use case So that's the what other thing to keep in mind here when you're dealing with containers when you're dealing with serverless We're dealing with microservices. You are in constrained environments highly constrained environments You don't have a ton of memory. You don't have a ton of CPU. You actually get slices of each You don't get the whole thing So, you know the big problem with Java as you can see down here at the bottom is in Lambda startup time cold start time It's a problem for Java And so we actually heard these messages we saw these concerns and we were thinking about these problems We want to make sure that we address them You're going to see this specifically in Jason's presentation. Okay, so meet Quarkus our supersonic Java This is what we've been working on. So who is this Quarkus and what is all this fuss about? You can kind of see we made Java smaller more agile much faster. Okay, so it's up to 10 times smaller It's about 100 times faster And so we've also focused on the developer aspects of this meaning we wanted to focus on the developer joy You're gonna see that instance presentation So the live reload capability the imperative and reactive programming model Jason is going to show you that in a sec second I'm going to show you some of the serverless aspects as well See how we run it with K native on a mini cube and my local machine definitely focused on microservices It supports both fat jars as well as native executables meaning you run it in a JVM straight up JVM Or an actual native executable binary that you can you'll see that live in action today to optimize for your traditional Traditional enterprise use cases like JXRS and JPA as a good example and we certainly are focused on Kubernetes love Kubernetes native Okay, now a couple quick slides here on the performance characteristics We are actually going to show you these things so you don't have to just read these slides We can kind of focus on the concept here of being vastly smaller in terms of RSS, right? So that is the total memory footprint for that component not just heap but total memory So we're gonna we're gonna show you we can reduce the total memory of footprint for that component You can see like 13 meg here versus 140 meg and even if it's a database application Which is very common in the Java enterprise world So again a subset of overall memory for that Java database application and even the first response time So forget about lazy loading. We don't really care about the fact that things eventually load We care about the user's first response and a serverless architecture that startup time that cold startup latency really really matters So we we work really hard on first response time Okay, so all those things are in there and you're gonna see those a lot of the magic that makes some of this happen Is related to Grail VM meaning you can actually use this technology and we use this technology to take our technologies are Everything you need for the Java virtual machine your application and all the frameworks Do you depend on compile it down to native executable? So you're gonna see that live in action in our presentation also and just one last bit about Kubernetes orchestration Okay, that's really what our focus has been is how do we make Java vastly? You know more superior in a Kubernetes architecture because I have personally seen a lot of people are like We're rewriting parts of our application our microservices and dojs because Java's too fat and slow I've run the people are like no we're rewriting parts of our microservices and go because Java's too slow And so we didn't want to live in that world any longer. That's the problem We want to solve so in the case of Kubernetes, you know You can think of it as the master node here as well as these worker nodes You can think of your individual containers or pods as we call them running across those different worker nodes And you can think of how we schedule those things right so the whole point of Kubernetes is to run your application component in a pod That's the computer application is running on and it's going to scatter those things around the series of series of worker nodes And you can see the replica count here on my slide The idea is it's going to have to have two of those running at all times And it takes that declaration and runs them for you right? So basically Kubernetes is doing your Docker run for you if it's familiar with Linux containers Okay, and you kind of see what happens in a world where we might have another component But watch it if you see the X show up here. What if that component dies? So Kubernetes is not only going to take your replicas and run them across your cluster It's going to see that if anything dies, it's going to bring it back to life for you So it's actually going to verify that that thing is now no longer live and ready Those are the two probes you see in a Kubernetes architecture and then it's going to mount send it over to another node Okay, and then like if you look at my replicas 20 here if we build that same application in Quarkas as opposed to some other solution then you can now have many many more of those so the density really matters here Okay, so just think about that as you see today's presentations and demonstrations This is not the end. It's just the very beginning So at this point I want to turn it over to mr. Jason Green who's going to rock and roll with us and show us some really good stuff From a getting started perspective and how to stay running perspective Okay, thank you for the awesome introduction bird I'm Jason here. I'm one of the I'm the co-founder and co-lead of corpus And I'm going to show you all about how you get started with corpus now as Burr mentioned Corpus is all about making your job applications incredibly efficient But it's also about saving you time and energy as well And so we've had a guiding principle which is developer joy and by that we mean that we put the developer first and foremost In every single thing we do so to start off It's really easy you simply go to corpus.io the website You go to the getting started guide and you can simply cut and paste a Maven command so it uses a Maven archetype to generate your project for you now Once we have our project we can fire up our IDE of choice You can use anything that you want corpus is designed to work out of the box with just about everything So I've got my ID going I'm using BS code at the moment And I'm going to go ahead and do my first operation with this I'm going to do my live development mode now with my live development mode I can make any kind of job a change that I want and I don't have to worry about Constantly rebuilding with my Maven commands or running some special IDE program I simply just start in live development mode and it starts pretty quickly under a second right here So we're going to go and we're going to take a look at what we created with our archetypes So the first thing we see is a simple greeting resource Now I probably should pull up Just to make sure everything's working. Okay It's probably just go ahead and take a look and you can see right now There's a splash page which just gives you some useful information But what we've written right here and there's with our archetypes we've created a a rest endpoint and it's going to respond So this is our HTTP microservice and it's just going to respond with hello so let's quickly take a look at that and see if that is working correctly and I can make that a little bigger for you and you can as you can see hello So okay, let's take a look at this live Reload capability and action so I could simply say instead of hello. I'm going to say Hi there and see what happens. So all I have to do is just refresh. Oh Sorry type in the URL correctly There you go. Well now to prove you that it actually did work. I'll say hi there again And I did the same thing Refresh, okay one more time Okay, so of course you're like we could do this with just Java debug mode, right? So this isn't really that fancy. So let's do something a bit more complicated So normally you don't want to have a constant string. You want to do something a bit more Like a normal application where you would externalize something into a resource as well so one of the things that corpus supports is built-in injection using cdi annotation so I can say inject and I'm going to pick a Configuration property using my profile config and I want to say my configuration name is greeting All right, so now if I go into my resources here All I have to do is to find a greeting and instead of hi there again. We're going to say what's up doc and See what that looks like Okay, and I think I must make a mistake. Ah, yes, I did not return my greeting variable It's actually kind of cool. I should show you guys with with the hot reload capability you can actually So we'll go and refresh this and you can see what's up doc You can actually make a syntax error. So I'll just do that real quick and then I've got an error and then I could correct my error and Simply reload that again, and I'll work correctly. Okay, so I've externalized this variable Now one of the things is that testing just works out of the box So it's just nothing special. There's no special plug into install So if I click my my test function, I get an X and what are you why did I get an error? Well, I got an error because I changed the message so the test was originally expecting the below And what we really wanted to say Was what's up box? We'll go and correct that real quick I can rerun the test and then as you can see that the test is going to then pass right away but We want to do a little bit more than just this right So let's take a look at how we add additional capabilities. All I have to do is say list extension And I get a nice little list of all the extensions that are available And this is something that we're adding to all the time. We're releasing in about two week intervals So let's go ahead and add an extension. So all we have to do is cut and paste this command right here and What which one do we want? Well, I'm going to show you some reactive because corpus allows you to do both imperative and reactive processing so I'm going to do Streams operators for that and then I also want to do some looks do some JSON So we're not just doing simple hello world strings. So we'll take this JSON be extension rest easy json be and The way we go So we've added the extension now we can rerun our Dev mode again All right, so now Dev mode is currently running. Okay, so let's get back into our resource and now like I said You can make any Java change. So in this case what I would like to do is I would like to create a new file I'm going to create a person class and in this person class We are going to give it a few fields. So we'll say name We'll say Let's get our page with that and then we need a constructor. So and then of course initialize some fields I Probably should install a VS code plugin that does this for me And then from here I can generate some getters and setters I don't have to do a default constructor or anything like that and Okay, so now I've created a whole new class called person and then in my resource All I need to do is I'm just going to copy this method right here and I'm going to return and based on Okay, so we'll say hello person and Instead of a string we need to actually return a person And let's do that. So new person and we'll say this is John go pick an age 25 say and Because we have two methods that could possibly respond to a resting point We need it. We need to actually give a different location. So we're going to say slash person just like that okay, so I just hit save and then In a UL. I'll have to do is just go to the new location. So we'll say slash person and We get our JSON message right there. So you can see age 25 name is John don't so that all works great Now I promise to talk to you about reactive So we're gonna do something a bit more interesting and with reactive reactive is all about being able to handle a massive amount of Data and being able to do things without blocking threads So allows you to achieve greater performance Although with corkis we support both imperative and reactive and the idea is is that you mean really want to help you Use the best tool for the job so that you're not trying to you know End up trying to force everything to be reactive You don't have to force your entire technology stack to be reactive You can simply use the methods that you choose. So in this case, we're going to do a reactive version of our message here um, and so The first thing is let's let's rename this method. So we'll say we'll say hello async for that We're on a new path as well. So we'll stick that on a sink now. One of the things is that when you use Reactive programming there's a few different Methodologies, they should be used that are supported with corkis and in this case, I'm going to use what's called a completion stage So and this is a standard Java concept from Java until concurrent and what completion stage is all about it's all about being able to Process data and it is running and then return before that data is completed and then at a later point You can fetch that data. So kind of like a future. So in this case, I'm going to say Return reactive streams. This is using my profile reactive streams, and I'm just gonna do something simple. So I will do hello with With a stream so this is just like normal standard Java streams that you already use for normal Collection processing and instead it's connecting it up to IO for you So I can say hello, and then I'm gonna do something interesting. So I'm gonna make this uppercase. So I'll map my string to be uppercase and Then I'm going to create a list out of that And I need to run that action. So I've prepared my my operation I'm gonna run it and then after that operation completes I would like to do another function and this function is going to convert my list to a string so that I can then return it so we'll do that real quick and There so that looks like that's correct. So hello async returns text plain and completion stage and that's it So let's go ahead and Change this return Made a mistake here. Oh, look see the compilation error right there. So we'll just go ahead and fix that and we will reload and There we go So we've seen we're actually actually streamed all that data together and return that list concurrently And now I'm going to change this a little bit So I can do all kinds of operations any any type of stream operation that you work with the job You can do so we'll use distinct and this will ensure there's only one of any given character So as you can see it's a chelo instead of the two else. Okay, great. That's interesting But there's another style of streams, which is a publisher subscribe model. So let's take a look at that So we're gonna things are gonna get more interesting. We're gonna create a new File here and we're gonna create something called streaming and stream being is gonna use our and our injection annotations so let's create the class and We're gonna have a counter. So we're gonna use another concurrency thing. We use atomic integer and we'll say counter And then we're gonna create a new stream method. So this will say a publisher Also, then I return us a stream of strings basically. So we see a stream and in this instead of using reactive strings, we're gonna use what's called a flow bow, which is part of Reactive X Java. So The flow bowl has is a nice construct because it allows you to generate the net. So we're gonna generate On a 500 millisecond interval. We'll say Seconds Oh need to import this. That's why and there we go. Okay now We were so every second every 500 milliseconds. We're gonna return a value and then we want to map that so we're gonna convert the The the time that's worth so the interval that's returned. We're gonna generate that into a counter value Which and then we're gonna say increment it. So we're gonna implement by by one and then we need to convert that to a string so the counter value to get to return let's convert that to a string and Finally Actually, that should be it. That's all we need to do That is our stream. Okay. So let's go back to our Reop we do want to make sure that it's available for injection So when you're using CDI annotations, you could declare something as application scope that makes it available for Injection and that means there's gonna be one instance for our whole application So in our resource, we need to eject that beam So we'll say add inject and then we're gonna say it's a stream being and Then we can create a new method. So we're just gonna copy this async version and we'll call it stream and We'll say instead of hello async hello stream now we want to use SSE so server sent events to send this back So we're doing a full continued stream and instead of returning this reactive streams call we could simply just run our Our beam that stream method. We're gonna fix our return type to to match. So it's a publisher and That should be it. So let's fire up a terminal And do we'll use curl. Let's go ahead and pin it to the web server And we'll say hello and string because that's our URL Hope looks like we have an error. Oh, yes, so No, semi-colon But as you can see every time I do this request It's actually recompiling and rebuilding my application now I have a stream of data that's coming in that you can see it counting So that's every 500 milliseconds. It's generating the new a new index from that counter All right, so now that you've seen that let's take a look at actually how you Build an application and by the way that exception is because I'm aborting the client And so it's just a the fact that the client hangs up a trigger zone triggers an error Okay, so now from here. I'm going to do just like you do any other main program So do maybe I'm maybe in compile package and then once I get my application built So test ran and everything from here. I can just take a look. Let's take a look at what was created So as you can see only 47 kilobyte just the size of the actual runner jar and There's a separate live directory with its dependencies So this allows you to clean separation so you could do layering and so on and I'm going to do dava desk jar Target and I'll just use my my runner so getting started And it's running I should verify it's still working so I can run my command over here and the stream is still functioning correctly Okay, oh, yeah, and I forgot to highlight that when I do run this it's starting really quickly It's starting in about half a second point six three five So that's just using just plain open JDK, but things get really interesting when we start doing things in native images So let's take a look at how we do that. So if you go into your project that was generated There's a nice little docker file And in here you can see commands to do this stuff. So all you need is just an nbm package command, but you pass it Just the p native for profile native and then there's a separate flag that you can either choose to build on your operating system You're using so I'm using a Mac in this example And that would have created a Mac executable, but I don't want to make it so I want to run it a container I want to run with Linux. So I use my my docker build option and If I run that in here, I can then start that process So this takes a bit because it has to do a bunch of generations So I'd like to talk to you a bit about what actually corpus is doing. So let me Move over to here and let's make this a little bit bigger for you Okay, so what's happening? So what corpus does is essentially it is a full advanced dynamic runtime container that has been transformed to move everything at build time and how corpus does this magic is it actually transforms your bytecode of your application and Performs a bunch of advanced heuristics to generate the actual code, which is then ran by a Grawl VM Compiler called native image because it produces optimal code for Grawl VM Grawl VM is able to efficiently generate a very tiny native executable out of your application And this native executable encompasses not just your application itself But also the pieces of the JDK that you're actually using and the frameworks So it'll be a very very tiny binary that you can then put on a container and then run in very high density In the cloud now the way that we the way this is the reason why this is important is because Application environments that run Java applications. They deal with a lot of things like in direction So you saw all the fancy annotations that were in the application. You saw at get you saw at inject well this at inject has a decoupling and Because of the decoupling a static compiler cannot necessarily know how to process that efficiently So what corpus does is corpus resolves all that decoupling and to something that is direct instruction So the static compiler can then produce that executable Now because this is a complicated thing to do and because we want it to be easy to extend corpus and to add additional Extensions we built a whole architecture around making that easy and automated So in the corpus core corpus cores whole responsibility is to generate all this magic for you And then we have a layer of extensions which utilize that facility and we emulate as if you're in a runtime environment So your extensions don't have to do bytecode fanciness or anything like that They just simply say okay register this URL set this host do these things and then out comes An executable. So let's take a look at the executable that was generated I can what's my target directory again and as you can see This Linux executable is 22 megabytes. So that's everything That's the that's the execute. That's the actual native image of the application and the dependencies It's using and the JDK it's using this is all you need you need that and live see and live see and you could run on your Application all right. So now we're going to build a docker image out of that So let's do that real quick okay, so now we have a docker image and The next thing we need to do is actually Run out one thing is I like color. So let me change this command real quick. So we'll get some color in here okay, so we run our docker and You can see it started in point zero zero four or four thousandths of a second four milliseconds And we're immediately available to answer requests And that's incredibly important in a serverless architecture because the time that you take to start is added to the request that you are processing So it's very very important that this be a very small number and this is a very small number. So I can create a separate window here and I can go to Say hello extreme and you can see that our native application is serving requests running in a container now Let's take a look at how much memory is actually being used so I can use a little script. I wrote Do that So we'll do we're gonna take a look at the actual RSS size of the process and as you can see here You were able to see As you can see it is 15 megabytes, which is incredibly small That is tiny and in that and if you saw the other slides that that That Burr was showing there is a different density factor here when you run a normal Java application You typically use hundreds of megs and in Quarkus We're using tens of megs of memory and starting and blazing fast times So we're talking about something that really transforms how you could use your application in the cloud and with that I'm gonna hand things back over to Edson who's gonna show us how to take things to the next level and operate with data here today presented to you something about Quarkus Like 99% of the Java developers worldwide is they still need to touch a database when Hey there, so if you're waiting for Edson to get back on he is working on his audio right now We're gonna find a backup connection for him to basically broadcast audio in addition to a screen share We can see his demonstration. So hold on one second. We'll be there. We had some technical issues Do not hearing him Yeah, now you're greedy. Oh now you're ready Okay, sound check one two three Is it good? I hope it means again. Okay. Yes. So yes, okay So, uh, yeah, so you didn't hear me in the beginning But what I really Jason presented the awesome things about Quarkus and well Quarkus can run natively can start very quick Very fast. Okay. It was very low memory footprint But it wouldn't be enough for us as Java developers if we didn't allow us to have a very quick Interfeedback loop. So like 95 99% of the Java developers worldwide need to interact with a relation on database in their daily Activities. So what I want to show is how joyful it is for you to play with Quarkus when you're touching a database I have here on my machine Maria db running. So if you Look at my console. I have some Database here. I just created a database called spark joy and if you go there and see I have no tables available and So right now I'm going to create a new Quarkus project with spark joy And if I go to this folder, I just want to be able to create that and I just say and the end of Quarkus Quarkus Maybe I'm plugging. I want to pick a version and I want to create Okay, so I can use the group ID artifacted the version I want to create a new rest resource and come right ahead developer Developer resource because we're talking about developers, right developer resource and developer Slash maybe so I just created that and let's open this project while my IDs booty straps Importing let me switch to presentation mode Developer resource. So it's basically the same endpoint that Jason showed to you And maybe I want to change this to slash developer And if I just run it the way it is right now, I'd show me the hello Okay, no big deal here so far. You've seen that before so let's try to touch something very interesting So I need to install some extensions my Quarkus projects We get back here MPN Quarkus Least extension So I have the pensions. Let me try to add some extensions and the stations for today are I want to add json be for rest easy to and I want to use Hibernate with Panache I'm going to show a different way for you to access your database using hibernate Panache and I also want to use a database. So I'm going to add the JDBC driver for Maria dvd That should be enough. All right up and running so I can go back here to dev mode Dev Okay, it's not going up because I didn't configure hibernate yet, but we can go back to our IDE You can show here If I open my form you can see that I've added this dependencies that json be the Maria dvd and the Panache If I go here to my application properties file, I know this properties by heart So just because we have this technical issue. I want to go back here Very quickly and copy paste the properties that I just configured before I had a backup and luckily I had this backup So what are we going to configure here? I just have to add the properties of the JDBC URL Which is Maria dvd running on localhost and then my new database spark joy that I just created I also have the driver the Maria dvd JDBC driver my username and password of developer and I want for this interactive demo I want to use the database generation equals to update Because we'll be just changing the code on the fly and also updating the database on fly But it makes a very nice experience So if you go on here back to developer resource if I did all that it should be enough for me to start Developing right now parkus is up and running my hello end point still working. Let's get back to my code So if I just go get here and let's say I want to create a new entity. So let's try to create a new class Have a class called developer, of course and developer It seems it's an entity I'm going to annotate that with an entity and if you're used to JPA development Probably you would think oh now you need to add an ID getters and fetters and all of this stuff Mapping, but I'm want to use Spanish. So if you want to use Panache Which is think about Panache as Squark was alternative to the active records partner for persistence So if you ever use it Ruby on rails or if you ever use the play framework with job or scala It kind of has the same idea. So instead of having a repository, which by the way Quarkus also allows you to do that. I'm just showing you a different way of doing this the traditional stuff that you use to You could do that too But so here we have you can accept record style and I want to add some property Maybe I could instead I could create like private string name and generate the getters and setters But with Panache, you don't even need to do that you could just generate like a public field and When we when we're compiling your code, we're just generating generating the getters and fetters for you So everything is going to be access to getters and fetters But for your code, you just need to declare a public property Okay, and how does it work here for us? So if we want to have a developer resource So instead of just returning real hello, maybe I should be renaming these developers and I want to return application Jason and I'll be returning a list of the developers available on my system Okay, so and what do I need to do to return a list of all developers in my system? I just say developer and I have a static method saying list all Of course, you wouldn't be doing that in production because like a thousand or ten thousand developers You'll get a huge list to be returned. But since we're just playing here We can list all because it's going to return everything. Let's kind of just go to this endpoint and ask it for look a host Developer you see that it returned it for me an empty jason List you can see that quarkus has only took one point four seconds to reload and to Connection my database to create my database tables. Did it really create my database tables? Well, let's just check. Yes Just create a developer having a sequence and if I try to describe developers I can see yes. I have an id and I also have a name So quarkus did that all the fly. I didn't have to stop anything as soon as I saved my file Quarkus was ready for me. So let's try to populate my database and again I don't have to change anything to stop anything or starting a thing. I just code That's that's what we as developers we joined right? So let's I'm not creating a retin point because then I would need to purr. I like to do everything on the browser So let's try to get I want to do a pet slash new and maybe I want to add a name So it's going to produce for me also Media type dot application jason And I want to public we want to return a new developer Okay, here I can receive the pet parameter. It's going to be called name and the string Right. So how do I create a new developer and persist that on the database using panache? And quarkus. I just have to create a new developer Developer That and I say well the developer name is going to be dot name equals to This and now you can save the developer developer dot persist and return developer All right, it should be enough for us to be saving My entity says I go here back to my console and just say Flash new slash and I guess Oh, you can see that return of the entity that was just persisted if I go back here to my database I can see my database too here. Let's try to see What's available on my database And you can see that there is nothing and why why is my database empty? Why is my table empty? Well, I made a mistake in my code if you go back here I'm just asking it to be persisted, but I didn't create any transaction So I need to add this transaction on the patient here And now it's probably going to work And let's go back here. Let's try to persist a new person Yanaga and now if I select everything yes, I'm being persisted So you can see if you when you're developing you're creating your new pieces of code in your application Maybe sometimes you make some mistakes And instead of trying having to review your application taking like minutes for a view And then another minutes for you to wait for application to to get back on the stage that you're wearing Well with quarkus, you don't need to do that You just go to your code you added your code You save the file hit the browser and it's already there and that's my favorite feature about quarkus So what we just added created a table, but maybe quarkus can also add some features to our Current instance. So yes, I have a developer. Maybe I could also add another few Public strength like favorite Framework and of course the favorite framework for everybody these days is quarkus. So I'm just going to add this property I just hit save I just go back to my browser Let's see what's happening with quarkus here. It's so fascinating to To give it some time so you can see what's happening and then just hit reload and Try to save on your one. Let's try. Let's try to put jason here on my database Yes, so jason already has a favorite framework. This one is quarkus. And if I ask you to show What's available on the database you see I have I mean another I don't have yet a favorite framework We can fix that quickly on the people database But jason is available on my database and his favorite framework is already quarkus Let me fix that because I think that's a huge mistake for me to not have quarkus is a favorite framework So let's say a developer that's favorite Framework equals to quarkus Okay, and if I go back here Yes, now quarkus the favorite framework of everybody. What else can we do with just uh panache? So you can say I said that you can do everything as public fields inside your entity But you can also do more and what is this more suppose that uh when I say favorite framework I just I don't want it being persistent That's just quarkus, but when somebody retrieves that's from the database and shows that to the user jason format I want to add some more information to this string So maybe I could just create a getter So when anybody tries to get their favorite framework, I can say it's not just their favorite framework I could say that I can add some information. So I'm going to add the string And I say that quarkus is just Simply coding that sparks joy Because that's my favorite thing and if you're thinking about oh, he's using that marie from the reference. Yes shameless shamelessly Just reusing that because I think it's very nice. So I'm saying uh coding that sparks joy I just have to go here to my web browser and when I ask this Yes, it's available there, too And it's not just for getters. We can you also do that for setters. You see I'm using public fields, but Behind the scenes quarkus is using the getters and setters for me automatically. I don't have to touch anything But suppose that every time I want to persist the developer when I'm writing that to the database I want that name to be persisted in lowercase. So I guess I can use a set name here and say that. Well Name is going to be persisted as lowercase, but when anybody tries to retrieve the name I want this name to be on on uppercase See very few changes in my code setter and getter. I'm adding some Business semantics in my code and whenever I go here back You can see that the name is already being returned as uppercase, but it didn't change In the database yet. It's already Camel case, but if I want a persistent new developer here slash new slash Burr So burr his name is uppercase here if I go to the database You can see that his name is lowercase, but whenever I try to retrieve the information It's going to be all in uppercase. Okay. So you see quarkus is very fast It allows you for there For you to have a very quick inner feedback loop when developing and it seems for me just spark joy every time I use quarkus and Of course, quarkus has a lot of more things for to show to you But Now I'll leave it to burr so he can show some other also some for quarkus All right Now I find the screen share button Let's see if I can get a little inception going here like edson had Okay So this was the slide deck we were working on so hopefully you guys joined that and check that out But now I'm going to show you some example applications that I have So if you build on or think about building on what edson just showed you and jason just showed you I'm going to show you a couple other things side by side. So already a key a bunch of key questions are what about spring boot What about spring cloud? I saw those and so maybe some of this is your answer here I actually have a spring boot application running side by side with a go application I also have my postgres database and I have a quarkus application All running within my local mini cube here. And so that's what I'm using is mini cube And so if I come up here jump back here if I come here and say a cube ttl get deployments You'll see those deployment items there All right And then this is the pods that are running right here and then I have some application here application code here So I'm going to do a quick polar to basically hit the end point Okay, and actually let me open up the browser. So you kind of see what this application looks like So basically what we were seeing earlier. So here's the apple on the pineapple. I'll add a new fruit called burr Okay, and then so there's my three fruits there and let me run my polar again I'm just running a typical create read update delete against a postgres database Again, it's all running within the context of kubernetes and I've already done my mini cube SSH over here. So I'm in mini cube. So let me see here Let's actually look at the memory footprint for this quarkus application So this is about 50 megs with a habit set up here It's about 50 megs of memory being used by this crud related application You kind of see it's flowing way down here. Uh, if I come over here now and let's remove butter And There we go. Okay. So that's the quarkus application. I also have a go version of this and let's look at the spring boot one Again, this is they are different architectures. So or so a different thing as I should say and actually let's just look quickly at the code Uh for the quarkus one because you were seeing it there with um Edson Okay, so it's just the standard stuff you saw with edson earlier Except this is a kind of a whole hibernate-based application. Let me switch over here to the spring boot one And Same thing here. Let's do the polar All right, that's good And let's open the browser for this application So there it is And So again hit it there. I'm just testing it real quick. Make sure let's add edson as a fruit. Okay So it's an it's now fruit, but our apple and pineapple there. There he is. And so if we look for that spring boot application It's running as a red to java application We said it's using about 200, you know 260 megs around there So so basically, you know about five times bigger So that that's a simple example of a crud based application And if we look at that app, you know, you kind of see it's pretty standard straightforward spring boot style application No big deal there. That's the test. Let's see here. I think there's the entity And of course they're controller. Okay very standard stuff So just kind of give that comparison side by side to give you a feel for what, you know, a real application looks like So a little memory footprint faster startup and in a kubernetes architecture It does make a big difference, but I want to show you a couple other things real quick So you do this switch namespaces And this is not meant to be a kubernetes Let's switch namespaces here and so Let's go into my list to go into Node.js application Now this time what I have is not just a straight communities application. I have a k native application Okay k native applications behave a little bit differently. So I'm going to actually notice there's no pods running But when I hit it with a large But enough load in this case 20 concurrent connections 20 concurrent users are being made You can see that node.js node.js node.js app scale up You kind of see it happening right there And then Let's see get connected. So there it is it just came up and so it took about 19 seconds to get it going and let me just run my polar there also So with k native right it's going dynamically scale up from zero And you saw that latency based on the first request, right? So the first user is having to wait for that thing to scale up and come to life That's the nature of the serverless architecture and then of course it does automatically start scaling down It does see that based on my simple polar here at the bottom that it only needs one of these pods running So that's the beautiful thing about k native running on top of Kubernetes But the same mindset and the same concept works in any serverless architecture But let me see here if I look at my node app Okay, and notice there's actually a bunch of results here notice the three by three So you have the two sidecars both istio and the k native sidecar associated with a k native based app And so that adds a little bit of overhead But let's see and you have to kind of look through here amongst the sidecars to find the actual end point All right, so that's about 31 meg All right in rss terms. So you can kind of see merges there. Let me come over here to corkis Okay, same kind of thing. Let's see if we can burst it out Hit it with enough load because the System to scale and keep in mind my system is actually pretty overloaded at this point Not only is it doing the live stream, but it's also trying to run all those other applications you saw earlier So there we go. It kind of responded pretty fast there. So it actually responded faster than no j s application And often I see that let's look at the Let's look at the polar and let's go check out its memory usage also There we go and let's see if we can find its memory in here amongst all these sidecars I Let's see right there. So 15 megs around so it's running about half the size of the no j s application So I make that point only because I talk to people all the time to like what we're rewriting our microservices Or doing our serverless and something else other than java because we need something that's smaller and faster So what I just showed you right here is not only were we smaller and faster than spring boot Which is a fairly easy comparison. We're smaller and faster than no j s as well Okay, so I'm going to make that point and I want to show you one last little demonstration And then we're going to ask we have a few questions. I have one other little fun thing I'll show you real fast. Do you just we don't have a lot of time for it here Uh, normally I'll do a little live coding on this as well, but I'll just want to give you guys a little application It's actually a very simple application based on a web socket here Okay, so very simple web socket code. It was one I used to do in verdex But let's just run it real fast And so you can see even on this linux server, which is running up in t it starts instantaneously And what I want you to do is go to web.ber That red 8080 Okay, so you do that in your browser here and actually I'll even add a good chat real quick Yeah, I'm foam. Okay come back here And let me go to my Everybody here Okay, so let's see here. Here's how this works It's a simple little little thing that I have fun with at different with different audiences But now you can come over here and paint me a little picture. Okay, and what's cool is every keystroke that you drop in You'll see that also immediately impacts my screen So if I I can hit clear and if I can come over here and put my name in So there's my tile that I'm working with right there. So you guys are doing a good job filling out my screen here Um, and so the point of this is this is mostly JavaScript on the front end What a web socket back in running through java But again that small simple application that I can build with corkis I can basically push out very rapidly to the outside world. Okay So we probably won't let you guys draw too many pictures because it could get offensive But we do need to take some questions So let me stop screen sharing now and get everybody back in here for some questions And we we'll get jason and edson back online here And I'll just I'll read you out some questions. I noticed during our presentation So a great question for you gason. When do you use jvm mode versus native? That's a great question. So really the biggest difference is that with hot spot open jdk hot spot You get the Typically you get the best jit performance because it can react to runtime code Whereas with native images you're using a head of time compilation. There's some like technical differences between the two Largely, you know, io is the biggest factor when you're talking about things like microservices Native images on the other hand give you that really really small size. So Typically the way I like to think of it is if you have an application that has like gigantic heaps Then you know, you're going to be more steered towards hot spot But if you have an application, which is like your typical rest microservice or event say kafka base microservice or serverless application Then you're looking for a small footprint size So you're looking for native image and one last thing i'll say is that It's important not to think of things in just the term of a monolith You can take something that you would normally have as a big jvm and really to take advantage of the kubernetes architecture You want to have a whole bunch of tiny containers? So you can scale up and scale down based on your loaded needs and save that those resources costs as expensive cloud resources Okay, all right. It's a quick question for edson if he's still on the phone there So how would you compare and trust this versus spring boot? There's like at least that question a dozen times. This is replacement an alternative Can I run spring boot? Can you give us a quick answer on spring boot versus corkis there edson? Oh, gosh, that's a complicated one And you only have a couple moments. Yep, we can hear you Okay, well, uh How do you say as a long time spring spring boot user? Like I say that well for many use cases there are equivalents. So The things that you could do in spring boot. You can also do in corkis But uh, i'm really excited what i'm really excited about corkis is this capability to to boots very fast to have a very fast um response times for first request very low memory footprint and I I can uh, I think I can attest that you don't get the same Inner feedback loop response time with any other tool. So if you just save refresh you get the response Well corkis is the best one here, but if you just want to create resting points and access database, for example I would say that there were equivalents Okay, and then a related question that we'll just address really quickly people are asking about spring cloud specific annotations Like how to deal with service discovery how to deal with circuit breaking how to deal with uh, you know load balancing And that was a question by mark and so edson I know you kind of feel about seeing what I do is with kubernetes You don't need most of those things with kubernetes plus istio. You definitely don't need those things Those things are part of the infrastructure now So if you are building applications microservices applications that require a lot of those capabilities And you're living outside of kubernetes then yes, you would you'd still be interested in some form of discovery mechanism load balancing mechanism circuit breaking mechanism Uh bulkheading mechanism But if you have istio type kubernetes those things are solved for you already the good news is it's just part of the infrastructure Uh, we only have time for one more question and so go back to jason So if I have an existing app of millions of lines of code I saw that question in there and I thought it was kind of kind of an interesting one What does it what does it mean to bring millions of lines of code into a corkis universe? So, um, I guess there's different ways I could take the question. I'll try to answer it fast I'll just was saved off around the bat that if you're thinking of just trying to drop in say a an older E app and run it on corkis. That's really not what we're focused on. We're focused on new green field apps However, it does carry a lot of the same Um a support for a lot of the same apis and frameworks that you may already use so it should be very Easy to pour your use case as long as it's a microservice-based use case If you're talking about can't you actually have a gigantic app and run in a native image with corkis the answer is yes We've done internal modeling and testing of very large applications Although in general the architectural part of a microservices You want to have small services that are focused on separate functionalities so that you get the best robustness and scalability of your system Okay, well, thank you so much for that jason and we are out of time There are some more questions and please do hit us up on the chat Like so you saw john actually post that information there about the chat You also have access to the corkis website and you have access to all of us on twitter You saw our twitter handles when I showed you the slide presentation. So awesome stuff today. Hopefully you guys enjoyed the session Thank you so much jason. Thank you so much edson Thank you guys All right, everyone. We're signing off. Have a great day