apidays LIVE Australia - Building Business Ecosystems
Building distributed systems on the shoulders of giants
Dasith Wijesiriwardena, Telstra Purple (Readify)
2. I am here because
I have a love hate relationship
with distributed systems.
HELLO
!I AM
Dasith Wijes
@dasiths
dasith.me
3. Modern technology landscape
Unique challenges of distributed
systems
Agenda
Azure Service Fabric
Distributed Application Runtime
(Dapr)Istio Service Mesh
Knative
Recap and Conclusion
5. var myService = new MyService();
var result = myService.GetProductPrice(“abc123”);
6. System running in single process
var myService = new MyService();
var result = myService.GetProductPrice(“abc123”);
7. System running in single process
var myService = new MyService();
var result = myService.GetProductPrice(“abc123”);
8. // var myService = new MyService();
var myRestService = new MyRestService(“192.168.x.x”);
var result = myRestService.GetProductPrice(“abc123”);
9. System running distributed across multiple nodes
var myRestService = new MyRestService(“192.168.x.x”);
var result = myRestService.GetProductPrice(“abc123”);
10. System running distributed across multiple nodes
var myRestService = new MyRestService(“192.168.x.x”);
var result = myRestService.GetProductPrice(“abc123”);
11. System running distributed across multiple nodes
var myRestService = new MyRestService(“192.168.x.x”);
var result = myRestService.GetProductPrice(“abc123”);
12. •Network is reliable
•Latency is zero
•Bandwidth is infinite
•Connection is secure
•Network is homogeneous
Did you assume?
18. Azure Service Fabric
Distributed systems platform
that makes it easy to package,
deploy, and manage scalable
and reliable microservices
and containers.
19. Azure Service Fabric
Distributed systems platform
that makes it easy to package,
deploy, and manage scalable
and reliable microservices
and containers.
22. Azure Service Fabric
• Reliable Services
• Stateful & Stateless
• Reliable Actors
• Persisted state options
• Guest Executables
• Containers
• ASP.NET Core
Programming Models
23. Azure Service Fabric
public interface IHelloWorld : IActor
{
Task<string> GetHelloWorldAsync();
}
Actor Example – C#
Interface
24. Azure Service Fabric
[StatePersistence(StatePersistence.Persisted)]
internal class HelloWorld : Actor, IHelloWorld
{
public HelloWorld(ActorService actorService, ActorId actorId)
: base(actorService, actorId)
{
}
public Task<string> GetHelloWorldAsync()
{
return Task.FromResult("Hello from my reliable actor!");
}
}
Actor Example – C#
Implementation
25. Azure Service Fabric
class Program
{
static void Main(string[] args)
{
IHelloWorld actor = ActorProxy.Create<IHelloWorld>(
ActorId.CreateRandom(),
new Uri("fabric:/MyApplication/HelloWorldActorService"));
Task<string> retval = actor.GetHelloWorldAsync();
Console.Write(retval.Result);
Console.ReadLine();
}
}
Actor Invocation – C#
Sample
26. Azure Service Fabric
class Program
{
static void Main(string[] args)
{
IHelloWorld actor = ActorProxy.Create<IHelloWorld>(
ActorId.CreateRandom(),
new Uri("fabric:/MyApplication/HelloWorldActorService"));
Task<string> retval = actor.GetHelloWorldAsync();
Console.Write(retval.Result);
Console.ReadLine();
}
}
Actor Invocation – C#
Sample
27. Azure Service Fabric
class Program
{
static void Main(string[] args)
{
IHelloWorld actor = ActorProxy.Create<IHelloWorld>(
ActorId.CreateRandom(),
new Uri("fabric:/MyApplication/HelloWorldActorService"));
Task<string> retval = actor.GetHelloWorldAsync();
Console.Write(retval.Result);
Console.ReadLine();
}
}
Actor Invocation – C#
Sample
• Service discovery and
routing
• Availability
• Reliability
• Fault Tolerance
• Auto scaling
29. Distributed Application Runtime (Dapr)
Portable, event-driven
runtime that makes it easy
for developers to build
resilient, microservice
stateless and stateful
applications that run on the
cloud and edge and embraces
the diversity of languages
and developer frameworks.
50. Istio Service Mesh to
Connect, secure, control, and
observe services.
Istio provides behavioural
insights and operational
control over the service
mesh as a whole, offering a
complete solution to satisfy
the diverse requirements of
microservice applications.
Istio Service
Mesh
53. • Developers can focus on adding business value, instead of
connecting services.
• Apps are more resilient to downtime, since a service mesh can
reroute requests away from failed services.
• Performance metrics can suggest ways to optimize communication
Istio Service
MeshElevator
Pitch
https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh
56. Istio Service
MeshElevator
Pitch
var myRestService = new MyRestService(“svc1.ns.local”);
var result = myRestService.GetProductPrice(“abc123”);
• Dynamic service
discovery
• Load balancing
• TLS termination
• HTTP/2 and gRPC
58. Kubernetes-based platform
to deploy and manage
modern serverless
workloads.
Knative components builds
on top of Kubernetes,
abstracting away the
complex details and
enabling developers to focus
on what matters.
Knative
59. Knative
• Focused API with higher level abstractions for common app
use-cases.
• Stand up a scalable, secure, stateless service in seconds.
• Knative is portable: run it anywhere Kubernetes runs, never
worry about vendor lock-in.
• Idiomatic developer experience, supporting common patterns
such as GitOps, DockerOps, ManualOps.
https://knative.dev/
Elevator
Pitch
60. Knative
apiVersion: serving.knative.dev/v1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
namespace: default # The namespace the app will use
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go # Reference to the app image
env:
- name: TARGET # The environment variable printed out by the sample app
value: "Go Sample v1"
Sample Configuration -
service.yaml
61. Knative
apiVersion: serving.knative.dev/v1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
namespace: default # The namespace the app will use
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go # Reference to the app image
env:
- name: TARGET # The environment variable printed out by the sample app
value: "Go Sample v1"
Sample Configuration -
service.yaml
62. Knative
apiVersion: serving.knative.dev/v1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
namespace: default # The namespace the app will use
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go # Reference to the app image
env:
- name: TARGET # The environment variable printed out by the sample app
value: "Go Sample v1"
Sample Configuration -
service.yaml
68. Service Fabric Dapr Istio Knative
• Distributed
systems platform.
• Any cloud, any
vendor.
• Orchestrate
containers or
executables.
• Windows or Linux
clusters.*
• Small community
• Opinionated
programming
model.
• Support for many
languages and
frameworks.
• Extensible
components.
• Runs as side-car.
• Native support for
• Service mesh with
focus on routing.
• Doesn’t enforce
programming
model.
• Fits nicely with
existing container
workloads.
• Serverless model.
• Developer
productivity.
• Higher level
abstraction of K8s.
• Easily configurable
smart scaling.
Recap
71. Presentation template designed by powerpointify.com
Special thanks to all people who made and shared these awesome
resources for free:
CREDIT
S
Photographs by unsplash.com
Free Fonts used:
https://www.fontsquirrel.com/fonts/oswald