jueves, junio 07, 2018

Spring Boot + Cockroach DB in Kubernetes/OpenShift


In my previous post, I showed why CockroachDB might help you if you need a cloud native SQL database for your application. I explained how to install it in Kubernetes/OpenShift and how to validate that the data is replicated correctly.

In this post, I am going to show you how to use Cockroach DB in a Spring Boot application. Notice that Cockroach DB is compatible with PostgresSQL driver, so in terms of configuration is almost the same.

In this post, I assume that you have already a Cockroach DB cluster running in Kubernetes cluster as explained in my previous post.

For this example, I am using Fabric8 Maven Plugin to smoothly deploy a Spring Boot application to Kubernetes without having to worry so much about creating resources, creating Dockerfile and so on. Everything is automatically created and managed.

For this reason, pom.xml looks like:


Notice that apart from defining Fabric8 Maven Plugin I am also defining to use Spring Data JPA to make the integration between Spring Boot and JPA easier from the point of view of the developer.

Then you need to create a JPA entity and Spring Data Crud repository to interact with JPA.

Also, we need to create a controller who is responsible to get incoming requests, use the repository to make queries to DB and return results back to the caller.

Finally, you need to configure JPA to use the desired driver and dialect. In case of Spring Boot this is done in application.properties file.


The most important part here is that we need to use the PostgeSQL94 dialect. Notice that in url, we are using the postgresql jdbc url form. That's fine, since Cockroach uses the Postgres driver.

Now we need to create the database (customers) and the user (myuser) as configured in application.properties. To make it so, you just need to run cockroach shell and run some SQL commands:


Finally, you can deploy the application by running mvn clean fabric8:deploy. After that, the first time might take longer since needs to pull Docker images, you can start sending queries to the service.

As you can see it is really easy to start using a cloud-native DB like Cockroach DB in Spring Boot. If you want you can do exactly the same as in my previous post and start running queries to each of the nodes to validate that data is available correctly.

Code: https://github.com/lordofthejars/springboot-cockroach

We keep learning,
Alex.
Dôme épais, le jasmin, à la rose s'assemble, rive en fleurs, frais matin, nous appellent ensemble. (Flower Duet - Lakmé - Leo Delibes)
Music: https://www.youtube.com/watch?v=Vf42IP__ipw
Follow me at https://twitter.com/alexsotob



51 comentarios:

sandy dijo...


ان النقل الدولى هام ويحتاج الى مهارة ودقة ليتم على اكمل وجه اعالى الخليج تقدم افضل خدمات النقل الدولى لانها افضل
شركة نقل عفش من الرياض الى الامارات شركة نقل عفش من الرياض الى الامارات
وتوفر ايضا النقل الدولى الى الاردن
شركة نقل عفش من الرياض الى الاردن شركة شحن عفش من الرياض الى الاردن

skan81 dijo...

clinique de chirurgie plastique
reduction mammaire
lipoaspiration
chirurgien esthetique tunisie
chirurgie plastique
chirurgie esthetique tunisie
chirurgie esthetique en tunisie

skan81 dijo...

voiture occasion
discotheque a Paris
discotheque a Paris
voiture vintage

bet paris
entreprise genie energetique
renovation appartement paris
prix ouverture mur porteur
ouverture mur porteur prix

skan81 dijo...

entreprise generale de batiment
Agence Marketing Digital
Entreprise de revetement
VRD
ouvrage d'art

skan81 dijo...

diagnostic de structure
bet structure idf
Maçonnerie paris
bureau d’etudes techniques pluridisciplinaire
Ouvrir un mur porteur

skan81 dijo...

chirurgien esthetique tunisie
photo chirurgie esthetique tunisie
aesthetic tunisia
video chirurgie esthetique tunisie
blog tunisie
referenceur Tunisie

skan81 dijo...


جراحة التجميل تونس
chirurgie esthetique
greffe de cheveux en tunisie
changer les protheses mammaire
reduction des seins tunisie
operation esthetique tunisie

skan81 dijo...

plastic surgery tunisia
chirurgie des dents tunisie
nymphoplastie
dr malek
operation esthetique tunisie
chirurgie esthetique prix

skan81 dijo...

Cirugía estética Túnez
blanchiment des dents en tunisie
couronne dentaire en tunisie
facette dentaire en tunisie
docteur khalfaoui

yanmaneee dijo...

lebron shoes
nike epic react flyknit
nike air max 97
michael kors outlet
retro jordans
moncler outlet
curry 6
air jordan
lebron james shoes
michael kors handbags

