Skip to main content

Posts

Showing posts from July 25, 2022

What is the difference between IOC and DI?

Inversion of Control (IOC) and Dependency Injection (DI) are related concepts in software development, but they are not the same thing.   IOC (Inversion of control) is the design target intended to achieve between the classes and their dependencies, In other words a class should not create or control the objects it uses, but instead should rely on an external source to provide those objects. This is typically achieved by using a container or framework that creates objects and manages their lifetimes    DI (Dependency Injection) is one of the design patterns used to achieve this target There are other ways to achieve IOC which is subjected to the application  As the name suggests the flow of controls is inverted to improve the performance, maintainability and scalability.   Simply put (DI) is a specific implementation of IOC where a class's dependencies (i.e. the objects it uses) are provided to it by an external source, rather than the class creating or controlling them direc

What are EC2 (Elastic Computing Cloud) placement groups in AWS?

EC2 placement groups are a logical grouping of Amazon Elastic Compute Cloud (EC2) instances within a single availability zone. They allow for low-latency network performance between instances and enable the placement of instances in a physically isolated section of an availability zone, providing a higher level of isolation from other instances and failures. Placement groups are recommended for applications that require high performance network traffic, such as high-performance computing, video encoding, and scientific modeling. When launching a new EC2 instance AWS automatically make sure that the instances are placed interdependently in hardware to avoid any co-related failure Users can setup 3 different placement groups   Cluster, Partition & Spread Cluster :  Places the instances closely in a single availability zone Partition:  Places the instances in logical partitions but not share the hardware Spread:  Places the instances strictly in distinct hardware