A gentle introduction to functional reactive programming highlighting the reactive manifesto and ends with a demo in RxJS https://github.com/AhmedSoliman/rxjs-test-cat-scope
Automating Google Workspace (GWS) & more with Apps Script
A Journey to Reactive Function Programming
1. A JOURNEY INTO REACTIVE FUNCTIONAL
PROGRAMMING
Ahmed Soliman
انميسلدحمأ
2. • CAT Reloaded Co-founder
• Life-long architect, software, and
systems engineer.
• Focusing on systems reliability,
scalability, and clean code.
Conictus
9. • The Internet had 1 billion users.
• Facebook had 5.5 million users.
• YouTube was a new born.
• Netflix had yet to introduce video streaming (2007)
https://medium.com/reactive-programming/what-is-reactive-programming-bc9fa7f4a7fc
11. • The internet has 2.95 billion users.
• Facebook has 1.393 billion monthly active users.
• YouTube has 1 billion users with 6 billions of hours of video/
month.
• Twitter has 270 million users.
• Netflix has 57.4 million digital subscriber with 1 billion
hours of video/month
14. • A set of ideas and principles to manage complexity in the world
of highly responsive, asynchronous, scalable applications.
• The goal of reactive programming is to build responsive, flexible,
and highly scalable applications without managing the complexity
16. • The system responds in a timely manner if at all possible.
• Responsive systems focus on providing rapid and consistent
response times, establishing reliable upper bounds so they
deliver a consistent quality of service.
Responsive
Responsiveness is the cornerstone of usability and utility, but more
than that, responsiveness means that problems may be detected
quickly and dealt with effectively.
21. Responsive in the face of failure!
This applies not only to highly-available, mission critical
systems — any system that is not resilient will be
unresponsive after a failure.
Resilient
26. SHARE NOTHING
• Message-driven architectures are share-nothing by design.
• No shared mutable state between components.
• Avoid single-point-of-failures by partitioning+replication.
27. SCALE UP/DOWN AND OUT/IN
Process 1
Process 2
Machine
Process 3
Process 4
…
Process 1
Process 2
Server 1
Process 1
Process 2
Server 1
Process 1
Server 1
28. LOCATIONTRANSPARENCY
AuthService x = getAuthService(/* local or remote*/)
x.sendMessage(new Login("asoliman", "password"))
• Abstraction over location of components enables you to scale out
and up in the same way.
• The underlying message-passing system should handle all the
plumbing and the optimization for the message delivery
29. • Foundation of scalable, resilient, and ultimately responsive systems.
• Immutable by design
• Loose Coupling
• LocationTransparency
• Concurrency Control
• Everything is a stream of messages
Message-driven
33. • Programming with functions where functions and data are
treated the same way.
• A program is an evaluation of mathematical functions.
• Avoids mutable-data and changing-state.
34. function getEvens() {
var x = 1;
var result = [];
while (x < 10) {
if (x % 2 == 0) {
result.push(x * 2);
}
}
return result;
}