sindhuja cynixit dijo...

Thanks for your interesting ideas.the information's in this blog is very much useful for me to improve my knowledge.
Kubernetes Online Training

IMRAN dijo...

I am sure you see the trend here... Commercial Mortgage Financing can be used in practically any industry for any kind of commercial property. Speak with your Business Finance Broker when you are ready to invest in a Commercial Real estate opportunity. finance types

svrtechnologies dijo...

I just loved your article on the beginners guide to starting a blog. Thank you for this article. kubernetes certification training and devops training courses with highly experienced faculty.

Andrew303john dijo...

Economics Assignment Help

We Fullassignment.com is among the best companies on the Economics assignment writing market. We offer top-notch essays, Business Economics Assignment help research papers, thesis and other types of works that can be assigned to you at a high school or college. We also provide Analog Electrtonics Assignment Help from our experts.

https://fullassignment.com/

hrroman dijo...

If you are looking for the Marketing Assignments help then in this case you can opt for our Market Analysis Assignment.we provide the best Assignment Help Experts.We also provide 5c Marketing Assignment for students across the globe. for more information contact us +16692714848.

hrroman dijo...



We Fullassignment.com is among the best companies on the Programming Database and IT Assignments Help writing market. We offer top-notch essays, Online Programming Assignment Help research papers, thesis and other types of works that can be assigned to you at a high school or college. We also provide Java Programming Assignment Help from our experts. for more information contact us +16692714848.

rana07vishal dijo...

A complete list of all the different types of Action games. The Best action new games for playstation and Find latest games , trailer , information , walkthrough and more here at player4life.

Anónimo dijo...

🔥 ☑️MEET THE REAL HACKERS☑️ 🔥

It Tears me Up Whenever we receive complaints from People About Their Experience With the Hackers They Met Before They Heard about us.
These Days There Are alot of Hackers Online, You Just Have to Be Careful about who you meet for help, because many people now don't really know who to ask for help anymore but there is an actual solution to that which I am giving you for free, Trust Me You Don't Wanna go out there seeking for Hackers Yourself, Because the probability of getting a Real Hacker Out there Is Very Slim . ❌❌ ❌ Most Of Them are actually not who they say they're, they are just out there to Rip people Off, Trust Me You Don’t Wanna Risk It. You Can Always Identify Them With Their False Advertisements and False Testimonies Trying To Lure you Into their Arms, And most of them use yahoomails, gmails and other cheap email providers which could easily expose their vulnerabilities, Please Don’t Fall For Them🚷 Come To Think Of It, Why would a Legit Hacker Be using a gmail or a cheap email provider that exposes his vulnerabilities????⚠️⚠️⚠️
Well, Our Purpose Here Is To Link You Up With Top Notched Legit Hackers With Great Online Reputations and Impressive LinkedIn Profiles That’ll Blow Your Mind. Trust Me, You Don’t Wanna Miss This Great Opportunity.

🔥 ☑️ COMPOSITE CYBER SECURITY SPECIALISTS are the Answers to your PRAYERS . We are here to Provide you with The BEST and FASTEST Hackers that would get your Job Done as Fast as possible. 🔥 🔥


☑️All our Specialists are well experienced in their various niches with Great Skills, Technical Hacking Strategies And Positive Online Reputations And Recommendations🔘
They hail from a proven track record and have cracked even the toughest of barriers to intrude and capture all relevant data needed by our Clients. 🔥 🔥

We have Digital Forensic Specialists⚡️, Certified Ethical Hackers⚡️, Software Engineers⚡️, Cyber Security Experts⚡️, Private investigators and more⚡️⚡️. Our Goal is to make your digital life secure, safe and hassle free by Linking you Up With these great Professionals such as JACK CABLE, ARNE SWINNEN, SEAN MELIA, DAWID CZAGAN, BEN SADEGHIPOUR And More. These Professionals are Well Reserved Professionals who are always ready to Handle your job with great energy and swift response so that your problems can be solved very quickly.
All You Need to Do is to send us a mail and we’ll Assign any of these specialists to Handle your Job immediately. ⚡️⚡️⚡️

☑️ Below Is A List Of Our Major Services:
▪️ FUNDS RECOVERY ON BITCOIN SCAM, INVESTMENTS, BINARY OPTIONS TRADING and ALL TYPES OF SCAMS.
▪️ WEBSITE AND DATABASE HACKING 💻
▪️ CREDIT REPAIR. 💳
▪️ PHONE HACKING & CLONING (giving you 📱 Unnoticeable access to everything Happening on the Target’s Phone)
▪️ CLEARING OF CRIMINAL RECORDS ❌
▪️ SOCIAL MEDIA ACCOUNTS HACKING 📱
▪️RECOVERY OF DELETED FILES 📤
▪️LOCATION TRACKING 📌
▪️BITCOIN MINING ⛏ And lot More.

