merb + nanite

34

Upload: ezra-zygmuntowicz

Post on 18-May-2015

11.942 views

Category:

Technology


0 download

DESCRIPTION

This is my keynote from MerbCamp, where I talk about merb past and present as well as introduce nanite a self assembling cluster of ruby processes

TRANSCRIPT

Page 1: Merb + Nanite
Page 2: Merb + Nanite

Merbthen and now

Ezra Zygmuntowiczhttp://engineyard.com

Page 4: Merb + Nanite

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

Core Tenets of Merb

Page 6: Merb + Nanite

Merb should be fast(no code is faster then no code)

Page 7: Merb + Nanite

Merb should be memory efficient

Page 8: Merb + Nanite

Merb code should be as simple as possible

Page 9: Merb + Nanite

Merb should be modular

Page 10: Merb + Nanite

Merb should be easy to grok and extend

(by hackers for hackers)

Page 11: Merb + Nanite

Merb should focus on the application server

as well as the web framework

Page 12: Merb + Nanite

Merb should get out of your way and be

*flexible*

Page 13: Merb + Nanite

Merb should be an experimentation

ground

Most Importantly

Page 14: Merb + Nanite

Why not just work on rails?

Page 15: Merb + Nanite

Monoculture is bad

Page 16: Merb + Nanite

Everyone wins when there is competition

Page 17: Merb + Nanite

Lot’s of merb’s lessons can be applied back to

rails

Page 18: Merb + Nanite

Huge thanks to the community and all

contributors

Merb-1.0RC drops tomorrow!

Page 19: Merb + Nanite

merb-stack: training wheels included

Page 20: Merb + Nanite

Now with that out of the way...

Page 21: Merb + Nanite

Introducing Nanite

Page 22: Merb + Nanite

Nanite is a new way of building scalable

backends for web apps

Page 23: Merb + Nanite

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

<3 RabbitMQ

Page 25: Merb + Nanite

Nanite agentsconsist of multiple Actors

Page 26: Merb + Nanite

Nanite agents advertisetheir services and status

Feeds#crawladvertises:/feeds/crawl

Load average is advertised as default status

Page 27: Merb + Nanite

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

Multiple Dispatch Styles

Page 29: Merb + Nanite

Least loaded dispatch and the fitness function

Page 30: Merb + Nanite

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

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

File Streaming

Page 33: Merb + Nanite

Nanite makes it easy to scale web app backends

Git it on GitHub:http://github.com/ezmobius/nanite

Page 34: Merb + Nanite

Questions?