SlideShare a Scribd company logo
Distributed systems
Experience and tips
Who am I?
• Senior Software Engineering and Data Engineer
• More than 15++ years of experience
• Had fun with tons of projects with different industries.
• …and I’ve started my career working as a game developer
Why
distribute
d apps?
Distributed systems: design, principles and experiencies
• We use apps and services every day.
• For us, this is software
• We don’t care where they are.
• We don’t care where we are.
• We don’t care when we are using it
• Yep, anytime
• We don’t care which device we use.
• They just work
• For us, let’s say they are somehow distributed
Making
software is
easy
Let’s think a bit
Distributed systems: design, principles and experiencies
How we do tests?
Distributed systems: design, principles and experiencies
Distributed systems: design, principles and experiencies
Quick review on minimal practices
• SOLID:
• S - Single Responsibility Principle: A class should have one reason to
change.
• O - Open/Closed Principle: Software entities should be open for extension
but closed for modification.
• L - Liskov Substitution Principle: Subtypes must be substitutable for their
base types.
• I - Interface Segregation Principle: Clients should not be forced to depend
on interfaces they do not use.
• D - Dependency Inversion Principle: High-level modules should not depend
on low-level modules.
Any software should solve a problem
• And we use code for that. How?
• Architecture.
• Good practices.
• Testing
• Design patterns
• Monitoring
• Standards
• And there is a name for this: software engineering
Distributed systems: design, principles and experiencies
Distributed systems: design, principles and experiencies
Let’s talk about architecture
Let’s talk about architecture
Distributed systems: design, principles and experiencies
And if I’m building a
distributed app, will
be easier, right?
Right?
Why make an app distributed?
• Redundancy
• High availability
• Geographical optimization
• Law restrictions
• Performance
• …
How?
• Deploying same app in different places
How?
• How to scale data?
• Multiple databases
• Sharding
• etc
How? Moving away our monolith
• Moving to services
• Split the app in smaller pieces
• Bounded contexts
• Gateways
• Circuit-breaker
• …and more other patterns
How? Moving away our monolith
• Using a standard communication
• REST APIs
• GraphQL
• gRPC
• Using structures for decoupling
• Publisher / Subscriber
• Queues
• BFF
• Webhooks
Example: REST endpoints
• GET /v1/users
• GET /v1/users/12345
• POST /v1/users
• PUT /v1/users/12345
• DELETE /v1/users/12345
Distributed systems: design, principles and experiencies
Most common HTTP status codes
• 200
• 201
• 202
• 400
• 403
• 404
• 429
• 5xx
Services vs
microservices
Microservices
• Autonomous
• Independent
• Own data system, independent
• If it shares database with other thing it could be fine, but it is NOT
a microservice
• Exposed via standards (HTTP, etc)
Distributed systems: design, principles and experiencies
Netflix example
Microservices
• Big scaled orgs
• Should be autonomous at all levels
• Cultural fit
• It should represent the solution of a scale problem, which
can be technical or human
Your first
distributed
app
Tips and tricks: decision making
• Ask yourself this: why do you need to have the app
distributed?
• If the answer is “no idea”, don’t waste time now.
• If the answer is “someone told me that Netflix does it” let’s
go for a long walking
• If there is a reason, then:
• Redundancy/high availability? Go simple
• Performance? Divide and conquer
• Laws? Do the minimum
Tips and tricks: decision making
• Early optimizations without a reason are expensive
• Early architectural decisions without a reason is a pain
• There is always time to scale and change the things. Market
will tell you.
• But keep in mind: you have to measure the impact of your
decision. We do science, not magic.
Tips and tricks: cultural fit
• Is your company prepared to communicate only with your
services?
• Are you able to integrate/build software against services you
don’t know?
• Can you keep your service updated?
• Can your service be down?
Tips and tricks: API and
communications
• Expose a CLEAR API following standards:
• Use OAuth for authentication
• Expose endpoints you will support:
• Use versioning
• Follow standards
• Define HTTP verbs used
• Define rate limiting
• Define headers
• Prepare a docs explaining your API with examples.
• Ensure your doc can be updated at same time your API does
• Include best practices, how you want your API is used, etc.
• Most important: you and your team should be the first user of your API
Tips and tricks: Deployment
• Define how your app/service/microservice can be deployed
• The infra should be coded (Cheff, Terraform, CLI, whatever)
• Any deployment should be automated
• Can your deployment break other parts?
• Any deployment should support to do a rollback
• Define a strategy for rollback / troubleshooting
• Document new scenarios / cases
• Prepare backups if data needs to be changed
• In most cases, you can live without your app running, but not
without the customers data
Tips and tricks: Monitoring
• Use tools for monitoring your app: Log analytics, Cloud
Watch, Datadog, etc
• Define what is an alert and what to do:
• Create a ticket for handle it
• Define on-call strategies
• Must be able to know what is happening in your app
• And yes, if you want to track multiple services, it is more
complicated.
• In general, be reactive and not passive
Tips and tricks: Scaling
• Analyze and measure what is the scaling need:
• In terms of resources: CPU, disk, memory, bandwidth
• In terms of services: login, catalog, jobs, etc.
• If you have a problem scaling could be a quick solution to
sort the issue, not the real solution.
• Decide what kind and when to scale: horizontal, vertical, etc.
• Add rules to handle scaling: by schedule or by metrics
Tips and tricks: general
• There is no silver bullet for doing a distributed apps
• But there are few good practices that are recommended to
follow
• This is a continuous process, not an end destination. Time
will tell you your needs, problems and limitations.
Distributed systems: design, principles and experiencies
Next: coding
time!
Distributed Systems render farm
tutorial
• Go to https://github.com/khnumdev/dist-app-tutorial and
follow the steps
Ad