✅ COMPOSITE CYBER SECURITY SPECIALISTS are Basically the ANSWERS to your PRAYERS. Trust Me, You Don’t Wanna Miss Out This Great Experience.

📩CONTACT US TODAY:
Email:
composite.cybersecurity@protonmail.com

🔘2020 © composite cybersecurity specialists
🔘Want faster service? Contact us!
🔘All Rights Reserved ®️










































Whole Sales King dijo...

Very nice Article I love it and want to share with my friends
Artificial turf supplier Saskatoon

robin.smithsters dijo...

If you are wondering how to Grow My Grade, you are just a click away from awesome learning documents like Fundamentals Of Cost Accounting 5th Edition Test Bank make the best deals on test banks and solution manuals right now with our assistance.

Okseoabhinav dijo...

Thank you very much for giving space to us to express our feeling and thoughts about above information. I think you will keep updating and changing these information time to time if there is need to change.
best accounting company for small business, international taxation consultant, Ind AS in India , read more , internal auditing assurance consulting india, accountant service.

coloktogelonline88 dijo...

Coloktoto merupakan Salah satu Agen Togel Terbaik Di Indonesia dengan menghadirkan berbagai macam Bonus Terbesar Bagi para member setia, dan para member baru yang ingin bergabung dengan agen judi tersebut. Yang Pasti Mempercayakan Coloktoto Sebagai Partner Bertaruh Anda, Adalah Pilihan Yang Tepat Karena Kami Akan Membantu anda meraup Keuntungan.

Payal Singh dijo...

Our Call girls in Mahipalpur are well trained and are available 24/7 for 5 Star hotels. In case you don’t want to spend time with them in your hotel room and would like to prefer another place well then not to worry you are most welcome to contact us as we will arrange the place for you.

Kavita Sharma dijo...


____???????
___??????????
___?????????????
___????????????
__?????????????
_?????????????
_?????????????
_??18+ Channels????
??????????????????????
????????18+Channels ??????
??????????????????????????
_??????__????????????????
___????____?????????????
___????_____??????????
___????_____??????????
____????____??????????
_____???____?????????
______???__??????????
_______??????????????
________??????????????
_______???????????????????
_______?????Indore Escorts ????
_______?????????????????????????
_______???????????????????????????
________??????????____?????????????
_________????????_______???????????
_________????????_____???????????
_________???????____??????????
_________???????_??????????
________???????????????
________????????????
________??????????
_______?????????
_______??????
______??????
______??????
______??????
______?????
______?????
_______????
_______????
_______????
______??????
_____????????
_______|_?????
_______|__??????

Riya Rai dijo...

Our Dwarka Escorts Girls will give you 100% love fulfillment and take your breath away with their amazing love position and performance on bed. Our Dwarka Escorts girls have a most charming body and figure that will cheer up your heartbeats and mind thoughts.

Call girls in mahipalpur dijo...

Delhi Call Girls Agency, we are one among the various escort organization providing food young ladies for sexual administrations in Delhi and NCR. Our administrations are expanded all over Delhi and edges. We keep up unmistakable class of young ladies at all the majority of noticeable districts of the Delhi to guarantee our customers immediate and wanted administrations. Our Call Girls in Delhi are best class of young ladies giving extreme joy and furthermore moving message to not to surrender except if you achieve your point. Our Escort Service in Delhi attempt to change viewpoint towards life however yes they show the procedures to appreciate life and grin against the odd of life. Likewise become familiar with the procedures to make meeting more acceptable and interesting with escort young ladies.

Call girls in mahipalpur dijo...

We are related with qualified, taught proficient and elegant escort young ladies so you can invest a decent energy with these Call Girls in Mahipalpur. Our youngsters can offer their organizations at five-star lodgings, four-star motels or three-star hotels too yet in case you moreover need organization at your home they can even come there as well, they can come and visit you seven evenings each week holding up the early hours of the sunrise generally advantageous and real administrations. So Guys view our best choice of world Escort Service in Mahipalpur benefits, and connect with our telephone chief and request the best young lady chose by you from our image display. We are even accessible in a wide zone of Delhi-NCR for our administrations.

Call girls in mahipalpur dijo...

