how to become a match maker
for your backend
About• geekdad()
• current("VP Engineering SETIPE”)
• before(['Erafone', 'Wayang Force', ‘Qeon’])
elsewhere ->
@dedenf github.com/dedenf
try our app
ANDROIDsoon!
SETIPE
• A Match Maker
• currently 450k registered users
• Mashed up between (psychology + technology) = #love
• 31 married couple who met at SETIPE
• yang jadian?
+Technology
=Awesomeness
our humble stack
Let’s break it down inside out
Load balancer
Nginx to the rescue
act as load balancer, http proxy
there are other solution, like HAProxy, node-http-proxy …
NodeJS Kue
AppStack
ExpressJS ejs
AgendaMongoJS
Monolithic AppVS
Microservices Architecture
Monolithic App
single codebase call every library on the run
single bug could ruin all your system hard to scale
one request could involved all the system
Easy to managebut
Microservices Architectureseparate codebase
if there’s a bug in a service only that service affected minimal resource
support for event driven arch
Hard to manage
but sometimes…
Distributed system is hot right now
pub-sub
we use it a lotqueue
messaging session store
introducing redis
and we make cluster of it
Matchmaking Engine
we use redis to holds our job queue to matchmaking people
and worker will took care of it
consistency
Eventual consistency is a consistency model used in distributed computing to achieve high
availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated
value.
https://en.wikipedia.org/wiki/Eventual_consistency
99% Consistency is good enough
know your tools- load balancing (haproxy, nginx, …) - webserver (nginx, …) - always use compression - Static assets (CDN)
Monitoring
you can’t optimize what you don’t
measure
things to watch‣is the app running? ‣is the app overloaded? ‣how many errors do we have ‣how your cluster are doing ‣app performance ‣database(s) (this is down to your app perf)
Thank you