More Related Content

Similar to Distributed systems: design, principles and experiencies (20)

Data Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps FundamentalsData Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps Fundamentals
Anant Corporation
 
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
confluent
 
Going Global with Itoc and AWS
Going Global with Itoc and AWS Going Global with Itoc and AWS
Going Global with Itoc and AWS
Mark Promnitz
 
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
confluent
 
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
Nicolas Georgeault
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
Abdul Basit Munda
 
School of Computer & Information SciencesITS-532 Cloud Com
School of Computer & Information SciencesITS-532 Cloud ComSchool of Computer & Information SciencesITS-532 Cloud Com
School of Computer & Information SciencesITS-532 Cloud Com
TaunyaCoffman887
 
Using Machine Learning to Optimize DevOps Practices
Using Machine Learning to Optimize DevOps PracticesUsing Machine Learning to Optimize DevOps Practices
Using Machine Learning to Optimize DevOps Practices
Peter Varhol
 
Why Bad Data May Be Your Best Opportunity
Why Bad Data May Be Your Best OpportunityWhy Bad Data May Be Your Best Opportunity
Why Bad Data May Be Your Best Opportunity
Zach Gardner
 
Introduction to Learning Information Services
Introduction to Learning Information ServicesIntroduction to Learning Information Services
Introduction to Learning Information Services
Psydev
 
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas SuravarapuGraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
Neo4j
 
Kanban testing
Kanban testingKanban testing
Kanban testing
Cprime
 
Microservices - Scaling Development and Service
Microservices - Scaling Development and ServiceMicroservices - Scaling Development and Service
Microservices - Scaling Development and Service
Paulo Gaspar
 
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
ClickTecs
 
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
TriNimbus
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving Microservices
Steve Pember
 
When small problems become big problems
When small problems become big problemsWhen small problems become big problems
When small problems become big problems
Adrian Cole
 
OOSE UNIT-1.pdf
OOSE UNIT-1.pdfOOSE UNIT-1.pdf
OOSE UNIT-1.pdf
KarumuriJayasri
 
Using analytics in ux design my view
Using analytics in ux design   my viewUsing analytics in ux design   my view
Using analytics in ux design my view
Outi Aramo
 