This is the best escort services in Connaught Place may be gainful for you on the off chance that you are looking for a mindful female partner. We give prominent call girls in Connaught place for your happiness and ravishment. In the event that you're remaining in any lavish lodging close to Connaught Place, selecting an escort young lady may upgrade your delight. We have an incredible assortment which includes a scope of alternatives so you can pick what sort of young lady makes your day. These Escort Service in Connaught place have assumed control over the holy messengers and appear to be an impression of prostitutes. There is a ton organized your delight, for example, extravagance bars and clubs where you can meet with complex females of the town. Indeed, you would happy to realize that a large number of the esteemed women of metropolitan zones of Delhi are our regarded bunch individuals. You can get one of them by calling @ 9654120218.

Call girls in mahipalpur dijo...

Call Girls in Paharganj: - We are the unparalleled rumored accompanies administration in Paharganj from most recent couple of years. We have the Call girls in Paharganj from any remaining areas. Our Call young ladies in Paharganj are sought after for the voyagers, outsiders and many businessmen's. You can get easygoing gatherings with hot young ladies whenever they are likewise the craving to meet you. In the event that you are feeling desolate and searching for a delightful partner who can give all your necessities, at that 000int you are continuing immediately. We can orchestrate a calm sentimental date for you with our Paharganj Escorts the help is open all day, every day for you. We have a huge assortment of young ladies to settle on your longing and decisions complete. Our escorts organization currently turns into a top decision for everybody and this on account of our quality help to customers. Escorts Service in Paharganj is consistently accessible at your support of offer you the best Escorts joy in Paharganj.

Ankita Tiwari dijo...


CALL GIRL IN KOLKATA
ESCORT SERVICE IN KOLKATA

Ankita Tiwari Kolkata Escort Service In Call Girl dijo...


SEALDHA INDEPENDENT ESCORTS
SEALDHA INDEPENDENT ESCORT

Simran Sharma dijo...


KOLKATA FEMALE ESCORTS
KOLKATA HOTEL ESCORTS

Gurgaon Escorts Service dijo...

I want to be your naughty little girlfriend, come out of the routine in a nice way with me. My sex gets wet as you take me hard by my hips, I want to feel your sensual virility. I like spicy sex, our encounter will be a delight, you will not forget me.
Gurgaon Call Girl
Gurgaon Escorts
Delhi Escorts

Gurgaon Escorts Service dijo...

Put your routine aside and come enjoy pleasant moments with me. It will be a real pleasure for me to treat you like a king and satisfy your warm desire. My service is very relaxed and I totally immerse myself in my meetings.
Escorts Service in Gurgaon
Call Girls in Gurgaon
Escorts in Huda City Center
Aerocity Escorts
Mahipalpur Escorts

soniya dijo...

Hey guys, I am your perfect company, you will love my service, we will have pleasant moments together. I am a delight in bed, I love to give pleasure and spend warm and pleasurable moments with guys like you.
Delhi Escorts
Delhi Call Girls
Escorts in Saket
Gurgaon Call Girls
Mumbai Escorts
Call Girl in Jaipur
Mumbai Call Girls

soniya dijo...

I want you to enjoy me and have a rich time with a good sex that you will surely love. I'm a delight in bed, I'm sure you'll enjoy my company a lot. I'm going to do it in a way that's going to drive you crazy and make you want to come back.
Escorts in Gurgaon
Kolkata Escorts
Escorts in Jaipur
Hyderabad Escorts
Bangalore Escorts
Escorts in Goa

Call girls in mahipalpur dijo...

Are you guys exploring modern, impressive Delhi Escort Service in Delhi? We questioned this because we are suitable for conducting premium class and pretty Delhi Call Girls for your satisfaction. If you've got been lonely for an extended time, so some time has begun. We are here to supply the foremost essential services in Delhi to you. Yes, we are talking escort services in Delhi, which has imperialism of the cutest girls within the city. We penetrate the intensity of your heart to watch your wants, and this is often what keeps us better to the remainder of others. it's difficult to be alone during this exotic city of the state .
Call Girls in Delhi could be a far better choice for a few space for spending class time and enjoying romantic dates. the foremost satisfying part is that these expert love-makers are accessible at rock bottom rates. If you're looking for entertainment here, so what might be better than selecting an escort girl in Delhi?
https://delhiescortsnearme.blogspot.com/2021/04/cheap-rate-escort-service-in-delhi-any.html
https://sites.google.com/view/escortdelhi/home

Call girls in mahipalpur dijo...

