Posts

Showing posts from May, 2022

very brief Introductory notes On Microservices

Image
 This would be mainly some notes I have took 3- years ago when I first read Sam Newman's book building microservices, along with some points gathered along the time since then. Let's start with a definition , what are microservices: These are independently deployable small services build around a business domain.  a little bit of details, These Microservices needs to be: 1- Able to change independently of each other. 2- Be Deployed by  themselves without requiring the consumes to change. 3- All communications between the services are via network calls to enforce separation and avoid the perils of tight coupling. some other Key points to the core of the definitions and introduction: How small is small: a Microservice is something that could be rewritten in around 2 weeks. (I believe this might be debatable or controversial). Another suggestion is that it should be small enough that you can keep the structure in your mind another key notice from Sam Newman, was that it seem...

Liskov Substitution Priniciple

 Just some few points to get back to , since for some reason I keep on forgetting what its intention out of the 5 SOLID principles. Historical intro:  As per  wikipedia  it was introduced by Barbara Liskov  in a 1988 conference keynote that was titled Data abstraction and hierarchy. It was defined as: "Let  {\displaystyle \phi (x)} Ø( x )  be a property provable about objects  {\displaystyle x} ( x ) of type  T . Then  {\displaystyle \phi (y)} Ø(y)  should be true for objects  {\displaystyle y} ( y )  of type  S  where S is a subtype of  T ." So to simplify it a little bit , x here is like an instance or an object of class of type T, this could be a User , Class or Employee Class,...etc. Same Also goes for (y) , it can be an instance of a class of type S. so what Liskov principal states here is that if a certain property/method  ( Ø( x ) ) do exists in objects of type T, then this...

Concurrency vs Parallelism

 This is going to be a brief explanation with resources at the end as usual. I found more than one explanation , will point out to those that I found intuitive and put links to the detailed sources as well. First Example: Consider you have to do some presentation and need to finish  some official papers from a bureaucratic government office as well, there are more than one Possibility : 1- Sequential Execution: you will first finish the task of getting the papers from the government office then do the presentation task. 2-Concurrent Execution: this is when you take your work laptop with you to make benefit of the commute time and the waiting time for different boring bureaucratic procedures while doing the task of getting the papers from the government office. In this case the two tasks are still finished by the same person -you -whereas you interrupted the task of the government office while waiting for your number or for any other procedure and started working on the pr...