SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Clojure slides
Clojure slidesClojure slides
Clojure slides
mcohen01
 
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
Владимир Стыран - Пентест следующего поколения, который ваша компания не може...
UISGCON
 

La actualidad más candente (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
 

Destacado

Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOS
Eric 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 Chef
Chef Software, Inc.
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
Alvaro Videla
 

Destacado (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
 

Similar a Fi fo euc 2014

VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012
Eonblast
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
Abdelmonaim 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 Remani
jaxconf
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django Application
OSCON 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 Hole
Christophe 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, Etsy
Lucidworks
 

Similar a 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
Lessons from Sharding SolrLessons from Sharding Solr
Lessons from Sharding Solr
 
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
 
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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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