SlideShare a Scribd company logo
1 of 63
Download to read offline
From a web application to a
distributed system
How engineering is hard but could be harder without the BEAM
GPad
Born to be a developer with an interest in distributed system.
I develop using many languages like C++, C#, js and ruby. I had fallen in love with
functional programming, especially with elixir, erlang.
● Twitter: https://twitter.com/gpad619
● Github: https://github.com/gpad/
● Medium: https://medium.com/@gpad
CTO & founder of coders51
Web development history ...
Web development history ...
A long a time ago in Galaxy Far Away there was a DB, with some scripts and a
web-server in front of these.
Every request was a bunch of queries on DB and nothing more …
Everything was fine and consistent …
Then …
Today
You have a bunch of services that need to talk to one another.
You need to maintain some state for a time span longer than a http request.
You have more DB (no transaction).
You need to scale.
Why Erlang/Elixir/BEAM
The BEAM
Who came from classic web development, especially with OOP, was trained to:
1. Don’t keep the state in memory
2. Create object/struct during http request
3. Destroy everything at the end
It works!
But ...
But ...
I need to maintain state for more than an http transaction (long operation).
I need to talk/listen to other systems and “react” to these event.
I don’t have a single DB so I don’t have transaction.
I need to keep the connection open and send some data to my “client”.
Evolution ...
Question
How can we create a web application that takes
advantage of the characteristics of the BEAM using
the resources of a single node and eventually scale
to a multi-node application?
Example
Simple e-commerce app where you can:
1. Create users
2. Get products by a third party system
3. Buy some products
4. Pay
Embrace the memory state
Embrace the memory state
We can maintain the state of our app in memory.
In the BEAM world every process is isolated and can keep the state.
Use the DB as the backup of you state.
We can store on it and read from it but don’t use the DB as your state.
Embrace the memory state - Customer
Every customer can be mapped to a process that maintains the state of the customer in
memory and saves it on DB.
If a customer crashes, it doesn’t affect the other customers.
The operation of a single customer is serialized through a single process.
Show me to code ...
Demo!
Embrace the KV pattern
Embrace the KV pattern
We could build our app using the KV pattern.
We could find this “entities” and use the process as boundaries between them.
Every entity should be something that can be executed as a unit.
Every entity should talk to other entities.
The crash of a single entity should affect only a single entities.
Embrace the KV pattern
Use other processes (activities) to interact and keep track of the interaction with other
entities.
Every process can run independently from the others, it can crash and recover to
conclude the interaction with the other entities/systems.
Show me the code ...
UserEntity
Products
Payment
Demo!
Embrace the world ...
Embrace the world ...
With this KV pattern you can “scale” your application horizontally.
Every entity can be “transparently located” inside the cluster.
You can see your application as composed by two different parts: an “application level”
composed by entities and activities and another level “system level” that take care of
distribution.
You should have a “platform” that take care of spinning, move and locate your entities
inside your cluster.
Do you remember something ?!?
Embrace the world - BEAM
The BEAM has “natively” a lot of mechanism to take care of a lot of problems that can
raise from a distributed system.
You can contact a process inside your cluster in a transparently way.
You have a registry (local or remote) that can help you to find an entity (process).
It’s a good solution as a starting point ...
Embrace the world - Library
There are a lot of libraries that can help you in this wide and dangerous world.
riak_core - Now fully managed by community
erleans - Inspired by orleans
lasp - A entire suite of libraries
Show me the code ...
Demo!
Recap
Embrace the memory state - Keep the state of your app in memory and use the DB as
storage. DB is not your App!!!
Embrace the KV pattern - Identify the entities of your app and try to build it as
isolated as possible.
Rule the world - You are running on the BEAM!!!
References
● Thinking like an Erlanger
● Selling Food With Elixir
● To spawn, or not to spawn?
● Life Beyond Distributed Transactions
● Create a riak_core application in elixir
● Erleans
● Lasp
● Repo of the example
Thanks!!!
W la BEAM!!!

More Related Content

Similar to From a web application to a distributed system

