Friday, September 28, 2018

Micro Services




Microservice is an architecture style which says decompose big application into smaller services later communicate these services together to form larger business application. 

Microservices are autonomous,  Self contained and independently deployable.

The evolution of micro services :

The microservices evolution was greatly influenced by the Quick business demands, Evolution of technologies and Evolution of Architectures in the last few years.

Modern architectures are expected to maximize the ability to replace their parts and minimize the cost of replacing their parts.

SOA is monolithic projects ( single - single) , where as Micro services projects are with decompose based.

What are microservices?

Microservices are not invented rather many organizations such as Netflix, Amazon and eBay successfully used to divide-and-conquer technique to functionally partition their monolithic application into smaller atomic units, each performing a single function.




Learning topics of Micro Services

  • Introduction
  • Principles
  • Characteristics
  • Benefits
  • Ecosystem
  • Relationship with SOA
  • Microservice usecases
  • Microservices with boot

DESIGNING MICROSERVICES

  • Identifying Microservices boundaries
  • Endpoints
  • Synchronous Communication
  • Asynchronous Communication
  • Challenges of Microservices
  • Microservices Capability model


MICROSERVICES CASESTUDY

  • Brownfield Airline Project
  • Brownfield Airline Project
  • Separate DB Schema
  • REST Endpoints
  • MESSAGING Endpoints
  • Communication Styles
  • RabbitMQ Server

The self contained means every microservice should have its own:

  1. Project code
  2. Project libs
  3. Embedded server
  4. JVM
  5. O.S [Alpine Linux, Debian Linux, etc]

Containers :

  • The main advantage of containers are portability.  Easy to portable across dev, test, prod, other machines.
  • Java is portables across all OS.
  • Hibernate is portable across all DBs
  • JPA is portable across all ORMs
  • Webservices having interoperability, 
Note:  Don't run multiple Micro Services in one container.

Eg:

Fare Microservice


Types of Authentications and Authorizations
  • Authentication protects website with the help username/password.
      • Form Based Authentication
      • Basic Authentication
    • Below two are based on web services - and good to use below in microservices.
      • OAuth Authentication
      • JWT Authentication
  • Authorization protects web pages with in website with the help of ROLES.
  • Hashing protects passwords.
  • Digital certificates.
  • API gateway protects end points.



The Twelve Factors

I. Codebase

One codebase tracked in revision control, many deploys

II. Dependencies

Explicitly declare and isolate dependencies

III. Config

Store config in the environment

IV. Backing services

Treat backing services as attached resources

V. Build, release, run

Strictly separate build and run stages

VI. Processes

Execute the app as one or more stateless processes

VII. Port binding

Export services via port binding

VIII. Concurrency

Scale out via the process model

IX. Disposability

Maximize robustness with fast startup and graceful shutdown

X. Dev/prod parity

Keep development, staging, and production as similar as possible

XI. Logs

Treat logs as event streams

XII. Admin processes

Run admin/management tasks as one-off processes

No comments:

Post a Comment

Hyderabad Trip - Best Places to visit

 Best Places to Visit  in Hyderabad 1.        1. Golconda Fort Maps Link :   https://www.google.com/maps/dir/Aparna+Serene+Park,+Masj...