All of us were shocked by last night's news about David Ortiz and our community has felt a palpable concern ever since. As befits his outsized personality, wishes for a speedy recovery have poured in from all over baseball, from the world of sports and even from respected world leaders. He is loved throughout our nation and beyond, yet to us, he is our own adopted son. Won't you please join us as we offer a moment of reflection, thought and prayer for a complete healing and a full recovery for our beloved big poppy. Thank you. Yeah, it's a different way to start and I'll be whip around tonight. That's for sure. We've got the hall of fame of Frank Thomas, Mark Sweeney, and I'm Kevin Burkhardt. And today, Ortiz was transported to Boston. That after suffering a gunshot wound in the Dominican Republic last night, Ortiz underwent a six hour operation and the Red Sox held a press conference earlier today. Be hard-pressed to think of anyone more beloved than David. And you can imagine how this has impacted the Red Sox organization. I know how it's impacted many of you who are here who love David. And it's a very difficult day for the organization. Just you're shaken, really, is what it comes down to when you hear this type of somebody who's not only, he's iconic, but he's a friend. And when you hear that, should you just feel for him as family? I always said that he's bigger than life, you know. David, like that vibe he brought in on a daily basis to those teams and what he brings any time I see him, you know, that smile.  And he's a superhero without capes. That's the way we see him, you know. So he'll be okay. Yeah, more reaction from around the Twitterverse today. Pedro Martinez, of course, his long-time teammate, said a lot. And that picture kind of says it all about their relationship. And that was it all. These are just a few of the outpouring of support on social media. Tom Brady, of course, get well soon, my friend. And then how about Barack Obama talking about Ortiz's spirit and resolve, getting through the Boston Marathon bombing, get well soon, poppy. Red Sox Special Assistant Jason Varatek also spoke about his former teammate today. Great human being, not only being a great player, but, you know, played the game right. From his DNA, from being a twin, all that he brought when he was here. But this is... Excuse me. He's a dad.  I mean, it's very scary thing that something like that can happen that easily. Yeah, look, this news shook all of us pretty hard. Certainly here where we've worked with him for the last two years and gotten to really know him, Frank, and you've known him for a lot longer than that. What's your thoughts on this whole situation? It's been a tough day today, you know. No poppy long time now. Capita gets him a long time. First of all, I just want to wish him well. You know, praying for a full recovery for him. But like you said, we've got to know him in the last two years, up close and personal. And it hasn't been a boring moment because he's big personality. So we wish you well, wish your family well.  We miss you. Yeah, iconic personality, iconic player. It's one of those things that humanizes it, but it does. It shifts all to his family in his recovery. We wish him the best. Yeah, we do. We miss you. We need you to get well, big poppy. We know you will. And we're rooting for you. Back here, we hope you know that.


