My current blog was previously hosted on Godaddy WordPress Hosting and it was due for renewal. From work, I knew about Amazon Lightsail and thought it would be nice for me to migrate my current WordPress blog to Amazon Ligtsail for the below reasons. Amazon Lightsail is provided at a competitive cost and cheaper than my current Godaddy hosting It comes with free static IP and DNS Zone manager UX is superior and easier to upgrade plans Convenient CDN which can be attached easily Use of LetsEncrypt SSL Certs, which wasn’t able to do with Godaddy I followed the official...
Continue reading...Reactive MongoDB with Spring boot
MongoDB has changed a lot over the last few years. I have not used it for more than eight years in production now. I recently need to use MongoDB as a multi-purpose data store. It surprised me a lot with the new features, but I was slightly disappointed with the problems of read and write concerns at default settings. However, you can set it to a majority or a higher level to achieve casual consistency. In this post we are going to cover how to create a spring boot service, connect to Mongo DB with a reactive driver, and perform...
Continue reading...Finding your purpose at work
What is our purpose in life? We all get this question at some point in life and in our profession. As we know, a typical working individual spends at least 1/3rd of our life at the workplace. I was trying to understand my purpose so that I can prioritize and spend my time in areas where I enjoy. I recently attended a leadership training program and was exposed to a methodology called Ikigai, a Japanese life philosophy. I am not going to explain about Ikigai here because it is not a framework to find an individual’s purpose rather live happily....
Continue reading...Encryption as a Service using Vault with Spring Boot
Database columns can be encrypted multiple ways. Most of the databases have built-in support to encrypt the values. For example, in Postgres we can use the function pgp_sym_encrypt and pgp_sym_decrypt. It has some disadvantages like every read/write operation will have some operation overhead and slow down the DB servers. Most of the database providers give an option to encrypt the values. Moreover, keys used for the encryption should be properly managed. And it is complicated to do within the realms of the database servers. In a distributed system, the computing costs should be kept minimal and databases have a very...
Continue reading...Changing HttpClient in Spring RestTemplate
If you’re a Spring boot user, you might have definitely used RestTemplate. If you read the official documentation carefully, you might read that RestTemplate will be deprecated in the future and we must use WebClient which offers Synchronous, Asynchronous and Streaming scenarios such as Server-Sent Events, WebSockets, etc. Majority of the applications in production uses RestTemplates and will be practically a long way before it is completely replaced with Reactive WebFlux. It is important to know how we can customize the RestTemplate changing different Http clients. The default HttpClient used in the RestTemplate is provided by the JDK. It is...
Continue reading...Introduction to Micrometer with Springboot
Springboot and Springcloud has made it easier to develop Microservices in the past couple of years and its usage has increased tremendously. Springboot without Micrometer is like riding a Tesla X without the instrument cluster. Alternatively there are plenty of other tools available to instrument your code to collect metrics and some of them supplied by the metrics aggregators, some are provided by APM vendors and then there is a big gamut of open source projects. When we think about it at the enterprise scale questions like below may arise before choosing the right tool. Where should I place my...
Continue reading...Zuul and Spring Cloud Gateway – Comparison, Benchmarks, LoadTesting
Spring Cloud Gateway and Zuul are different projects from the Spring community aimed to provide a developer-friendly way of writing Gateway services. While a many of the Spring Cloud users aware of the Zuul project, S-C Gateway is relatively framework which Spring Web Flux (Project Reactor) and the new SpringBoot2. You can refer the question which I asked some time ago in StackOverflow for differences. I have been using Netflix’s Zuul for over two years now and I am so far happy with its performance. I am eagerly waiting to see the much-purported Zuul2 which we can expect anytime. But...
Continue reading...Distributed Tracing using Zipkin and Spring Cloud Sleuth
There is a growing trend in organizations to solve everything with Microservices. For a lot of modern-day applications still, a single node monolith is enough and a better choice. Microservices are not a silver bullet which will solve all our technical problems. It comes with its own baggage which has to be taken into consideration and is neatly explained by Martin Fowler here. Increased operational complexity in using Microservices is certainly an area of concern but it is a solvable problem. In order to handle the operational complexity one of the major concern while doing microservices, we need to get...
Continue reading...Reactive Springboot with Spring Cloud Vault
In the previous post, we saw how we can create reactive Microservices using Spring-boot and Kotlin. I want to write this as a series of articles to address various cross-cutting concerns when we encounter during the implementation of Microservices architecture. In this post, we will see about securing our Microservices using Spring Cloud Security and storing the credentials of the service and MongoDB in the Hashicorp Vault and then retrieve them using Spring Cloud Vault. In addition to providing a secure means of storing the credential and tokens in the vault, it gives us the advantage of dynamically serving them...
Continue reading...Developing reactive microservice using Springboot 2
Reactive Spring is based on the project reactor for building non-blocking applications using the spring platform and spring cloud frameworks. Three important interfaces available in Reactor are Publisher, Subscriber, and Processor. Publisher – source of the data Subscriber – One which receives data asynchronously Processor – nothing but a publisher which is also a subscriber (most of the time we won’t need this) Reactor introduces reactive types which implement the Publisher interface namely Flux and Mono. Flux – represents multiple sequences of a result 0…N (many items) which suggests Flux is a standard publisher Mono – As the name suggests,...
Continue reading...