Posts

Enterprise Design

  Pattern: Saga  https://microservices.io/patterns/data/saga.html Pattern: Transactional outbox https://microservices.io/patterns/data/transactional-outbox.html Multi-Tenant Architecture https://www.gooddata.com/blog/multi-tenant-architecture/ CQRS https://medium.com/@jpssasadara1995/cqrs-pattern-49fa3fafc825 https://waytoeasylearn.com/learn/cqrs-pattern-performance/ The Catalog of Design Patterns https://refactoring.guru/design-patterns/catalog https://waytoeasylearn.com/learn/cqrs-pattern-performance/ SN :  https://www.se.rit.edu/~swen-383/resources/RefCardz/designpatterns.pdf          https://mcdonaldland.info/files/designpatterns/designpatternscard.pdf

AWS Networking & IAM

Image
SN :  https://drive.google.com/file/d/1qBOFXGed_4v01WX8wG73mMF0yeJ0Putu/view?usp=drive_link                          AWS LB & Route53 https://towardsaws.com/network-in-aws-route53-vpc-bbf18a2ab054#:~:text=Route%2053%20is%20used%20for,user's%20location%20or%20other%20criteria.                                                              AWS IAM https://awsfundamentals.com/blog/aws-iam-roles-terms-concepts-and-examples#heading-aws-identity-center-and-federation

When to Use Immutable vs. Mutable Data Structures in Java

  When to Use Immutable vs. Mutable Data Structures in Java Choosing between immutable and mutable data structures depends on the specific use case, performance considerations, and how the data will be used. 1. Immutable Data Structures Immutable data structures cannot be modified after creation. If you need to "modify" them, you create a new instance instead. When to Use Immutable Structures? āœ… Thread Safety → No race conditions or concurrent modification issues. āœ… Safe Sharing → Can be safely shared across multiple parts of the program. āœ… Predictability → No accidental modifications. āœ… Cache-Friendly → Can be safely cached without worrying about changes. Examples of Immutable Structures Immutable Records (Java 14+) javaCopyEditpublic record Person(String name, int age) {} public class Main {     public static void main(String[] args) {         Person person = new Person("Alice", 30);     ...

Optimistic vs. Pessimistic Locking in Spring Boot & JPA

  Optimistic vs. Pessimistic Locking in Spring Boot & JPA https://medium.com/@jpssasadara1995/optimistic-vs-e21af7c31de3

@Primary In Spring Framework

 @Primary In Spring Framework @Primary @Bean (name = "jdbcMainNamedParameterJdbcTemplate" ) public NamedParameterJdbcTemplate namedParameterJdbcTemplate () { return new NamedParameterJdbcTemplate(dataSource()) ; } @Bean (name = "jdbcMainNamedParameterJdbcTemplateForReplica" ) public NamedParameterJdbcTemplate namedParameterJdbcTemplateForReplica () { return new NamedParameterJdbcTemplate(dataSourceForReplica()) ; In Spring Framework, @Primary is an annotation used to indicate a primary bean when multiple beans of the same type are present. When you have more than one bean of the same type, Spring needs to know which one to inject where. The @Primary annotation tells Spring that a particular bean should be given preference when there are multiple candidates. In your code snippet, you have two beans of type NamedParameterJdbcTemplate : jdbcMainNamedParameterJdbcTemplate jdbcMainNamedParameterJdbcTemplateForReplica Both beans are of the same type, so if you in...

Protocol Buffers with Java & Gradle

Image
 

Design Patterns

Image
  Best  =>  https://refactoring.guru/design-patterns/catalog Cheat sheets => designpatterns.pdf                                                                   designpatternscard.pdf