Good morning everyone. Thank you very much for coming. It's a great pleasure for me to be here in Bangalore I always love the audience here and today. I'm going to talk about coding that sparks draw with Quarkus I don't know how many of you know Maria Kondo Not that much, but Maria Kondo is a Japanese a personal organizer and that's where That's from her that I took the sparks joy term basically she tries to say to you that there are some things in your life and if you want to check if you really should keep something you should Take a look at that if it really sparks joy in your life, and you should keep it or else You just should thank it and leave it behind So when we're talking about coding that sparks joy basically we're talking That's our there are some coding presses that you should be leaving behind if it doesn't spark joy And I really believe that Quarkus sparks joy in your life My name is Edson Yanaga. My Twitter handle is at Yanaga and let me say some fun things about me. First of all I'm a Brazilian Japanese and typically not the Brazilian you would expect but a lie I'm a hundred percent Japanese, but I was born and raised in Brazil Now I live in the US in North Carolina I'm also a Java champion, and I'm across often VP as far as Google can tell me I was the first and still the Only one I'm also the DevConf Rockstar The DevConf is the largest software development conference in Latin America every year They have like 30,000 people and they granted me these award two years ago And my Twitter handle at Yanaga just in case you want to follow me I talk a lot about Java DevOps micro services software craftsmanship and other nice stuff and When we're discussing about Java programming, let's talk about some myths and facts first we know Java used to be slow and The fact is that Java developers are very good in social media because you know whenever you have to try a maven Butte or try to deploy our artifact to our web sphere application and try to try to wait it for a warm-up And then later check if the result of our Coding is working It takes some times that they'd like sometimes 15 minutes 30 minutes That's why we usually have time to check Twitter Facebook LinkedIn snapchats and any other social media And we then even have even time for coffee and go to the restaurant when we come back. It's not finished yet So that's why we always have the excuse of my code is compiling my project is building but It's in the past with Quarkus everything can be different because Quarkus really brings you developer joy Which means that when you're developing software with Quarkus, you don't have to wait for it to be ready You just saved your file and it's automatically there So if you used to be Jellos for about the Ruby developers or the JavaScript developers They had the ability to just save their files and automatically see the results of their changes Well with Java now it's possible and In my particular opinion is that Quarkus is the best thing that ever happened to the Java platform in the past 15 years Because finally we can be a very productive when trying to develop Java project we can be very productive to trying to build our new microservices in this new platform But I don't want to just talk about it I really want to show how things are great And I hope that after my talk you'll be able to check out the project and see for ourselves how Quarkus is great So let's go to the live coding part of this talk. I want to go here to my terminal Let's see if I'm in the right place. Yes So let's create a folder called dev nation and here Let's try to create our first Quarkus project the easiest way for us to create the Quarkus project is using the Maven plug-in and Before anybody asks me yes, we support Gradle But I'm a Maven user, so I make bad choices. So let's try to create this project using Maven So when I tap it it will ask for some basic Maven information like group ID come redhead developers Artifact ID, let's call it dev nation version arrest resource. Yes, please Let's stick to the default and it's running So let's try to open now with my ID and this is going to be the slowest operation.  Let's make it bigger Okay, so if I check here Quarkus created this example. Hello, Warden point So now I'm going to start my favorite Quarkus feature which is development modes So whenever I do this Quarkus compiler Quarkus dev I'm enabling enabling development mode. So now Quarkus is listening for changes in my file system So whenever I save a file and issue a request to my server Quarkus is going to restart it and Development mode now right now started in approximately one second, which for me, it's very slow We can do much better than that because Quarkus when it's warm You usually should take around a hundred milliseconds for every one of its reloads And we are not doing any kind of magic here like we don't do any class loading magic Some proxying or something like that Quarkus is so fast It was much easier for you to do for us to just stop the server and start it over again So let's see how it works First let's check if Quarkus is working. So if I go here local host 8080. Yes Quarkus is working go to slash. Hello. Yes. Hello. Hello is working there So if I go to my source code and I check instead of hello, let's try to do some hola, which is hello in Portuguese and Spanish to go back to my browser Yet it's already updated. How long did Quarkus takes to refresh? 400 milliseconds while we're warming up we can get better than that. Let's go back to my code and One of the great thing or good things about Quarkus that this is a traditional juxtaposition point a Synchronous one, but if I want to do some asynchronous programming, I can do that too with Quarkus. What do I need to do?  This is synchronous code save my file go back to my browser and hello It's already working and hello async. Hello. I'm async. How long did Quarkus take? Let's check 200 milliseconds. We're getting better Go back here to my codes. What else can we do? Well, these are just boring plain text static strings So maybe we should be able to customize the strings that we're returning through a configuration property. How can I do that? Let's try to add a string greeting and instead of returning just All I can return a greeting and I want this property to be inject dynamically So and I say that the name of this property is going to be greeting I go back here to my browser and oops I have an error because I said that I need a configuration property, but I didn't provide one What can I do to fix it? Well? Hello Let's go back here to my codes and If I go to my application properties file, then I can prove provision Value, so let's try to add some French. Bonjour save the file go back here. It's already working Okay, go back go back to my Hello resource file so but since we're using Java 8 and micro profile config API Suppose that I didn't want to use just a plain string if I didn't provide any value I could you also be providing a default value. Let's say hi Default so if I go back here to my application properties and I made a typo I can go back to my browser and hi I'm default because there is none there But just in case I don't want to To use a default value I could also use an optional so If I'm If I import the right class. Yes, so suppose that I don't want to provide that Default value, but I use I want to use Java optional. Hi. I'm optional Okay, so I want to use the Java of Java 8 optionals go back here. Hi. I'm optional and it's already working Okay, and this would start to come hundred and ninety milliseconds. Yes We're getting close to what we want But you might argue that this is a very simple juxtapoint arresting point returning text plain And it's not that interesting because no real Java no application No Java application is really a real if we don't add a database to that like 99% of the Java developers worldwide need to deal With our relational database every day, so let's try to add this capability to our demo application So I'm going to stop development modes and I need to add new features to my Quarkus applications These new features in Quarkus are called extensions and luckily we have a lot of extensions to be able to play with So if I go then type Quarkus list extensions, I'm able to get a list of all the Features available for Quarkus right now. So for example, I can use reactive verdicts I can use swagger for a rest For testing my end and points I can be reactive What else open API tracing FNLs, but the ones I'm interested right now. I want to use json. So I'm going to add this json being I Want to use databases, so maybe I want to add some hibernate. I also want to add some Database drivers, so let me find maybe I can add the MariaDB driver. So let's go and do it The easiest way for you to add extension you can always edit your PON XML file to add extensions But it's much easier with the plug-in. So if I go to Quarkus add extension and I type the extensions that I want. It doesn't need to be an exact match You can type like just a substring and it will automatically try to figure out which extension do you want So I want to add some hibernate JPA But I want to show you a new API that we're providing with Quarkus called Panache on top of hibernate and JPA So at Panache what else I need a JDBC driver. So I'm going to add MariaDB. Oh, by the way Do you know the story behind the name MariaDB? No, so let me try to quickly explain that one of the most popular open source database servers is MySQL and Initially the developer is I think is he's Swedish and you know developers are very good in naming projects So he when he had to he created the database project and he had to name that well Let's try to find something and oh I have a daughter. I had her daughter. My daughter is named me So I'm going to name it in MySQL, but in English became MySQL So the popular became that the project became very popular later. He sold the project to son Then Oracle bought son and some years later He wasn't happy with the development of the MySQL project and he decided to fork it when I forked my sequel Well, I need another name So but now I have another daughter and my daughter's called Maria So he called it MariaDB and MariaDB is a hundred percent compatible with MySQL So we're using the a hundred percent open source version of the fork MariaDB. I also want to add some Jason so I'm going to have some rest easy Jason B I also want to test my endpoints So I want to document my rest endpoints using open API I want to publish the schema and I want to test my rest endpoints using a beautiful interface called swagger It should be enough for now. Let's see if I type it everything correctly. No Probably made a typo which one I couldn't find the rest easy because that's I have an additional a So let's fix this typo It's rest easy. So processing again. Yes now a bit successful I added my dependency successfully my extensions. I can start development mode again and Go back to my ID. How do I use? JPA on top of this first This is way for you for me to use hibernate JPA if ever created using any JPA You first you need to create an entity to create an entity So I'm going to create an entity called developers because we love developers and As you know any entity needs to be annotated with its entity then I would need to provide a very boring ID Like ID at generated value But since I want to show you the cool stuff that Quarkus provides for you I don't need to provide this ID since we're going to use this new feature called Panache I can basically just extends a Panache entity and The ID is going to be provisioned automatically for me now. I need to add some properties. So I would say private string Name because every developer has a name and I would need to generate the getters and setters But you know it's just boring and think about that if every time you're creating a property in your entity You're just exposing everything as getters and setters. There is no real encapsulation So instead of doing that and I know some people might be Surprised about that or even complain about that but With Panache, you don't have to provide private properties and public getters and setters You can use just a public fields and you may think oh That's against everything that I learned in the past 20 years, but With Panache it allows you to code like a public field But at runtime we will generate the getters and setters for you and use the getters and setters So it's a matter of option if you want to use a public field That's okay if you want to use the private field with getters and setters is also okay But at runtime you will be using the getters and setters in fact if you generate your own getters and setters Panache will use your own get your getters and setters or else we will generate them for you So let's try to use the public fields for now So it should be good. So I have an entity, but I need to configure my database connection How do I do that? I go to application properties and I type some Quarkus properties. So let's say that I need to Quarkus Data source URL is going to be JDBC my sequel Oops localhost And my database is spark joy, I need to type Quarkus that the source user name is going to be sparks joy Quarkus data source password sparks joy Quarkus data source driver Org Maria DB JDBC driver and the last feature the last configuration property It's going to be one of my favorite ones hibernates And Update Never use this in production. I see some using a demo I want hibernate to be updating my database as soon as I'm coding my application. So it should be good for now Let's see what happens. I go back here to my endpoints and issue a refresh If I show here, well, I missed the magic because I wanted to show that my database was empty Maybe we can try to do that again. So if I show the tables, yes, you know, they already have a developer and then a hibernate sequence Let's try to dop drop everything drop table developer drop table Typo, so I don't have anything. I'm going to stop start Quarkus again Okay show tables. It's already there. So Quarkus connected and generated everything for me if I try to describe my developer database Yes, I have an ID and a name. So let's let's try to test this endpoint for me to test this database Yes, I'm great. I want to generate a rest endpoint. Let's try to create a developer resource and this is going to be a path slash developer It's going to provide me first. Let's try to return all of the developers in my database. So developers list and This is the first feature of panache So traditionally, I would have to inject an entity manager create a query return all of the developers in my database But since I'm using panache panache in this case is using the active record style of a persistence the two most popular persistent patterns in in in the development board are active record and repositories With repositories. Well, we're used to that but with active record if you ever Developed using Ruby or errors or play framework in the Java space You know that active record blends the entities with the persistent methods Okay, some people might argue that then your entity is doing too much But active records is very good for a very simple use case such as crud in the other hand repositories Maybe they are better suited for more complex business Domain models So but since it's just a simple crud. It's very interesting for me to use the active record style So what do I need to do to retrieve all of the entities all of the developers in my database? I just tap developer Dot list all Of course, you would never do this in production because we're fetching all of the entities your database But since it's just a demo, it's okay for now in the real world You would page or would limit the results or you would few terms something like that So I want to it's a get and I'm going to produce media type Application Jason and if I did everything correctly I can go here to my browser and say slash developer It's running but it's returning nothing because my database is empty I could go back here to my database and insert some some some rows in my database But that would be just boring. I want to test that for my rest and point. So let's try to insert some Developers through my rest and points. So how do I create that? I want to create I'm going to do that through a post statement, which is going to produce application Jason and also is going to consume Application Jason and for this I want to return our developer and I'm going to receive a developer 2 and If I want to be able to persist a developer I just need to make sure the developer ID is no and if I want to persist that I just have developer dot persists Okay, and it should be enough and return the developer and if I go back to my browser You can see that oops. I made a mistake. I forgot to add a semicolon But luckily Quarkus every time I'm issuing a new request Quarkus is the recompiling my project and already showed me a very interesting message saying that at developer resource line 22 You forgot a semicolon if I go back here at the same column and it shouldn't be oops It should be working. Okay, let's try to test that post endpoint. And if you ever try to use it And test post endpoint, you know that I would need like a Firefox plugin something like postman We need to create a very complicated like curl command, which is very cumbersome and error prone But since we're using Quarkus, I can just go here to my browser and tap local hosts Swagger UI so it's going to provide me a very nice interface to test my rest and points Swagger is consuming the open API Schema that has been providing at decent points So the open API is generating the schema for my rest and points and showing me that yes You have a get developer a post developer get hello and get hello async. I'm interested in this one post slash developer so it already provides me an example value the schema and I'm interested in this bottom try it out. So let's how see how does it work? Quarkus is saying well, you have the value maybe should could provide I'm going to type Yanaga here and try to execute that and the response is 500 which means I had a bug so I have a very long message here But if you look at the stack trace, it's going to tell me that you are trying to persist an entity and into the database But you didn't provide a transaction. So with Quarkus is very easy for me to fix this bug I just go back here to my code and then add transactional Save the file go back here and let's try to execute that again Where's the bottom as acute and Now it's returning me at 200 and just in case I want to copy paste this curve statement is going to work on the CLI too And the response body was yes It's persisted now I have an ID number one and the name is Yanaga if I go back here to my get rest and point of refresh and Yanaga is Already there. Let's try to add some more developers to make it more interesting. So I'm going to add Burr and Asacute that I'm going to add skamash too And Asacute to go back here. Yes, everybody is persisted. So that's how it works with Hibernate panache swagger and Jax RS Good. What else can we do? You might well, we're using active record. I didn't like active record I'm a very old old style Java developer. I want to use repositories. Don't worry. We got you covered We can use repositories too and we can help you to build your repositories. So let's try to create one I need to try to add a new developer repository and If I want to implement a repository we're using quarkus and panache I just have to say well, this is going to be an applications code web being and I need to implement the panache Panache repository interface of our developer As as soon as I do that already have all of the persistence methods find Persist merge and all the things that you use it to but if I want to create custom methods I can do that too. So let's try to add some business logic here. I want to return all of the developers That are Brazilian Japanese Don't expect to find many So let's try to create a custom carry I also have these default methods here and if you ever create an HL or JPQL curing You know that you would say well select star from developer where the ever Where developers something but it's just boring But since we're creating a repository and I know that it's a developer repository I don't have to type this boring part I can just go directly to the properties because panache is assuming if you have a developer repository You're probably curing developer entities. So I can just type. I don't have to tap the from I just can't say well Developer name like and if I'm doing correctly, I hope I can type it correctly Then one Again, I'm going to create Like conkat and the name needs to be another and It's going to return a list So if I did everything correctly, I can go back here to my developer repository and say that well instead of returning Everybody I could add a query parameter And I could say that this parameter is Brazilian It's going to be bullying Brazilian and I'll say that if Brazilian return developer Repository. Oh, I don't have an instance. What do I have to do? Just inject that developer repository at inject So return developer repository dot find the Brazilian Japanese one and if everything is right I can go back here to my browser query again. Yes, it's working. Let's try to add this parameter Brazilian equals to true. Yes, it's returning only myself. So it's working so that's how easy it's for you to use a repository inject the repository and Consume the repository custom methods if you want to so remember that I said that Panache is creating The gathers and sizes for me, but let's get back to the developer and now I have a new requirement I want that all of the developer names should be uppercase Then I can just do get name and return get to uppercase I go here save my file go back here And everybody's already uppercase. Let's try to add another property to my entity I would say that developers also have a Favorite framework Which is Quarkus every these days for everybody. I add this property go back here Now this property is not to show not showing up because the property is Empty if I carry my database You see that favorite framework is no for everybody Let's try to update here my database never do this in production, please an update without worm set favorite framework Equals to Quarkus. I update that go back to my browser and everybody's there But I had now I have another requirement favorite framework should be lowercase for everybody. Well, I don't want to use the defaults Getter that Quarkus is generating for me So let's try to generate another custom getter get favorite framework But this this time I want it to be lowercase I save the file you go back here and Everything is lowercase and how long did Quarkus takes for to do that? Let's go back to my terminal and it's taking approximately 300 milliseconds and to be very honest Most of this time his Quarkus is trying to acquire a JDBC connection to my database But it would you would argue that for a Java application is pretty fast enough Well, not the traditional Java application server that you use it to or any other Java stack Okay, so no if I Understand the question correctly how how to cannot compare from potash repository with spring data JPA for something Okay, well, they're similar. Yeah, I would say that with Yes, you have the same methods that you would have in any repository.  So it's it's basically the same Approach what we don't do and some people might argue Yeah, well, I'm a spring user a spring fan to what you could do like spring a spring data Allows you to type the strings here and just create like custom query methods. That's a reasonable approach We prefer the code and since panache does that you learn that with parkus We validate everything at build time if you just type the string We'll have an error at runtime with parkus You can validate all of this at runtime at build time, for example So you don't run and then see the error like if you have a we're creating for example Gavink in the high the creator of hibernate He's developing and he didn't merge that yet But you're going to be able to validate all of this curious at about build time So before you run your application, you know if the curious are right or wrong and we will other approaches that create the Curious at runtime like spring data. You have to run it to realize that it's wrong Okay, so here you have and quarkus for example has a much Faster feedback loop, so that's one of the arguments But again, it's a matter of taste okay, and I'm targeting that one approach is better than the other I'm just saying that we can validate everything at build time The question here is that we're tying your implementation to panache and JPA is investigation. Okay. Oh, yes, I completely agree. The curious Are all mostly likely JPA compatible because we're adding the front part, but JPA is the specification if you use spring data JPA you're tying yourself to implementation too, so no difference Hibernate is the official JPA implementation Not official the first JPA implementation Okay, so behind the scenes we're using hibernate. We're using JPA. So yeah, it's all standard JPA. Yeah Okay So Yeah, let's try to add some more features to my application So if I just stop here, what can I add but before let's try to do something more interesting I'm going to create another endpoint. Let's call this one remote So let's go back here and try to create a new folder called remote And let's try to create Maybe I'm plugging. I want to use a specific version Because we're releasing a new version of Quarkus every two weeks. So every two weeks we have new features So I want to stick to a version that I've been using before. I want to call this artifact remote Reston point. Yes, please stick to the defaults and go back. Yes. I'm already Good.  Look how host 8080 Yes, it's running. So let's try to build this application. So I want to package this application running the tests Yes, okay, and I generate the artifact took me approximately six seconds Well, most of this time was the running test But if I go to the target folder, you see that Quarkus generated some error defects first one This jar with the jar generated by the Maven jar plugging, okay It's taking four point eight kilobytes and I have the runner jar Which is my executable jar and it's consuming 91 kilobytes of size So you can see Quarkus generated generates very tiny executable jars, and you might be wondering. Let's see if it works And go back here. Yes, it's still working and you might be wanting Oh, it means it's only 90 kilobytes of disk space. No, that's not all if I go back here again You can see that Quarkus also create this lib folder for me And if I go here to my lib folder, I have all of the dependencies required for my application And how much space is it taking it's taking approximately seven point nine megabytes So in less than eight megabytes of disk space, you have this executable application And you might be arguing why didn't I generate a fat jar? Well, we know that in this new cloud native container as serverless word generating fat jars is a very bad idea Because your dependencies don't change that often but every time you package a fat jar You have a different effect where your business of the code, which is like Five kilobytes of side is everything that changed it But you're packaging your dependencies which can be big over and over again So in that container-based word the contemporary cloud native word is much more efficient if using containers You just add your lib folder in a separate layer And you add that your dependency in the late in the last layer So you can cache the lib folder because it doesn't doesn't change that often and every time you're generating a new container A new artifact the only thing that is changing is the last layer You're just five kilobytes of or in this case 90 kilobytes of business application logic So it's this is much more efficient and you might be thinking that oh, it's too hard this container thing I need to generate my Docker files custom Docker files We know that these days everybody wants to play with containers So you don't have to think about what is the best approach for creating these containers We already provide the Docker files for you It's just a matter for you to choose which option do you want and we'll generate the Docker files for you The containers for you. Okay, so we already have the Docker files You all even have the instructions here in the comments How do I build my image and you should be fine? Another feature that I want to show using Quarkus is that we can generate native images for example if you using if you want to use GrauVM to generate Native images if you ever use the GrauVM, you know, it's very complicated for you to generate Native images in any project in fact and naturally most of the projects they don't support GrauVM Because of the restrictions of GrauVM But if you're using Quarkus, it's very easy to generate a native image You just need to go here package and enable the native profile I just enable the native profile and start the compilation So it's gonna take like less than a minute and while it's compiling I want to show another features of Quarkus. Let's try to show some numbers so As I said before Quarkus was created for this new cloud native Cloud Native and serverless and it offers you a container first approach You know that I was worried as a Java developer I was worried that before retiring I would have to learn a new technology because Java wouldn't survive in the next 20 or 35 years But I'm very happy with Quarkus. We've given the Java platform at least another 20 years of Life and why is that in the past five years in particularly? I've seen a lot of developers moving to other technologies For example, Go or Node.js because these technologies were much more suitable for this new cloud native and And serverless word and why is that in this cloud native word? You know that memory became the new goat memory is the most expensive resource in the cloud computing environments and why is that because CPU and network are very easy for you to share over time and Storage disk space became very cheap But with memory if you have like two gigabytes of RAM you're going to pay for that two gigabytes of RAM For the whole time and if your application is consuming 500 megabytes of RAM every time you could But at most for applications on that amount of memory So one of the most important measures that we have these days in this cloud computing world is fruit per megabyte of RAM and Thinking about that Java had a very bad radio with like Java consumes a lot of memory and takes a lot of time to boot up and think These days we're thinking about horizontal scalability We want to be able to spin up a lot of instances when they have a high workload And we want to shut them down when the workload is gone But sometimes if your application takes like two minutes to boot up and then another five minutes to warm up Then you have a lot of requests You start to steam spin up more instances when the Jvms are warm enough the workload is gone. You already lost your request You are already lost your sales or something like that So Java was wasn't the best option for the scenarios And that's why most developers decided to use another other approaches using go or no jazz But what change it with Quarkus? You don't have to wait You can be super fast and super small in any of the options that you have for running your applications So let's try to show you some numbers for a memory conception and we're not talking about Java heap size We're talking about resident size, which is a total amount of memory that your process is consuming at runtime And if you think about that Quarkus if you're using Quarkus of Graviem for a rest endpoint Quarkus is consuming 30 megabytes of RAM if using Quarkus We have hotspot open edged case It's consuming 74 megabytes of RAM and the traditional cloud native stack in the Java word that you're used to it's consuming at least 140 megabytes of RAM to execute a very simple rest endpoints So depending on a scenario so Quarkus can be 10 times smaller actually on average Quarkus is 10 times smaller than the traditional cloud native stack that you're used to Let's try to add some real use case for example JPA Rest plus JPA Quarkus is going to consume 30 45 megabytes of RAM You're using growl if you're using hotspot and open JDK You're going to consume 130 megabytes and the traditional cloud native stack at least 218 megabytes This is for memory size. Let's talk about Time-to-first Successful response some people try to measure a startup time Startup time is not a good measure because what really matters in cloud native words that I'm booting my app application, I want to know how much time does it take to respond successfully to my first request So you might be some other frameworks or applications.  Well When you're servicing delays the first request you're paying the lazy Cost anyway, so the important thing is that how much does my application take to be up warm and Responding quickly to my request If you're using Quarkus for just a rest in point using Gravian it takes 14 milliseconds for you to respond to first request We did some measurements and at in production at runtime. We're as fast and as small as go We have similar numbers go is going to start in the attempts of milliseconds to we start in 14 milliseconds if using Quarkus plus open JDK is going to take 750 milliseconds and The traditional cloud native stacks going to take at least 4.3 seconds to Reply successfully to the first request. Let's try to add some JPA if using Quarkus plus Gravian it takes 55 milliseconds for first request if using open JDK is going to take 2.5 seconds and the traditional cloud native stacks going to take at least 9.5 seconds, so that's how fast and small Quarkus can be at runtime But the question is I understand from traditional and as well as Quarkus point of view how the numbers look like How does it look in terms of if you compare with go or and learn or Node.js kind of application? Okay, first request as well as the start of time Well compared to go we don't have these position numbers because we only compare with We only compared with the Java space But I think that at a keynote burp or for example compared to Node.js Right and with Node.js. It takes like Quarkus is approximately like four times smaller than Typical Node.js application. I don't have the numbers, but it's that's an approximate size and if you in our like known Scientific measurements is also a significantly faster and we've go at least in my experiments. We have similar size and a Response time for the first request go is slightly like five percent smaller and faster But we think it's a very reasonable trade-off if you're using Java because you have a much larger ecosystem, okay? But it's not like unofficial measurements. We try to avoid as much like benchmarking with anything else because Well every time you do some benchmarking you have a lot of a bike shedding So that's why we don't publish like official numbers Okay, and that's what I had to say about Quarks. So if everything yes, my but my build is successful Let's try to run on my machine and see how it behaves. So if I go back here to my target folder, you see that now I have this Binary file which is consuming 20 megabytes of disk space if I try to run this application Yes fire. I want to allow this to run. Yes, it took nine milliseconds to boot up Let's see if it's working And yes, it's still running and if I want to know how much memory it's consuming So I have here and it's consuming 14 megabytes of resident set size What is resident set size? Some people think about just hip size. Well hip size is one of the most important measurements in a Java application But you need to take the hip size the meta space the out of hips disk face The stack size and the thread size to when you add all of that you have the resident set size and in this particular Quarkus application we have a like a six megabytes Hip size have you ever wondered if you would be possible to run a Java application with a six megabyte run hip size or Consuming 40 megabytes of RAM for resident set size It used to be impossible with Quarkus. Yes, we can run it in such a small amount of memory and Respond quickly to the first request in just a very few milliseconds. Okay, you can note to that nine milliseconds to boot up, but I would have to add the The milliseconds required to process the first request Okay, so it's running in native mode. I Want to add some more capabilities to my application. So right now I want to run this application But I want a different port So I'll keep this application running on port 881 Yes Let's test it 881. Yes, it's running. Okay, and it's going to be his lash Hello, so let's try to try to use some type at the rest client approach. So if I go back here to my Original Quarkus application. I want to add more capabilities. So I want to add more extensions Extensions, I want to add the rest clients and For tolerance API. Let's see if I type it correctly. Yes, everything is green emojis for the win So I can open my project. Let's try to open the dev mode. I open dev mode Go back here to my IDE and On the low resource, let's try to add some remote invocation to my new endpoint So if I want to create a type at rest clients, first, I need to create an interface Which is going to hello client. It's going to be an interface and this interface. I need to register a Rest clients and I need to mimic the remote endpoint using my notations on the path is going to be a slash. Hello and For this one, I want a get It's going to produce media type dot. Oops Media type Text playing Public string Say hello Okay, so this rest endpoint this rest client should be good It should be similar to the one that I have remotely. How do I consume that? I can go back here to my hello resource Let's try to create a path called slash remote At get let's try to produce some media type the text plane to public string Hello remote and Now I'm going to consume my hello client. So let's try to inject it I won't inject my hello client interface, but since it's a rest client I need to add another notation at the rest client And I can consume here saying return Hello clients say hello, okay Is it good? Let's try to test my endpoint go back here to local host 8080 Hello Remote and I have an error and why is that I'm created my remote clients But I didn't say to my application. Where is the remote endpoint? I don't know. Where is the server? So how do I do?  I need to say that my com red hat developers developers hello Clients Lash MEP REST Lash URL is going to be HTTP local host 881 and if I type it everything correctly I can go back here and It's working. Yes. It's returning the remote. Hello. What happens if my remote endpoint goes down? It can just stop it go back to my browser and not give me an error Let's try to be more resilient if you ever try to use a Circuit breaking implementation for example his tricks You know that I need to I could be using a fallback. Luckily Microfile provides for run some standard API. So if I go back here I can add like an at fallback annotation. So I'll be using the default circuit breaker values and let's and the fallback methods going to be let's try to be original fallback and As long as I return the same type it should be good return Hello, I'm alive Okay, so I added the fallback go back to my browser refresh Last yes, it's working. What happens if I put my services to run back again? yes, Farrell and Yes, hello, it should be back working remotely or else it was or to the fallback Okay, that's some of the capabilities that I can Show to you with Quarkus and the secret with Quarkus for being so fast Is that Quarkus doesn't do anything at lazy in a lazy way? Actually, we're eager The magic behind Quarkus is not that runtime the magic around Quarkus is at Viewtime and the magic is everything is contained in the Quarkus maven plugging. So if you think about that, there are a lot of There are a lot of things that needs to be done in a runtime where you're booting your Java application You need to do some class path scanning. You need to get your get your metadata You need to use reflection to get at this metadata Then you need to build your dependency graph after you that you need to instantiate your beans you need to process the events and after you did all of that your Application is running and if you think about that all of this information is already available at view time So we thought that's what why can't we do this at view time? Why do we have to pay this cost of initialization every time we run our application? So they marvel the Quarkus maven plugging process all of that in a very fast way You've seen that it takes like just a few seconds to build the application And once you do that, we just optimize the bytecode we streamline the bytecode and one once your Quarkus application is booting we only have to run this thing because everything else is already ready and and Why didn't we create something like Quarkus five ten years ago? Some of the key stark reasons that we've Java six for example Well Java was super slow reflection used to be very slow and still consumes a lot of memory But we Java five was even super slow with just six reflection improved a lot So like reflection became less slow than before so we didn't have time to think about another options Also five years ago from now compiler technology have over a lot so compilers became much more efficient and faster So that's why we were capable of creating Quarkus today So Quarkus does all that at build time. It doesn't leave anything or Does most of the things at build time That's why it's capable of being so fast and also it's a very good match for a Gravian Because Gravian some has some limitations and I said before if you ever tried to compile a project to native using Gravian You know that requires a lot of configuration and most projects doesn't work with Gravian if using Quarkus We did all of the have lifting for you You don't have to configure anything if you're using one of the Quarkus extension. This is the first First set of extensions that was released when we launched Quarkus But every two weeks we released a new version and the community is contributing a lot of new extensions To this set for example after one week of Quarkus Somebody from Latin America decided oh, I want to use database migrations with Quarkus But Flyway doesn't work with Quarkus. Well We could use some help if you could contribute to your own extension So this developer from Latin America he decided to create his own extension He published created publishing on GitHub and on GitHub and is already available on the Quarkus platform That's why if you want to use Flyway with Quarkus Even on native mode you can use that with the platform another common question is that can I use any library with Quarkus? Yes, if you're using Quarkus on hotspot VM But you need to be You need to know that the Quarkus part will be super fast and super small The truth the library that is not Quarkus if it's using reflection very likely it's going to be Consumer more memory is going to be slower Okay on native mode, then you have some restrictions Which I'll be able to explain exactly how does it work and what are the restrictions and how on the next session So the next session in the next session I'm going to talk about how Quarkus work So if you want to know the magic behind Quarkus how we created all of the optimizations What are the limitations of Grau VM and how we overcome all of these limitations? Please stay for the next session, but for now. That's what I had to say about Quarkus and Well, thank you very much and you have any questions. I'm available for some questions currently you have shown some patterns for complex applications such as Portable and send regimens is all those things does Quarkus keeping aside the things of optimization Does keep Quarkus try to address all the patterns in a complex application such as the service discovery all those things Log aggregations client-side discovery on server-side discovery I'm just trying to compare this thing with a spring cloud actually in microservices world So a spring cloud already has a large community behind these they have already at us all the microservices pattern How what value Quarkus is trying to add on there we have On top of these patterns Okay, so yes, for example, how does Quarkus come? I think the question is how caucus can be compared to for example the spring clouds OSS stack. Yeah for Applications. Well, we believe that if you're using Quarkus You have all of the capabilities for creating it to be able to create cloud native applications these days You think about the runtime in which you're deploying your applications For example, Kubernetes won the container acquisition platform world war Everybody all of the vendors are using Kubernetes these days So we think that if a feature is being provided by the platform You don't need to implement that on the application code. Okay, so yes Service side load balancing is going to be provided by the platform for example Kubernetes Yes, we have circuit breaking even though like you have two different operating models You can use secret breaking with your codes I believe that for most application is better to use circuit breaking in the platform, but you can choose both What service discovery also is provided by the platform and Kubernetes what we don't have here At Quarkus for example is client side load balancing Which is from our experience is a feature that like 99 95% of the customers don't really use like client side Load balance. It's very interesting if the latency between your remote endpoints varies between invocations So you can constantly be pinging the ones But if your applications are consuming your services Internally in the same cluster inside your company or you have constant latency between endpoints Server side load balancing is a much better approach Okay, so this is the I think this is one of the features that we don't support At least we don't add with Quarkus, but of course Quarkus is a hundred a hundred percent open source as everything that Red Hat does we would be very happy for example if somebody Contributed something for Rebun or a recur like that Yeah, but there may be chance at certain in complex applications at certain point of time You are struck with our course and you don't have any other choice For example, if I give you an example of the moment microservices is starting in 2013 The first and foremost pattern was this was the service discovery Okay, so you cannot hardcore the URLs all those things in distributed what in your application, right? Oh, no, you would use the most efficient services core mechanism like DNS since ever okay, yeah, but Spring Cloud already gives out of box implementation of such all those patterns And I mean I mean to say it should not be at certain point of time We are saturated with the core cause and we don't have any choice We can't do anything and in Spring Cloud. I think they have a lot of pattern They have large community behind this of course and they're developing from last four to five years this thing and They have all the patterns No, I love Spring Cloud. I'm just saying that everything that they do we can do too like it's a matter It's a matter of choice. I don't want you to oh, no, Spring Cloud don't use info I think both of our valid options. Actually, there are a lot of different use cases which we cover to so I think it's just a matter of choice, right? And if you think about that, it's very good to have choices because Well, you are stuck in a single implementation single provider You only had like one option for developing applications. Now you have more than one one that is super fast and super small and consumes So we have our benefits too Any other question? First of all, thanks for the beautiful talk. I would like to understand what is the strategy How it is doing how it is doing the hot loading the hot reloading. Oh Quarkus The hot reload approach actually is was very easy to implement Because we just monitor the file system every time you change a Java class or a resource for example We just recompile the project stop and start again So there's no magic because Quarkus It wasn't the goal of the project But once the project was running we realized oh Quarkus is so fast. Why don't we add this feature? So that's all we do. We just monitor and restart everything. We don't have any magic. We recompile everything Stop and start again But if you want to know why Quarkus is so fast for compiling and Starring then you have to check the next session or show the magic. Well, it's not magic. It's just very advanced technology Yeah, how do we add more security features like adding rate limiter to the server To the service and running it on the HTTPS and all those stuff Okay, how do I add HTTPS and the security features around that one? Security security features rate limiting and all those stuff or ray limiting. Yeah, okay Yeah, well, we also think that ray limiting is something provided by by the platform SSL. Yes, we have support If you want authentication authorization, we support JSON web tokens key cloak and Last week they added another security implementation. I didn't even check the website. I just saw that there's another option So these are the big features, but rate limiting using you usually is provided by an API management software like throttling rate limiting and all of these policies Yeah, it is just not about the rate limiting Cypher source and the other stuff algorithms that we use For latency or so latency or something? So let's say SSL version 3 so all those stuff. Okay SSL version TLS. Okay TLS. Yes, we support TLS even Even on native mode. Yes We have support for that So it wouldn't be in wouldn't be an issue, but Again, if you're running on top of like Kubernetes Usually usually you can use here, but usually the TLS endpoint terminates on On the on the gateway and not on the internal endpoints, but you can use both approaches. Okay once if you use end-to-end TLS, it's hard to Load balancing the stuff like you have like limited options for load balancing, but we support both options both options And I think we're our time is up. It's a very advanced talk. Okay, but thank you very much


