Posts

Flyway in Spring Boot and Gradle: flyway-core vs Flyway Gradle Plugin

 Have you ever wondered about the best way to integrate Flyway into your Gradle project? Let me break it down into two main approaches: using Flyway as a dependency and applying the Flyway plugin . The Dependency Approach: implementation 'org.flywaydb:flyway-core' Adding Flyway as a dependency essentially embeds it within your application. Think of it as equipping your application with a built-in toolbox to handle database changes during runtime. This approach is ideal when you want your application to take charge of migrations. When to Use It Your application needs to manage database changes while it’s running. You’re working with a Spring Boot application that integrates seamlessly with Flyway. Key Features Spring Boot Auto-Configuration: Spring Boot automatically detects the Flyway dependency and configures it. You can custo...

backable book by suneel gupta

Image
  "Backable" by Suneel Gupta explores how to inspire belief in your ideas, combining storytelling, resilience, and practical strategies to succeed.

Use of Sidecars to Microservice Communication

 Recently I attended Analysis Design Architcture conference (https://adaconf.org/) where listened to talk named "Future Proof Software Architecture: Microservices". That reminded me my experience of using sidecars as part of a microservice architecture in one of my previous projects( Australian Bank). So I decided to write down some of the key points and insights that came out of that experience.  firstly, let's start with understanding why we might want to move beyond traditional API gateways. API gateways traditionally handle everything from TLS termination to authentication, authorisation, and traffic routing. They're like the swiss army knife of API management - doing lots of things in one place. But here's the problem - as our microservices architectures grow more complex, having all these responsibilities in a central gateway becomes a bottleneck. So let's see what are sidecars - think of them as your microservice's personal assistant. Instead of rou...

Understanding LLMs in Simple Terms

 Everyone talks about ChatGPT and revolution of GenAI. Ever wondered what powers the chatbot you use or how your favourite AI assistant seems to know just the right thing to say? It’s all thanks to LLM s , or Large Language Models. Let me break it down in plain English and make it easy to grasp. Key things to know about LLMs: Think of them like super-smart text predictors! (imagine writing "Hello, how are..." and it knows to complete with "you"... but way more advanced!) They work like a magical book predictor (they read MILLIONS of books, articles, websites... if you read non-stop, it would take 2600+ years to read what GPT-3 learned from!) Don't expect them to be human-like!!! (they're like a chef who memorised recipes but never tasted food) Cool Metaphors that helped me understand: The Library Detective Has read EVERY book in existence Can find info super fast Connects different facts together (like having the world's smartest librarian at yo...

My Takeaways from 'Why We Sleep' book

Image
I recently got a recommendation to read Matthew Walker's "Why We Sleep: Unlocking the Power of Sleep and Dreams" by a colleague, and I borrowed it from the local library and read. It is a great book and it is the very very interesting book I’ve read this year. It’s completely changed the way I think about sleep and shifted it much higher on my priority list. So I couldn't stop talking about it with my friends > few of them asked me to share some things I learned, so I'm writing below points for anyone to refer. I strongly recommend you to read it.     Key Learnings: What About Memory? Sleep isn't just for rest – it's like a superhero for memory. It helps lock in new stuff you've learnt so you don't forget it the next day. What About Learning? Sleep makes you a learning machine. Rather fascinating how your brain soaks up new skills and knowledge like a proper sponge. What's REM Sleep For? Those wild dreams during REM sleep a...

Principles and Tactics for Working with Language Models (like ChatGPT)

Image
Recently I went through https://learn.deeplearning.ai/, and below is my notes I optimised using chatGPT API :) Introduction: Language models like ChatGPT have become increasingly powerful and versatile tools for various applications. To maximize their effectiveness, it's crucial to understand and implement certain principles and tactics. In this blog post, we will explore the key strategies for working with language models to achieve better results. We will also discuss their limitations and offer best practices for prompting, as well as explore exciting use cases and applications. Principle 1: Clear and Specific Instructions When interacting with a language model, clarity is paramount. To obtain accurate and relevant results, follow these guidelines: Provide longer prompts: Detailed prompts offer better context and understanding to the model. Use delimiters: Separate different sections of input...

Mocking with Spring

Hi folks, Been diving deep into Spring Testing lately, and today I'm sharing my learnings about mocking in Spring. I've noticed many developers struggle with this, so let's break it down in a simple way. What is Mocking? Mocking is our way of creating objects that simulate the behaviour of real objects during testing. Rather brilliant, eh? When testing complex systems, we don't want to call actual databases or external services - that's where mocking comes in handy. A typical Spring test setup with mocking involves two main components: Mockito - the brilliant mocking framework that Spring plays nicely with Spring Test context - Spring's testing support that lets us write integration tests Terminology: What is @Mock? @Mock creates a mock implementation for the interfaces or classes. It's like having a stunt double for you...