This talk explores why HTTP is not the best fit for a micro-service architecture and how it results in the need for complex cloud infrastructure components. We present a different alternative using Redis pubsub and some other synchronisation facilities of redis. We will present a demo of the simplicity and extensibility of the solution and how it enables the development team focus on the core logic, rather than worry about the deployment, operations and orchestration overhead.
8. ● How do you add dynamic hosts?
● Proxy could Crash?
● How to find Proxies?
● Connection Draining
● Latency+
● Gateway Partitioning
Discovery:
Reverse Proxies
9. Discovery:
DNS Based
● No Port based Information
● SRV is cool
○ No one uses it
● Some Languages don’t obey TTL.
● Health-check remains external
process.
10. Components of Discovery
● Registry
○ Dynamically Configurable
● Registration
○ Clients emit Events
○ Registrar’s sees lack of events
● Health Check
○ Reachability
○ Load
○ Latency
● Load Balancing
○ Client side
○ Server Side
11. ● Server - Side
○ Proxy
○ Haproxy, httpd, consul, nginx etc.
○ ALB, ELB
● Client - Side
○ Netflix OSS
● Algorithm
● Staleness
Load Balancing
○ Round Robin
○ Weighted
Round-Robin
○ Random
○ URL
○ Least Connections
○ Least Traffic
○ Least Latency
○ Recently Used.
24. Load Balancing - Then
NOTIFICATION
SERVER 1
REPLICATED
LOAD
BALANCER
X.Y.Y.Z
?
CALLER
SERVICE
REGISTER
I, AM
HEALTHY?
NOTIFICATION
SERVER 2
NOTIFICATION
SERVER 3
25. Load Balancing : Now
NOTIFICATION
SERVER 2
GILMOUR
MANAGER.NOTIFICATION
NOTIFICATION
SERVER 1
NOTIFICATION
SERVER 3
MANAGER.NOTIFICATION
MANAGER.NOTIFICATION
CALLER
SERVICE
MANAGER.NOTIFICATION
{“NOTIFICATION”: “DATA”}
26. No/Good Load Balancing
● Has Capacity, Will Serve
● Message delivered to one and all
● Fittest node acquires lock first
● No need for Connection draining
43. Asynchronous Caller
func sendLog(engine *G.Gilmour) {
line := "WordCount"
engine.Signal("example.log", G.NewMessage().SetData(line))
line := "Fetching Data"
// err will be not nil, if Message for example.log was not received by anyone.
_, err := engine.Signal("example.log", G.NewMessage().SetData(line))
}
49. Examples: Popular Word Count
Given
● A S3 URL pointing to a file that has (lot of) random text
Goal
● Eliminate stop words from the file
● Find most popular 3, 4, and 5 letter words
● Find these in parallel
50. Output
● Popular 3 letter words: [way, for]
● Popular 4 letter words: [Text, copy]
● Popular 5 letter words: [Blind, blind]
Examples: Weather Aggregation