Get wrecked. All right. What's up? Oh my god? How far would we have? I didn't know how quick it was. I could have bloopers. All right. What's up, everybody? Welcome back to the channel I'm evil rabbit. I'm joined here by mk6 who ate my hamster and Christmas all of which I am good friends with in real life We are here on rocket league. I've defined good. Oh, well, that's just rude We're here on rocket league my first time actually hopping into rocket league and giving it a shot big thanks to Christmas for rocket league for the download and We're here and we're gonna probably do really bad because I've never played this before but Should be fun. So we're just gonna hop right to it Okay, okay Christmas Oh, that's that was a oh, I got hamster Oh, no way the boost actually comes out the back of it. Yes, I lost the ball. Where's the ball? While you're in the air, it's that Oh, I got a shot How did I pull that off Don't That was awesome Beginners luck. Oh wow, I just got punted Okay I've never played this game before and Nate. Yep. Thanks for the assist GG GG Damn hamster you guys are getting rekt I like a nice long warm-up period. Oh Not another one. Oh God, I missed. Okay. Thanks, man. Oh Damn. Oh Okay hamster. Hi, we're working together. Are we? Yeah, I'm terrible. No, I got blown up. Oh, okay That's pretty good shot. I Just waited for it. I figured it was gonna be a cluster Do so I get to go to the foot doctor That's so random Then all right.   I'm warmed up. Let's go Dang Better to get it all right Oh I just did that I just literally shot it straight in I hit the wrong button Hey, that was an epic goal though That was that was beautiful. If only you could do it into the proper net That was the proper net Fair point. Oh missed it.  Oh, sorry Oh, what the thank you hamster I just knocked you out No Now you're good. Yeah All right, you tried to block it. That's all that mattered. Dang. That was a good. That was good. That was a good goal hamster Dink Good double tap.  I got a hat trick though.  Oh my god.  I just got a little rabbit in a hat Can't get it. I'm ready. Ha ha.  Good job ahead of myself trick. Oh Thanks, man. Give it. No, that's a straight shot goal for you I'm still getting used to this whole like flipping thing It's it takes it way until you go online. There's no actually hitting the ball with boost in the air Why is this?  Thank you.  I missed that Nope, not in my house Damn nice block. Okay. Oh, oh jeez. Okay. Bye. Thanks, man Ah the oh It's all about the angle man the angle of the dangle I miss it.  I don't have time. I don't know where I'm going You want to hit it off? Yeah, you Wait, how do you change cameras? Oh First why? Well, I didn't know that was a thing I'm assuming you guys all use bulk cam Yeah pretty much I will occasionally get out of it I'll occasionally get out of it just uh to check on you know where I'm aiming for boost, but Hello, hello Yep. Bye. Oh, jeez. Okay. Bye See this would have been so much easier. I was playing it in the hard view Oh, okay. Bye Dang hamster. Oh, no I hit the wrong button Ah clear send Mk and his aerials Hello. Hello. Hi. Oh hamster Oh What happened? Oh, I got that one.  Oh hamster I try getting up behind it Dang it's high now So do you have to push b to her x to flip? No, if I Yeah, double half a flip x is for when you're in the air. Oh See now, I know What will x on the ground is ebra? Uh, yes, that's it Get it out there hamster right behind you. We got this. Oh, hello. Okay Hey, bye Oh, I wasn't lined up That's it. Oh, look at you Dang go hamster That drift though that ebreaker that ebreaker Dang, this game is if you hold it you can kind of slide Top to touch the ball. No one touch the ball. Watch it. Watch. I'm gonna slide around it. Don't touch it. Don't touch it Okay All right, all right, that's fine. All right, that's okay. Cool All right, oh hamsters playing dirty It's fine. It's fine He's going to come straight after me Oh, no, I hope you have those. I hope you could block that That's a nice easy shot for For Nate. I didn't even have to touch it I took out him. Okay Oh He's like cleared the path for Nate We're playing rugby right now Pretty much. Oh fudge. That was a close shot. Bye. Bye. J. Soke Ball is clear. Oh no Oh No The kids demoed Okay. Thank you.   That was an easy goal. Is it tied with one minute left? Oh boy Yeah, well I can happen in one minute in rocket league See this Dang, we just wanted that straight up. Oh We're trying to steal that You're good Oh, well, I can happen in eight seconds. I ran out of boost. So yeah, I can happen in eight seconds, apparently Jesus Oh god. All right. Nope I get it out of there hamster. Oh my Blocks You saw me coming. Actually I did. I was like serious block. Oh, come on I'm waiting for it. Let's go. Let's go. No, no All right, that's fine. I'll take a goal. Oh mk I was right there. I didn't bounce back. Who did I blow up?  Uh, yeah, it was hard. Holy, but Jesus. I wasn't ready for that one Oh, I was I was lined up for a nice shot, too Well, it was uh, I forgot to change the names Well, that was a buddy from tiger kingdom were playing so This is a decent game. I mean Hey, I got do we just want to do another one of those you did We just want to do another one of those and have some fun with it