Posts

Java - Key Features in Last few LTS Releases

Java - Key Features in last few Long term support release. Java-8 Lambda expression Stream API Date & Time API (java.time) Optional Class for null handling Default & Static Interface Methods Java-11 HTTP Client Standard (For RestAPI call) Local Variable Syntax for Lambda Parameters String Improvements Optional HTTP/2 Client Java-17 Sealed Classes and Interfaces Pattern Matching of Instance of Records Switch - Case expression (Enhanced) Removed Experimental AOT and JIT compiler Java-21 String Templates (Preview) Sequenced Collections Pattern Matching for Switch & Records Virtual Threads Foreign Function & Memory API (Incubator) Java 22 Unnamed Variables & Patterns Statement before super (...) Streams for Primitive Types Statement Templates (Preview) Java-25 Primitive Types in Pattern Matching (Enables pattern matching with primitive in switch and instanceof ) Module Import Declarations (Allow import module syntax for better modularity) Flexible Constructor Bodies (...

REST API Performance Improvement

Key steps to improving Rest API performance: Optimize Database Queries Use indexing effectively Implement query caching Optimize SQL statements Use database connection pooling Implement Caching Strategies Use in-memory caching (e.g. Redis, Memcached) Implement HTTP caching headers Use content delivery networks (CDN) for static contents Compress API Responses Use GZip compression Implement Brotli compression for modern browsers Use Efficient Data Formats Use JSON for most of use-cases Consider protocol buffers or message pack for binary data Implement Pagination Limit the amount of data returned in a single request Use cursor based pagination for large datasets using limit, offset etc. Asynchronous Processing Use message queue for time consuming tasks Implement WebHooks for long-running operations Rate Limiting Implement rate limiting to prevent abuse Use token bucket or leaky bucket algorithms Optimize Network Settings Use HTTP/2 or HTTP/3 Enable Keep-Alive connections Optimize TCP set...

Apache Kafka - Zookeeper

Apache Kafka - Zookeeper Tutorial Topics covered in this article as below: Need of Messaging System What is Kafka? Kafka Features Kafka Components Kafka Architecture Installing Kafka Working with Single Node Broker Cluster 1. Need of Messaging System Data pipelines - Communication is required between different systems in the real-time scenario, which is done by using data pipelines Chat Server -----------Data Pipeline---------------> Database server Many services are communicating with various internal systems like front-end, back-end Api, database server, security system, real-time monitoring, chat server etc. Messaging systems helps managing complexity of above pipelines. so Kafka helps here to decouples data pipelines Key entity involved in Kafka Producer (Publisher) Consumer (Subscriber) 2. What is Kafka? (High throughput distributed messaging system) Apache Kafka is a distributed publish-subscribe messaging system It was originally developed at Linked-In and later became part ...

REST API Caching Methods

Caching is a powerful optimization methods that improves the efficiency, scalability and performance of Rest APIs. It helps reduce the load on database, minimizes redundant computations and speed up response times by storing frequently request data closer to the client or server. 1. Application Layer Caching - Using Redis for Fast data retrieval Store frequently used data at in memory database (Redis) for faster retrieval of data or Quick access Maintain the unique key value identified pair for uniqueness data e.g. : Sample Java program import redis.clients.jedis.Jedis; public class UserService { private Jedis redisClient = new Jedis("localhost"); public String getUserProfile(String userId) { //Check if the user profile exist in the cache String cachedProfile = redisClient.get(userId);      if(cachedProfile != null) {          System.out.println("Cache found!");           return cachedProfile;   ...

SAML & OAuth 2.0

Both SAML (Security Assertion Markup Language) and OAuth 2.0 are widely used protocols for authentication and authorization in web applications, but they serve different purposes. SAML (Security Assertion Markup Language) Purpose: Primarily designed for authentication and single sign-on (SSO) . How it works: A user attempts to access a service provider (SP). The SP redirects the user to an identity provider (IdP). The IdP authenticates the user and sends a SAML assertion to the SP. The SP validates the assertion and grants access to the user. Common use cases: Enterprise applications, government services, and federated identity management systems. OAuth 2.0 Purpose: Designed for authorization , allowing users to grant third-party applications access to their data on a specific service. How it works: A user attempts to access a resource on a service provider. The SP redirects the user to the authorization server. The user grants permission to the application. The authorization s...

What, Why and How PAM (Privilege Access Management) ?

Image
PAM - Privilege Access Management What is PAM? Why is PAM Important? How does PAM works? Benefits of PAM? How is IAM different from PAM? 1. What is PAM? It refers to system that securely manages the accounts of user who have elevated permissions to critical, corporate resources. These may be human administrators, devices, application and other types of users. Privileged user accounts are high value targets for cyber criminals, That's because thy have elevated permission in system, allowing them to access highly confidential information's and make administrative level changes to mission critical applications and systems. PAM is also sometime referred as Privileged account management or Privileged session management (PSM) PSM is actually a components of good PAM system 2. Why is PAM Important? Privilege accounts exist everywhere. There are many types of privileged accounts and thy can exists on-premised and in the cloud They differ from other accounts in that thy have elevated le...

Containerized Applications on AWS

Image
What is container? Containers provide a standard package that allow you to wrap your application, dependencies, and its environment into an executable that can be reliably run anywhere that can host containers.  Now, keep in mind that for this course, when we are referring to containers, we are mostly talking about Docker containers.  Docker is an open platform for developing, shipping, and running applications using containerization. With Docker, you can separate your applications from your infrastructure, so you can deliver software quickly and reliably.            Benefits of containers: Optimization of resource utilization:  You can fit multiple, lightweight containers on a single virtual machine, and increase the efficiency and density of your resources. Automation: The standard packaging and interaction with containers can make it easier to automate software development lifecycle tasks, such as building, deploying, and scaling applicat...

Top 10 Microservices Patterns

Image
Mostly used Top 10 Microservices Patterns: 1] API Gateway Pattern Single entry point for all client requests, which then routes those requests to the appropriate microservice 2] Circuit Breaker Pattern used to handle failures in a microservices architecture when a microservice fails or becomes unresponsive, the circuit breaker tips and redirects requests to a fallback service 3] Service Registry Pattern used to keep track of all the services in a microservices architecture. The registry acts as a central directory for service discovery 4] Service Mesh Pattern that involves adding a layer of infrastructure between microservices to handle cross-cutting concerns such as service discovery, load balancing and security  5] Event Driven Architecture Pattern that involves using events to communicate between microservices. Each microservices can publish events and subscribe to events published by other microservices. 6] Saga Pattern used to manage transactions that span multiple microservic...

Unix - Linux Command - FAQ

Windows: C:\Users\> hostname ABCDE000123   C:\Users\> wmic bios get serialnumber SerialNumber ABCD123 C:\>  ipconfig/flushdns Linux/Unix: $ uname -a Linux oam-ohs 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux   $ hostnamectl    Static hostname: oam-ohs          Icon name: computer-vm            Chassis: vm         Machine ID: adaf69d723c14f179ff541b6d37a350b            Boot ID: 6d090b2d2d104957a5ccfffe178b65ca     Virtualization: vmware   Operating System: Red Hat Enterprise Linux 8.2 (Ootpa)        CPE OS Name: cpe:/o:redhat:enterprise_linux:8.2:GA             Kernel: Linux 4.18.0-193.el8.x86_64       Architect...