Merb + Nanite
-
Upload
ezra-zygmuntowicz -
Category
Technology
-
view
11.942 -
download
0
description
Transcript of Merb + Nanite
![Page 1: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/1.jpg)
![Page 3: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/3.jpg)
MerbThen
Sept 21st 2006http://pastie.org/14416
AKA Baby Merb
![Page 4: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/4.jpg)
Merb Now
• merb-action-args
• merb-assets
• merb-auth
• merb-builder
• merb-cache
• merb-gen
• merb-haml
• merb-helpers
• merb-jquery
• merb-mailer
• merb-parts
• merb-slices
• merb-core
![Page 5: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/5.jpg)
Core Tenets of Merb
![Page 6: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/6.jpg)
Merb should be fast(no code is faster then no code)
![Page 7: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/7.jpg)
Merb should be memory efficient
![Page 8: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/8.jpg)
Merb code should be as simple as possible
![Page 9: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/9.jpg)
Merb should be modular
![Page 10: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/10.jpg)
Merb should be easy to grok and extend
(by hackers for hackers)
![Page 11: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/11.jpg)
Merb should focus on the application server
as well as the web framework
![Page 12: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/12.jpg)
Merb should get out of your way and be
*flexible*
![Page 13: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/13.jpg)
Merb should be an experimentation
ground
Most Importantly
![Page 14: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/14.jpg)
Why not just work on rails?
![Page 15: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/15.jpg)
Monoculture is bad
![Page 16: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/16.jpg)
Everyone wins when there is competition
![Page 17: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/17.jpg)
Lot’s of merb’s lessons can be applied back to
rails
![Page 18: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/18.jpg)
Huge thanks to the community and all
contributors
Merb-1.0RC drops tomorrow!
![Page 19: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/19.jpg)
merb-stack: training wheels included
![Page 20: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/20.jpg)
Now with that out of the way...
![Page 21: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/21.jpg)
Introducing Nanite
![Page 22: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/22.jpg)
Nanite is a new way of building scalable
backends for web apps
![Page 23: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/23.jpg)
Built around RabbitMQ
• Written in erlang, clusterable, highly scalable, fast as hell.
• AMQP protocol provides many nice features
• Transient, Persistent and Transactional semantics
![Page 24: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/24.jpg)
<3 RabbitMQ
![Page 25: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/25.jpg)
Nanite agentsconsist of multiple Actors
![Page 26: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/26.jpg)
Nanite agents advertisetheir services and status
Feeds#crawladvertises:/feeds/crawl
Load average is advertised as default status
![Page 27: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/27.jpg)
Nanite Mappers
Track nanites and their advertised services and status
Can do dispatch based on a number of factors
Run inside your Merb or Rails app
State of all nanites is replicated across all mappers
![Page 28: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/28.jpg)
Multiple Dispatch Styles
![Page 29: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/29.jpg)
Least loaded dispatch and the fitness function
![Page 30: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/30.jpg)
Agents ping the mapper exchange every @ping_time seconds.
Mappers track the state of all nanites and remove them from
mapping if they haven’t reported in within a timeout
![Page 31: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/31.jpg)
Nanite gives us:
• Presence, we know when nanites are ready for requests or not.
• Self assembly, nanites can come and go and can run anywhere with zero configuration in the mappers.
• Dispatch based on load or any fitness function that suits your app
• Easily take advantage of cloud
![Page 32: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/32.jpg)
File Streaming
![Page 33: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/33.jpg)
Nanite makes it easy to scale web app backends
Git it on GitHub:http://github.com/ezmobius/nanite
![Page 34: Merb + Nanite](https://reader036.fdocuments.in/reader036/viewer/2022062513/5559309cd8b42a4f3d8b4917/html5/thumbnails/34.jpg)
Questions?