Welcome to the destination of life describing it's never complete without a partner. every one should have some needfulness of a partner in their life. a number of the lads are lucky they need more friends and that they are proud of their needfulness. But there are many that have the aim to still found their final destination. Welcome to the planet of the incredible lifetime of Call Girls in Mahipalpur. You’ll have your true companion for any event you've got within the world. Our Mahipalpur Escorts provides an entrancing choice for a high-quality time during a city of sovereign people.
Escort Service in Mahipalpur were making real-time opportunities to supply a magical companionship for the critical phase of the meeting. Now, brooding about the premium escorts service, enjoy the creamy Mahipalpur Escorts Service with our female escorts. you'll feel the important joy of companionship which may offer you perfect happiness and privacy. We are covering each and each aspect to gratify your needs.
https://mahipalpurescortaerocity.blogspot.com/2021/04/Charming-escort-services-in-mahipalpur.html
https://sites.google.com/view/escortconnaughtplace/home

Call girls in mahipalpur dijo...

After browsing a true tedious work schedule on day to day , men would have the natural wants for a few kind of relaxation and happiness. it's very obvious that the women having the glamorous appearance and desirability would be ranking within the higher position compared to the standard individuals within the list. Such is that the case with the women performing at our agency and therefore the time spend under their guidance is actually fascinating enough to quench the lusty matters of men. Independent call girls in Connaught place is understood to be the foremost intriguing experts being the perfect choice for in call also as outcall mode of services.
It would be very easy and cozy to possess these enchanting hotdog babes in your arms as they're highly cooperative in nature and behavior. There would be few loss incurred by the purchasers to possess these ladies involved in Escort Service in Connaught place as their intimate partners who have the capabilities of providing the utmost level of erotic entertainment.
https://escortconnaughtplace.blogspot.com/2021/04/Call-girls-in-Connaught-Place.html
https://sites.google.com/view/call-girls-in-connaught-place/home

Call girls in mahipalpur dijo...

The girls are entertaining and sparking they skills to charge your body. They like to entertain new peoples who are affected by a stressful life. all of them wish to provide you with the pleasure of a high level. we offer you together with your choice and desirable Escorts in Paharganj for the acute sex. Our agency has many Call girls in Paharganj who are from a special community. a number of the women are a university student, busty ramp models and therefore the hot housewives who are trying to find hardcore sex.
The girl will satisfy your sexual needs and take you the peak of utmost pleasure. all of them girls love, to be frank, or close with strangers, they not want to waste time with an uneventful life and she or he loves the thrills of the sexual comrade. Our Escorts Service in Paharganj are highly qualified and well mannered, you'll also get her for the occasions and therefore the parties.
Click here > > paharganj escort

https://escortspaharganj.blogspot.com/2021/04/Escorts-Service-in-Paharganj%20.html
https://sites.google.com/view/call-girl-in-paharganj/home

bandar togel online dijo...

live draw sdy

gamelantogel dijo...

gamelan togel

world wide escorts directory dijo...

I am a super discreet woman when it comes to reaching the place of our meeting.
Escorts Service
Call Girls

https://escortservicenoidancr.blogspot.com dijo...

It is sure that we are exceptional than other call girls in Bangalore and Goa.
We offer the number of services in a roof that will help you to get the maximum services at once.

Call Girls In Goa
Call Girls In Bangalore

Ninja Turtle dijo...

click on one of the sites below to get a variety of the best tips and tricks in life.

data sydney

Ninja Turtle dijo...

click on one of the sites below to get a variety of the best tips and tricks in life. data pengeluaran togel

Ninja Turtle dijo...

click on one of the sites below to get a variety of the best tips and tricks in life.

pengeluaran bullseye

agen togel terpercaya

RG dijo...

result togel hari ini Result Togel Hari Ini adalah situs khusus yang selalu menyediakan beberapa daftar result nomor togel , yang menayangkan berbagai angka keluaran togel terlengkap. semua hasil angka keluaran nomor yang di tayangkan adalah asli dan benar keasliannya dan sangat akurat dari setiap website official yang sesuai dengan pasaran tersebut.

Agen Togel Online dijo...

Data baru pengeluaran hongkong atau yang disebut data hk merupakan hasil keluaran nomor togel Hongkong terbaru yang hasil keluarannya diambil dari situs hongkongpools.

Masashi dijo...

Good site, hopefully useful for all webmasters, and thank you for joining and commenting on your comfortable site.
Bocoran Hk

bamgosoowm dijo...

I am impressed with this website, really I am a big fan.

my web page; 안마