The Revolution Will Not Be Centralized
The Revolution Will Not Be CentralizedThe Revolution Will Not Be Centralized
The Revolution Will Not Be CentralizedEdward Faulkner
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices  - microXchg 2017AliExpress’ Way to Microservices  - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017juvenxu
 
Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleSandeep Hijam
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and MicroservicesRedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and MicroservicesRedis Labs
 
Distributed-ness: Distributed computing & the clouds
Distributed-ness: Distributed computing & the cloudsDistributed-ness: Distributed computing & the clouds
Distributed-ness: Distributed computing & the cloudsRobert Coup
 
HLayer / Cloud Native Best Practices
HLayer / Cloud Native Best PracticesHLayer / Cloud Native Best Practices
HLayer / Cloud Native Best PracticesAymen EL Amri
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekDr. Felix Raab
 
Offline of web applications
Offline of web applicationsOffline of web applications
Offline of web applicationsFDConf
 
Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Jan Jongboom
 
JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)jaxLondonConference
 
Technologies for startup
Technologies for startupTechnologies for startup
Technologies for startupDzung Nguyen
 
Becoming a hyperledger aries developer learn things.online
Becoming a hyperledger aries developer   learn things.onlineBecoming a hyperledger aries developer   learn things.online
Becoming a hyperledger aries developer learn things.onlinedjaber3
 
Become a webdeveloper - AKAICamp Beginner #1
Become a webdeveloper - AKAICamp Beginner #1Become a webdeveloper - AKAICamp Beginner #1
Become a webdeveloper - AKAICamp Beginner #1Jacek Tomaszewski
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next GenerationTravis Thieman
 
Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Emmanuel Olowosulu
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Manoj Ellappan
 
Cs121 Unit Test
Cs121 Unit TestCs121 Unit Test
Cs121 Unit TestJill Bell
 

Similar to From a web application to a distributed system (20)

The Revolution Will Not Be Centralized
The Revolution Will Not Be CentralizedThe Revolution Will Not Be Centralized
The Revolution Will Not Be Centralized
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices  - microXchg 2017AliExpress’ Way to Microservices  - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
 
Ob Essay
Ob EssayOb Essay
Ob Essay
 
Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning Simple
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and MicroservicesRedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
 
Distributed-ness: Distributed computing & the clouds
Distributed-ness: Distributed computing & the cloudsDistributed-ness: Distributed computing & the clouds
Distributed-ness: Distributed computing & the clouds
 
HLayer / Cloud Native Best Practices
HLayer / Cloud Native Best PracticesHLayer / Cloud Native Best Practices
HLayer / Cloud Native Best Practices
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
Offline of web applications
Offline of web applicationsOffline of web applications
Offline of web applications
 
Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014
 
JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)
 
Technologies for startup
Technologies for startupTechnologies for startup
Technologies for startup
 
Becoming a hyperledger aries developer learn things.online
Becoming a hyperledger aries developer   learn things.onlineBecoming a hyperledger aries developer   learn things.online
Becoming a hyperledger aries developer learn things.online
 
Become a webdeveloper - AKAICamp Beginner #1
Become a webdeveloper - AKAICamp Beginner #1Become a webdeveloper - AKAICamp Beginner #1
Become a webdeveloper - AKAICamp Beginner #1
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next Generation
 
Raptor 2
Raptor 2Raptor 2
Raptor 2
 
Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1
 
Cs121 Unit Test
Cs121 Unit TestCs121 Unit Test
Cs121 Unit Test
 

More from Gianluca Padovani

Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Gianluca Padovani
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Gianluca Padovani
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Gianluca Padovani
 
DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirGianluca Padovani
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queuesGianluca Padovani
 
La mia prima lezione di pozioni
La mia prima lezione di pozioniLa mia prima lezione di pozioni
La mia prima lezione di pozioniGianluca Padovani
 
Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Gianluca Padovani
 
C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...Gianluca Padovani
 

More from Gianluca Padovani (14)

Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)Beam me up, scotty (PUG Roma)
Beam me up, scotty (PUG Roma)
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)
 
DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves Elixir
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
Beam way of life
Beam way of lifeBeam way of life
Beam way of life
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queues
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
La mia prima lezione di pozioni
La mia prima lezione di pozioniLa mia prima lezione di pozioni
La mia prima lezione di pozioni
 
Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015Keynote meetup Elixir/Erlang 17 ottobre 2015
Keynote meetup Elixir/Erlang 17 ottobre 2015
 
