Camille Roux vous explique pourquoi Ruby et Ruby on Rails peuvent être un choix fantastique pour vos prochains projets. Pendant une heure vous aurez le plaisir de faire un tour en orbite autour de la planète Ruby. Après un bref voyage dans le temps pour comprendre son histoire, vous découvrirez ce qui rend ce monde si magique.
10 idées pour dynamiser la communauté Ruby en France
Pourquoi rails est génial? (version longue)
1. Pourquoi Rails est
génial?
D'un point de vue non technique!
9 juillet 2010
2. Qui parle?
• Camille Roux
• 25 ans, Sophia Antipolis
• +1 an de dev Ruby on Rails
• +3 ans de dev web (WebObjects, Flex,
PHP...)
• http://camilleroux.com
• camilleroux
12. Often people, especially computer engineers, focus on the
machines.They think, "By doing this, the machine will run
faster. By doing this, the machine will run more effectively. By
doing this, the machine will something something something."
They are focusing on machines. But in fact we need to focus
on humans, on how humans care about doing programming
or operating the application of the machines.
We are the masters.They are the slaves.
Yukihiro Matsumoto
13.
14. Ruby on Rails
Quoi : framework d'application web reposant sur le langage
Ruby
Autres noms : RoR, Rails
Licence : Libre - MIT
Apparu en : 2004
Créateur : David Heinemeier Hansson (aka “DHH”) et
quelques autres (Rails Core Team)
33. REST - Avantages
• Structure des URL propre et logique
• ex : http://veniu.com/users/1
• Stateless
• Consomme moins de mémoire
• "Scalable"
• Repose sur HTTP (notamment les
opérations : GET, POST, PUT et DELETE)
• Application simple à maintenir
36. Cucumber
Fonctionnalité: Addition
Afin de gagner du temps lors du calcul de la facture
En tant que commerçant
Je souhaite pouvoir faire une addition
Plan du Scénario: Addition de deux nombres
Soit une calculatrice
Et que j'entre <a> pour le premier nombre
Et que je tape sur la touche "+"
Et que j'entre <b> pour le second nombre
Lorsque je tape sur la touche "="
Alors le résultat affiché doit être <somme>
Exemples:
| a | b | somme |
| 2 | 2 | 4 |
| 2 | 3 | 5 |
39. Ruby est lent non?
• Comme Python et PHP
• JRuby, Ruby 1.9/2.0...
• La vitesse d'exécution, vraiment important ?
• Vitesse de développement
• Fiabilité
• Maintenabilité
41. Tâches de fond Upload de fichiers
Hiérarchies Paiement en ligne
Authentification
NoSQL Indexation
Un plugin/une gem
BDD pour tout... Pagination
Geolocalisation Cache
Twitter
Parsing Optimisation
Facebook
53. RubyMine 2.0
• Debugger
• Refactoring automatisé
• Analyse du code à la volée + inférence
du type
• Code completion
• Intégration de multiples VCS (Git, SVN...)
69. Mutualisé
VPS
Les classiques
Dédié
Cloud
Serveurs persos
70. Engine Yard
• Repose sur Amazon EC2 et S3
• Ajout/suppression de machines à chaud
• Déploiement automatique à partir du code
source (Git)
• Clonage d'application
• Monitoring et alerte
• Backup
71. Architecture d'EY
Environnement
Serveurs d'application Applications
load balancer
+
serveur serveur serveur serveur serveur
App
serveur web web web web web web
App
Serveurs de bases de données Serveurs utilitaires
master slave slave utility utility utility App
72.
73. Heroku
1 Je fais mon application
Rails en utilisant Git
74. Heroku
1 Je fais mon application
Rails en utilisant Git
2 2 lignes de commandes
00:01:00
75. Heroku
1 Je fais mon application
Rails en utilisant Git
2 2 lignes de commandes
00:01:00
3
76. En pratique
• Créer une application Rails
• Versionner sous Git
• $ heroku create Git push heroku master git commit
sophiaconf2010
deploy
• $ git push heroku master
84. Backupify was originally a photo
backup side project, and Zend
had a good Flickr library, so we
started in Zend.
Rob May, founder
85. Iterating quickly was!difficult.When Matt joined
Backupify, he gave me a Ruby on Rails!crash-
course[...]. Seriously, although I’ve read!the blogs,
and seen the screencasts, I wasn’t
truly!impressed with Rails until I started working
with it. Ruby is easy to!understand and Rails
provides a clear level of organization/
convention!that’s easy to maintain.
Ben Thomas,VP of Product Development
86. • Architecture système automatisée
• Intégration continue
• "Rubyists are amazingly prolific"
• "Lot of innovation in the Ruby space"
87.
88. YP.com en quelques
chiffres
• 23 millions visiteurs uniques/mois
• 2 millions recherches/jours
• +48 millions requêtes/jours
• +1500 requêtes/s
• 30 Mbit/s (200 Mbit/s d'Akamai)
90. • Java/EJB3
• Problèmes de design de la plateforme
• Design fortement basé sur les sessions pas
"horizontally scalable"
• 125 000 lignes de code
• Aucun test
• Difficulté à ajouter de nouvelles fonctionnalités
• Manque de contrôle sur la structure des URL
92. • Performance et stabilité acceptable
• Nombre de serveurs identique
• - de 20 000 lignes de code (avec les tests!)
• Pas de sessions (stateless)
93. • Migration faite en 2006-2007
• Conception => mise en production : 1 an
• Développement : 3 mois
• Terminé dans les temps
• Jamais plus de 5 développeurs
100. Rather than it being top-down the way Java was,
Rails has grown up out of the grass roots of the
programming community. Rails allows you to
innovate and iterate so rapidly that it has
accelerated the rate of innovations.
Rails is making it fun to program Web apps again.
Java is not fun. Happy programmers are productive
programmers.
Mitch Lasky
101. Ruby on Rails will replace Java as the
programming language and platform with
dominant market share. Java is vulnerable
because alternatives such as PHP have proven
viable for application development with
dramatically lower costs.
Christian Sepulveda, Pivotal Labs
102. We definitely wouldn't change our choice of
framework - Rails was invaluable for rapid
application development, and I think we've pretty
much proven that two guys without a lot of
scaling experience can scale a Rails app up.The
whole 'but does Rails scale?' discussion sounds
like a bunch of masturbation - the point is moot.
Siqi Chen and Alexander Le, Friend for Sale
103. Ruby rocks. It's a fun language and allowed them
to develop quickly and release the site twice a
day during beta.
Casey Forbes, creator of Ravelry