Data Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps FundamentalsData Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps Fundamentals
Anant Corporation
 
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
confluent
 
Going Global with Itoc and AWS
Going Global with Itoc and AWS Going Global with Itoc and AWS
Going Global with Itoc and AWS
Mark Promnitz
 
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
confluent
 
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
aMS Delhi - Are you thinking about building PowerApps on to of SharePoint-Ser...
Nicolas Georgeault
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
Abdul Basit Munda
 
School of Computer & Information SciencesITS-532 Cloud Com
School of Computer & Information SciencesITS-532 Cloud ComSchool of Computer & Information SciencesITS-532 Cloud Com
School of Computer & Information SciencesITS-532 Cloud Com
TaunyaCoffman887
 
Using Machine Learning to Optimize DevOps Practices
Using Machine Learning to Optimize DevOps PracticesUsing Machine Learning to Optimize DevOps Practices
Using Machine Learning to Optimize DevOps Practices
Peter Varhol
 
Why Bad Data May Be Your Best Opportunity
Why Bad Data May Be Your Best OpportunityWhy Bad Data May Be Your Best Opportunity
Why Bad Data May Be Your Best Opportunity
Zach Gardner
 
Introduction to Learning Information Services
Introduction to Learning Information ServicesIntroduction to Learning Information Services
Introduction to Learning Information Services
Psydev
 
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas SuravarapuGraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
GraphConnect Europe 2016 - Faster Lap Times with Neo4j - Srinivas Suravarapu
Neo4j
 
Kanban testing
Kanban testingKanban testing
Kanban testing
Cprime
 
Microservices - Scaling Development and Service
Microservices - Scaling Development and ServiceMicroservices - Scaling Development and Service
Microservices - Scaling Development and Service
Paulo Gaspar
 
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
What is SaaS vs Open Source | Open Source CMS (Content Management System) vs ...
ClickTecs
 
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
Chris Munns, DevOps @ Amazon: Microservices, 2 Pizza Teams, & 50 Million Depl...
TriNimbus
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving Microservices
Steve Pember
 
When small problems become big problems
When small problems become big problemsWhen small problems become big problems
When small problems become big problems
Adrian Cole
 
Using analytics in ux design my view
Using analytics in ux design   my viewUsing analytics in ux design   my view
Using analytics in ux design my view
Outi Aramo
 

Recently uploaded (20)

Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Ad

