SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Building a cloud with Erlang and
SmartOS
How hard could it possibly be?
Spoiler
Spoiler
Quite hard!
Who am I
• Writing Project FiFo
• Twitter: @heinz_gies
• Github: https://github.com/Licenser & https://github.com/project-fifo
• IRC: Licenser
Disclaimer
• This is time travel! Situations might have
changed by today.
• This is about my experience not the total
truth - yes there is a chance I was double
wrong!
• I don’t want to shame any technology, it is just
about my experience on applying them to a
specific problem.
• No dogs were harmed in the making!
Intro
• What is FiFo? - Open Source Cloud orchestration
• For SmartOS: ZFS, DTrace, Crossbow, Zones, …
• In Erlang: Distributed, fault tolerant, fun to write, …
The fail of Clojure Script
What was done
• CLJS app in GZ
• HTTP API
Reason
• existing client for the API
• node.js was on the GZ (looked like additional deps).
• Wanted to try Clojure Script.
• No idea of what Project FiFo would become.
The problem
• lots of dependencies (version conflicts, missing libraries).
• at that time very hard to debug (no source maps etc., lack of
visibility/horrible stack traces).
• Everything in the Global Zone. (big footprint)
• Only one system
What I learned
• Try to plan what you do before you do it.
• Rewriting is no shame!
• What seems easy in the beginning is not always the right thing.
The fail of a single host
What changed
• Added wiggle,API endpoint over multiple cljs application
• running in a zone
• Allow more then 1 hypervisor!
Reason
• Needed good abstract over the existing code.
• A web interface for the clojurescript code.
• Wanted to work with Erlang.
The problem
• HTTP between wiggle and cljs-app.
• Single point of failure.
• Did not simplify the code on the hypervisor, it just forwarded.
• Still not enough separation.
• Authentication handled downstream in cljs.
• Synchronization is a pain.
What I learned
• HTTP is not the silver bullet.
• Split out applications.
• Modularize (not only in code, but in applications).
• Handle things like authentication as high up as possible.
• Remove work from leaves that should be handled in a different
layer.
The fail of distribution
What changed
• Split out authentication -> snarl
• Split out most logic -> sniffle
• Reduced GZ footprint -> scrap cljs replace by minimal erlang
app
Reason
• Erlang apps are wonderfully self-contained (releases)
• Distributing systems protects against SPOF
• Separating concerns
• management on system
• authentication
• API
• Management of hypervisors
Problem
• Synchronization is really hard
• 1st try: gproc had problems with multiple nodes[1]
• 2nd try: wrapper around grpoc -> had a SPOF
• lots of configuration needed with connecting all the systems
What I learned
• distributed systems are hard, who would have thought that!
• managing configuration is annoying, especially in a multi-node
environment.
• in Erlang land there are great libraries for distribution.
• riak_core rocks!
The fail of storing JSON
Reason
• It’s “easy”, no schema, good library support for serializing and
deserializing
• The fronted/UI used it anyway
• everyone uses JSON, so it must be good right?
Problem
• Choice based on popularity not common sense
• No Pattern matching
• No good libraries to manipulating JSX-JSON
• Verbose and ‘big’
• hard to represent data in Erlang (esp. maps/objects)
• Hard to synchronize/merge (state box[2] is only a partial solution)
What I learned
• Model data around the backend not the front-end
• JSON is no silver bullet, it has the same problem XML had, it is
used for the sake of being used
• CRDT’s are a lovely thing[4]
• Records are not perfect but a very nice storage for structured
information
The fail of CAP
Reason
• riak_core really rocks!
• Eventual consistency is a very tempting concept
• Availability is more important then consistency when managing a
cloud
Problem
• Expect when it is not, like IP assignment, memory constraints on
server :(
• Globally locking those things would break availability
• Not beating CAP anytime soon [3] :(
What I learned
• The more control you have over your data the further you can push the
‘eventual’ in eventual consistency
• Locks don’t have to be global need to just cover enough to ensure consistency
• The locks location matters:
• Hypervisor memory on the hypervisor itself
• IP’s ‘sharded’ over the ring
Links
• https://project-fifo.net
• https://docs.project-fifo.net
• [1] http://christophermeiklejohn.com/erlang/2013/06/05/erlang-gproc-failure-
semantics.html
• [2] https://github.com/mochi/statebox
• [3] http://ferd.ca/beating-the-cap-theorem-checklist.html
• [4] http://aphyr.com/posts/285-call-me-maybe-riak

Contenu connexe

Tendances

Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9Derek Jacoby
 
Clojure slides
Clojure slidesClojure slides
Clojure slidesmcohen01
 
Day 1 - Intro to Ruby
Day 1 - Intro to RubyDay 1 - Intro to Ruby
Day 1 - Intro to RubyBarry Jones
 
Metaprogramming Go
Metaprogramming GoMetaprogramming Go
Metaprogramming GoWeng Wei
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Derek Jacoby
 
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...UISGCON
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With JestBen McCormick
 

Tendances (12)

Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
Do you queue
Do you queueDo you queue
Do you queue
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Clojure slides
Clojure slidesClojure slides
Clojure slides
 
Day 1 - Intro to Ruby
Day 1 - Intro to RubyDay 1 - Intro to Ruby
Day 1 - Intro to Ruby
 
Scalable Open Source
Scalable Open SourceScalable Open Source
Scalable Open Source
 
Metaprogramming Go
Metaprogramming GoMetaprogramming Go
Metaprogramming Go
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
 

En vedette

BayLISA meetup: 8/16/12
BayLISA meetup: 8/16/12BayLISA meetup: 8/16/12
BayLISA meetup: 8/16/12bcantrill
 
Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOSEric Saxby
 
The Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
The Kitchen Cloud How To: Automating Joyent SmartMachines with ChefThe Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
The Kitchen Cloud How To: Automating Joyent SmartMachines with ChefChef Software, Inc.
 
SmartOS ZFS Architecture
SmartOS ZFS ArchitectureSmartOS ZFS Architecture
SmartOS ZFS ArchitectureBill Pijewski
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot SystemAlvaro Videla
 
Experiences porting KVM to SmartOS
Experiences porting KVM to SmartOSExperiences porting KVM to SmartOS
Experiences porting KVM to SmartOSbcantrill
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQGavin Roy
 
Steve Jobs Inspirational Quotes
Steve Jobs Inspirational QuotesSteve Jobs Inspirational Quotes
Steve Jobs Inspirational QuotesInsideView
 

En vedette (12)

BayLISA meetup: 8/16/12
BayLISA meetup: 8/16/12BayLISA meetup: 8/16/12
BayLISA meetup: 8/16/12
 
Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOS
 
The Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
The Kitchen Cloud How To: Automating Joyent SmartMachines with ChefThe Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
The Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
 
SmartOS ZFS Architecture
SmartOS ZFS ArchitectureSmartOS ZFS Architecture
SmartOS ZFS Architecture
 
Taming the rabbit
Taming the rabbitTaming the rabbit
Taming the rabbit
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
 
PostgreSQL: meet your queue
PostgreSQL: meet your queuePostgreSQL: meet your queue
PostgreSQL: meet your queue
 
OpenStack on SmartOS
OpenStack on SmartOSOpenStack on SmartOS
OpenStack on SmartOS
 
Experiences porting KVM to SmartOS
Experiences porting KVM to SmartOSExperiences porting KVM to SmartOS
Experiences porting KVM to SmartOS
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQ
 
SmartOS Primer
SmartOS PrimerSmartOS Primer
SmartOS Primer
 
Steve Jobs Inspirational Quotes
Steve Jobs Inspirational QuotesSteve Jobs Inspirational Quotes
Steve Jobs Inspirational Quotes
 

Similaire à Fi fo euc 2014

Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebPINT Inc
 
Java in High Frequency Trading
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency TradingViktor Sovietov
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Paolo Negri
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social gamesWooga
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
 
Finding Needles in Haystacks
Finding Needles in HaystacksFinding Needles in Haystacks
Finding Needles in Haystackssnyff
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012Eonblast
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling SoftwareAbdelmonaim Remani
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remanijaxconf
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django ApplicationOSCON Byrum
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleChristophe Grand
 
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, EtsyLessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, EtsyLucidworks
 
Lessons from Sharding Solr
Lessons from Sharding SolrLessons from Sharding Solr
Lessons from Sharding SolrGregg Donovan
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 

Similaire à Fi fo euc 2014 (20)

Scalable game-servers-tgc
Scalable game-servers-tgcScalable game-servers-tgc
Scalable game-servers-tgc
 
Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The Web
 
Java in High Frequency Trading
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency Trading
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social games
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Finding Needles in Haystacks
Finding Needles in HaystacksFinding Needles in Haystacks
Finding Needles in Haystacks
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django Application
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit Hole
 
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, EtsyLessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
 
Lessons from Sharding Solr
Lessons from Sharding SolrLessons from Sharding Solr
Lessons from Sharding Solr
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
Optimera STHLM 2011 - Mikael Berggren, Spotify
Optimera STHLM 2011 - Mikael Berggren, SpotifyOptimera STHLM 2011 - Mikael Berggren, Spotify
Optimera STHLM 2011 - Mikael Berggren, Spotify
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
 

Dernier

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Dernier (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Fi fo euc 2014

  • 1. Building a cloud with Erlang and SmartOS How hard could it possibly be?
  • 4. Who am I • Writing Project FiFo • Twitter: @heinz_gies • Github: https://github.com/Licenser & https://github.com/project-fifo • IRC: Licenser
  • 5. Disclaimer • This is time travel! Situations might have changed by today. • This is about my experience not the total truth - yes there is a chance I was double wrong! • I don’t want to shame any technology, it is just about my experience on applying them to a specific problem. • No dogs were harmed in the making!
  • 6. Intro • What is FiFo? - Open Source Cloud orchestration • For SmartOS: ZFS, DTrace, Crossbow, Zones, … • In Erlang: Distributed, fault tolerant, fun to write, …
  • 7. The fail of Clojure Script
  • 8. What was done • CLJS app in GZ • HTTP API
  • 9. Reason • existing client for the API • node.js was on the GZ (looked like additional deps). • Wanted to try Clojure Script. • No idea of what Project FiFo would become.
  • 10. The problem • lots of dependencies (version conflicts, missing libraries). • at that time very hard to debug (no source maps etc., lack of visibility/horrible stack traces). • Everything in the Global Zone. (big footprint) • Only one system
  • 11. What I learned • Try to plan what you do before you do it. • Rewriting is no shame! • What seems easy in the beginning is not always the right thing.
  • 12. The fail of a single host
  • 13. What changed • Added wiggle,API endpoint over multiple cljs application • running in a zone • Allow more then 1 hypervisor!
  • 14. Reason • Needed good abstract over the existing code. • A web interface for the clojurescript code. • Wanted to work with Erlang.
  • 15. The problem • HTTP between wiggle and cljs-app. • Single point of failure. • Did not simplify the code on the hypervisor, it just forwarded. • Still not enough separation. • Authentication handled downstream in cljs. • Synchronization is a pain.
  • 16. What I learned • HTTP is not the silver bullet. • Split out applications. • Modularize (not only in code, but in applications). • Handle things like authentication as high up as possible. • Remove work from leaves that should be handled in a different layer.
  • 17. The fail of distribution
  • 18. What changed • Split out authentication -> snarl • Split out most logic -> sniffle • Reduced GZ footprint -> scrap cljs replace by minimal erlang app
  • 19. Reason • Erlang apps are wonderfully self-contained (releases) • Distributing systems protects against SPOF • Separating concerns • management on system • authentication • API • Management of hypervisors
  • 20. Problem • Synchronization is really hard • 1st try: gproc had problems with multiple nodes[1] • 2nd try: wrapper around grpoc -> had a SPOF • lots of configuration needed with connecting all the systems
  • 21. What I learned • distributed systems are hard, who would have thought that! • managing configuration is annoying, especially in a multi-node environment. • in Erlang land there are great libraries for distribution. • riak_core rocks!
  • 22. The fail of storing JSON
  • 23. Reason • It’s “easy”, no schema, good library support for serializing and deserializing • The fronted/UI used it anyway • everyone uses JSON, so it must be good right?
  • 24. Problem • Choice based on popularity not common sense • No Pattern matching • No good libraries to manipulating JSX-JSON • Verbose and ‘big’ • hard to represent data in Erlang (esp. maps/objects) • Hard to synchronize/merge (state box[2] is only a partial solution)
  • 25. What I learned • Model data around the backend not the front-end • JSON is no silver bullet, it has the same problem XML had, it is used for the sake of being used • CRDT’s are a lovely thing[4] • Records are not perfect but a very nice storage for structured information
  • 26. The fail of CAP
  • 27. Reason • riak_core really rocks! • Eventual consistency is a very tempting concept • Availability is more important then consistency when managing a cloud
  • 28. Problem • Expect when it is not, like IP assignment, memory constraints on server :( • Globally locking those things would break availability • Not beating CAP anytime soon [3] :(
  • 29. What I learned • The more control you have over your data the further you can push the ‘eventual’ in eventual consistency • Locks don’t have to be global need to just cover enough to ensure consistency • The locks location matters: • Hypervisor memory on the hypervisor itself • IP’s ‘sharded’ over the ring
  • 30. Links • https://project-fifo.net • https://docs.project-fifo.net • [1] http://christophermeiklejohn.com/erlang/2013/06/05/erlang-gproc-failure- semantics.html • [2] https://github.com/mochi/statebox • [3] http://ferd.ca/beating-the-cap-theorem-checklist.html • [4] http://aphyr.com/posts/285-call-me-maybe-riak