C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...
 
Ferrara Linux Day 2011
Ferrara Linux Day 2011Ferrara Linux Day 2011
Ferrara Linux Day 2011
 
OOP vs COP
OOP vs COPOOP vs COP
OOP vs COP
 

Recently uploaded

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Recently uploaded (20)

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

From a web application to a distributed system

  • 1. From a web application to a distributed system How engineering is hard but could be harder without the BEAM
  • 2. GPad Born to be a developer with an interest in distributed system. I develop using many languages like C++, C#, js and ruby. I had fallen in love with functional programming, especially with elixir, erlang. ● Twitter: https://twitter.com/gpad619 ● Github: https://github.com/gpad/ ● Medium: https://medium.com/@gpad CTO & founder of coders51
  • 4. Web development history ... A long a time ago in Galaxy Far Away there was a DB, with some scripts and a web-server in front of these. Every request was a bunch of queries on DB and nothing more … Everything was fine and consistent … Then …
  • 5. Today You have a bunch of services that need to talk to one another. You need to maintain some state for a time span longer than a http request. You have more DB (no transaction). You need to scale.
  • 7. The BEAM Who came from classic web development, especially with OOP, was trained to: 1. Don’t keep the state in memory 2. Create object/struct during http request 3. Destroy everything at the end It works!
  • 9. But ... I need to maintain state for more than an http transaction (long operation). I need to talk/listen to other systems and “react” to these event. I don’t have a single DB so I don’t have transaction. I need to keep the connection open and send some data to my “client”.
  • 11. Question How can we create a web application that takes advantage of the characteristics of the BEAM using the resources of a single node and eventually scale to a multi-node application?
  • 12. Example Simple e-commerce app where you can: 1. Create users 2. Get products by a third party system 3. Buy some products 4. Pay
  • 14. Embrace the memory state We can maintain the state of our app in memory. In the BEAM world every process is isolated and can keep the state. Use the DB as the backup of you state. We can store on it and read from it but don’t use the DB as your state.
  • 15. Embrace the memory state - Customer Every customer can be mapped to a process that maintains the state of the customer in memory and saves it on DB. If a customer crashes, it doesn’t affect the other customers. The operation of a single customer is serialized through a single process. Show me to code ...
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. Demo!
  • 24. Embrace the KV pattern
  • 25. Embrace the KV pattern We could build our app using the KV pattern. We could find this “entities” and use the process as boundaries between them. Every entity should be something that can be executed as a unit. Every entity should talk to other entities. The crash of a single entity should affect only a single entities.
  • 26. Embrace the KV pattern Use other processes (activities) to interact and keep track of the interaction with other entities. Every process can run independently from the others, it can crash and recover to conclude the interaction with the other entities/systems. Show me the code ...
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. Demo!
  • 52. Embrace the world ... With this KV pattern you can “scale” your application horizontally. Every entity can be “transparently located” inside the cluster. You can see your application as composed by two different parts: an “application level” composed by entities and activities and another level “system level” that take care of distribution. You should have a “platform” that take care of spinning, move and locate your entities inside your cluster. Do you remember something ?!?
  • 53. Embrace the world - BEAM The BEAM has “natively” a lot of mechanism to take care of a lot of problems that can raise from a distributed system. You can contact a process inside your cluster in a transparently way. You have a registry (local or remote) that can help you to find an entity (process). It’s a good solution as a starting point ...
  • 54. Embrace the world - Library There are a lot of libraries that can help you in this wide and dangerous world. riak_core - Now fully managed by community erleans - Inspired by orleans lasp - A entire suite of libraries Show me the code ...
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. Demo!
  • 61. Recap Embrace the memory state - Keep the state of your app in memory and use the DB as storage. DB is not your App!!! Embrace the KV pattern - Identify the entities of your app and try to build it as isolated as possible. Rule the world - You are running on the BEAM!!!
  • 62. References ● Thinking like an Erlanger ● Selling Food With Elixir ● To spawn, or not to spawn? ● Life Beyond Distributed Transactions ● Create a riak_core application in elixir ● Erleans ● Lasp ● Repo of the example