Distributed systems: design, principles and experiencies

  • 2. Who am I? • Senior Software Engineering and Data Engineer • More than 15++ years of experience • Had fun with tons of projects with different industries. • …and I’ve started my career working as a game developer
  • 5. • We use apps and services every day. • For us, this is software • We don’t care where they are. • We don’t care where we are. • We don’t care when we are using it • Yep, anytime • We don’t care which device we use. • They just work • For us, let’s say they are somehow distributed
  • 9. How we do tests?
  • 12. Quick review on minimal practices • SOLID: • S - Single Responsibility Principle: A class should have one reason to change. • O - Open/Closed Principle: Software entities should be open for extension but closed for modification. • L - Liskov Substitution Principle: Subtypes must be substitutable for their base types. • I - Interface Segregation Principle: Clients should not be forced to depend on interfaces they do not use. • D - Dependency Inversion Principle: High-level modules should not depend on low-level modules.
  • 13. Any software should solve a problem • And we use code for that. How? • Architecture. • Good practices. • Testing • Design patterns • Monitoring • Standards • And there is a name for this: software engineering
  • 16. Let’s talk about architecture
  • 17. Let’s talk about architecture
  • 19. And if I’m building a distributed app, will be easier, right? Right?
  • 20. Why make an app distributed? • Redundancy • High availability • Geographical optimization • Law restrictions • Performance • …
  • 21. How? • Deploying same app in different places
  • 22. How? • How to scale data? • Multiple databases • Sharding • etc
  • 23. How? Moving away our monolith • Moving to services • Split the app in smaller pieces • Bounded contexts • Gateways • Circuit-breaker • …and more other patterns
  • 24. How? Moving away our monolith • Using a standard communication • REST APIs • GraphQL • gRPC • Using structures for decoupling • Publisher / Subscriber • Queues • BFF • Webhooks
  • 25. Example: REST endpoints • GET /v1/users • GET /v1/users/12345 • POST /v1/users • PUT /v1/users/12345 • DELETE /v1/users/12345
  • 27. Most common HTTP status codes • 200 • 201 • 202 • 400 • 403 • 404 • 429 • 5xx
  • 29. Microservices • Autonomous • Independent • Own data system, independent • If it shares database with other thing it could be fine, but it is NOT a microservice • Exposed via standards (HTTP, etc)
  • 32. Microservices • Big scaled orgs • Should be autonomous at all levels • Cultural fit • It should represent the solution of a scale problem, which can be technical or human
  • 34. Tips and tricks: decision making • Ask yourself this: why do you need to have the app distributed? • If the answer is “no idea”, don’t waste time now. • If the answer is “someone told me that Netflix does it” let’s go for a long walking • If there is a reason, then: • Redundancy/high availability? Go simple • Performance? Divide and conquer • Laws? Do the minimum
  • 35. Tips and tricks: decision making • Early optimizations without a reason are expensive • Early architectural decisions without a reason is a pain • There is always time to scale and change the things. Market will tell you. • But keep in mind: you have to measure the impact of your decision. We do science, not magic.
  • 36. Tips and tricks: cultural fit • Is your company prepared to communicate only with your services? • Are you able to integrate/build software against services you don’t know? • Can you keep your service updated? • Can your service be down?
  • 37. Tips and tricks: API and communications • Expose a CLEAR API following standards: • Use OAuth for authentication • Expose endpoints you will support: • Use versioning • Follow standards • Define HTTP verbs used • Define rate limiting • Define headers • Prepare a docs explaining your API with examples. • Ensure your doc can be updated at same time your API does • Include best practices, how you want your API is used, etc. • Most important: you and your team should be the first user of your API
  • 38. Tips and tricks: Deployment • Define how your app/service/microservice can be deployed • The infra should be coded (Cheff, Terraform, CLI, whatever) • Any deployment should be automated • Can your deployment break other parts? • Any deployment should support to do a rollback • Define a strategy for rollback / troubleshooting • Document new scenarios / cases • Prepare backups if data needs to be changed • In most cases, you can live without your app running, but not without the customers data
  • 39. Tips and tricks: Monitoring • Use tools for monitoring your app: Log analytics, Cloud Watch, Datadog, etc • Define what is an alert and what to do: • Create a ticket for handle it • Define on-call strategies • Must be able to know what is happening in your app • And yes, if you want to track multiple services, it is more complicated. • In general, be reactive and not passive
  • 40. Tips and tricks: Scaling • Analyze and measure what is the scaling need: • In terms of resources: CPU, disk, memory, bandwidth • In terms of services: login, catalog, jobs, etc. • If you have a problem scaling could be a quick solution to sort the issue, not the real solution. • Decide what kind and when to scale: horizontal, vertical, etc. • Add rules to handle scaling: by schedule or by metrics
  • 41. Tips and tricks: general • There is no silver bullet for doing a distributed apps • But there are few good practices that are recommended to follow • This is a continuous process, not an end destination. Time will tell you your needs, problems and limitations.
  • 44. Distributed Systems render farm tutorial • Go to https://github.com/khnumdev/dist-app-tutorial and follow the steps

Editor's Notes

  • #2: Remind events and sessions, including UA until this year :/
  • #3: Home computers without internet: only stuff you have installed Dotcom bubble Q: what was the first company to be considerd as SaaS? Amazon case with AWS and rest APIs
  • #4: 2007: iphone release 2010-2015: “transformacion digital” 2018-2022: blockchain and bitcoin >2022: IA