 Hello, do you want to develop a Quarkus application using CokeRoachDB as your database? Then this video is for you. Hello, my name is Alex Soto, Director of Developer Experience at Red Hat. And if you want to stay updated with all the content that we are delivering, remember to follow me on Twitter and subscribe to the channel. Okay, let's deploy and create a Quarkus application. To create it, we can go to code.quarkus.io, which helps us to scaffold the application. So the group can be RG Agni. The artifact will change it to development. The build tool can be Maven or Gradle. Let's stick to Maven. And now we need to pick up all extensions for the application. We are going to use JSONB as a marshalling on-marshalling entities. Then we're going to use OpenAPI. Basically, OpenAPI allows us to document all REST APIs using OpenAPI spec, but the cool thing is that comes with smaller UI, which means that we do not need to develop any user interface for this example. Then we're going to use Panache, but not the standard Panache. The Panache that here, the Panache that comes with REST. Okay, so you'll see that it's really easy to implement CRUD application with this extension, because it creates all the endpoints or the REST API endpoints, automatically, for us. And finally, we need to choose the JDBC driver, which in the case of CogroachDB is the Postgre SQL driver, because there is no Cogroach JDBC driver. Basically, Cogroach leverage all these connection things to the Postgre driver. And that's all we can generate. There's another application. Now we can go here, and I can just move this at ZIP to current directory, and then I can unzip it and go to development, and I can start Visual Studio Code. Of course, you could use any other IDE, but in my case, I really like Visual Studio Code, which is really light IDE, and it works pretty well with Java. So let's start developing. I'm going to close all these tabs. I'm going to delete this, because we do not need it at all. And let's create our entity. The entity is a developer, the Java. It's going to be a class. And this entity must extends Panache entity. Basically, what I'm doing here is just creating a developer entity, implementing the active record pattern. So the developer entity is the one who has the insert, the find, the update, the delete method. All of them are implemented here. But also, for example, it contains the auto-generated ID of type long. Then I can just annotate this as an entity. Notice that this entity annotation comes from JPA. So nothing new. It's the same aspect that we've been using for a long, long time, and then I can create some columns. Let's create the first column, which is my name, or the name, basically, and create another column. Notice that this column is, again, a JPA annotation, that it's public in edge. I know that some of you might be wondering why I'm using public fields. The reason is that you can do this. You can reference on all your code these public fields. But then at compilation time, Quarkus changes this public scope to private and creates getters and setters, and change in all your code the fill reference to the getters and setters. So we can just use the public fields without worrying about the scopes. And Quarkus will take care for us at compilation time. Then we've got our developer entity. Now let's create the rest endpoint for creating, deleting, or finding developers. Let's create a new class called developer resource, dot java, okay, let's create it, yeah. And it must be an interface, and this interface must extend Panache entity resource. Let me do this a bit smaller, okay, now. And you need to set the entity that is baking. So it's developer and the ID or the type of the ID of the developer entity, which is long. And that's all. If you check this class, you'll see it's here that implements for us the list method, the get method by ID, the add method, and the date and the delete. So all these operations, all these CRUD operations are implemented by the folder. So before we can deploy this, we need to configure the database. To do that, let's use one snippet that comes with Quarkus extension for Visual Studio Code, which is this one. Now I can choose a Postgre JDBC format because remember that Codegre JDB uses the Postgre driver, then the dbkind is Postgre. The username is root. I'm using Codegre JDB in insecure mode. So the username is root, there is no password, and I can change this to update. So I burn it can create a schema automatically and notice that I remove it password because in insecure mode, there is no password. The last thing before going on, it's changing this port. Codegre JDB runs in another port, which is the 26257, and before we can deploy our application, we need to take Swagger UI and include it. Basically, I want that Swagger UI be also at a production code. So when we are doing Java mini jar or Docker run or whatever, by the full Quarkus disable Swagger UI. Swagger UI only works at depth mode, but if you want to use it at production mode as well, we need to set it always include to true. Now that's all, let's go to my terminal. Now in my terminal, you can see that I've got here my Codegre JDB cluster with three nodes, one, two, and three, and here I've got three terminal windows, each of one has the console to each of the nodes. So this is the node one, this is the node two, and this is the node three. Okay, now, let's compile my application. I mean, while I compile the application, let's create a database that database created a base. I think that it was called myDB. I can just create it. Okay, it says that the red exists. Okay, so I've created before, that's fine. In fact, if I go here, you can see that the databases I've got here myDB and here I've got my three nodes. Okay, now let's deploy the application. Okay, now what's happening is not defined for the full, ah, yeah, remember that I need to change one thing. It's here, I need to add this gdbc. This is something that has been changed in Quarkus on 1.5 that now when you want to specify the URL of the or the gdbc URL, you need to use the gdbc prefix, which I miss it here, but it's important to notice because in previous version, you didn't need this prefix. And now you need it. So if you find this error, you know why. And now, yeah, you can do java.minujar and then it works. And if I go here, you can see that in databases I've got my database and I've got the developer table with, you know, with the age and the name and notice that there is also an ID. This ID comes because of the Panache entity. Now, we are here and I'm going to open the solar UI. Remember that I added the open API extension so now I've got the solar UI interface and notice all these rest endpoint that were generated automatically by Panache by using the rest Panache extension. I can get the developer, post developer, get the developer by ID, put the developer, delete the developer. Let's post a developer. Let's add a new developer. I can just go here, try out. I just remove this. The age is 39 and the name is Alex. Now I can do execute. I can check here the output, notice that Alex has been added. And I think that there was already some developers in the database. So if I go here and I do a tryout and I'm just getting all the developers and I do an execute, you can see that I can get all the developers. Okay, this is one, the age is 39. Alex is the one that I've added right now. Now, really easy. It works perfectly fine, CodeRoadGB with Quarkus in native mode or in JVM mode, it works in both cases. But one of the great things about CodeRoadGB is that it replicates all the data automatically. Notice that I've got three nodes and now I can go to the node one. Notice that here I'm in the node one. I can do host name. Okay. And then I'm saying that I am in the Roach one node. I can do a select from my dv.developer. I think that it's developer. And pop-up pop-up because the developer. And notice that I'm saying that here is Alex. And now notice that I'm changing to another node. This node is the node number two. I can do a select again, my dv.developer. And notice that this is exactly the same data but I've just inserted it to one. And of course, if I go to here and do host name, notice that host name is the third node. And obviously, if I do a select from my dv.developer, you can see that the data is replicated automatically to all the code Roach cluster. So you can see that code Roach dv is your solution, your persistent solution for creating real, real cloud native applications. Of course, this has been only an introduction but in the next videos, we are going to see how to deploy a code Roach dv cluster to Kubernetes. Thank you very much and hope to see you again.