Mciro Services & Zookeeper
-
Upload
deepak-singhal -
Category
Technology
-
view
147 -
download
0
Transcript of Mciro Services & Zookeeper
MicroServices & ZooKeeper
What is Monolithic Architecture
Complete functionality/Product is in same war file All tables/schemas are on same database
Pros of Monolithic Architecture
Fast development In process latencies Generally good for Small scale. Less expensive.. Easy to manage less servers Ideal when starting a product
Cons of Monolithic Architecture
Co-ordination overhead as team grows All or nothing deploy Long build time
Pros/Cons of Monolithic Database !
Anyone !!
Pros/Cons of Monolithic Database !
Anyone !!
Requirements for Ideal Micro Services
Separation of FrontEnd and backend for example Angular JS Separation of databases..
Do you think there are more pros or Cons with Micro Services ??
Pros of Micro Services
Teams can work independently Releases can go independently If one service goes down that doesn’t mean whole site is down. Cheap commodity servers can be used Can scale almost infinitely
Cons of Micro Services
Network latency serialization-deserialization how to manage transactions co-ordination between services redundancy of data how to keep data in sync esp. when you have no transactions backward compatible with all existing clients because all client might not be changing with
the new release of service. Because it is so modular; dependencies between different services can be really complex...
something similar like calling that many functions.. So we need to make a call judiciously while deciding Micro Services.
Bottom line : Bad for performance as you need to do so much extra work !
Then why to Use Micro Services !!!!!
This is the only solution when you have to scale almost infinitely
How to Develop Micro Service
Formally define Interface.. Make sure only public methods are here.. which u want to expose to your clients. Talk to them before finalizing. It is not advisable to change this interface later.
Do a dummy implementation so that clients can start working on it simultaneously and not blocked because of u.
Design database schema which is self sufficient. Develop your Service Write JUnit for your Service.
ZooKeeper
Why ZooKeeper ! Gives flexibility to manage complex services Gives Load Sharing
Operate Zookeeper from Command prompt
Starting Server : zkServer.sh start Client Connecting : zkCli.sh -server 127.0.0.1:2181 Zk$ help Zk$ ls / Zk$ create /path pathdata [ creates /path directory ] Zk$ ls / Zk$ get /path Zk$ set /path newPathData Zk$ delete /path
Operate Zookeeper via Java
Questions ??