SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
BIG
                            application
                                design
Saturday, November 10, 12
@sergimansilla

Saturday, November 10, 12
http://c9.io




Saturday, November 10, 12
Smart code completion




Saturday, November 10, 12
Static analysis




Saturday, November 10, 12
Free linux VM


Saturday, November 10, 12
Bring your own machine
Saturday, November 10, 12
Real terminal
Saturday, November 10, 12
Hundreds of thousands
                        of lines of JavaScript



Saturday, November 10, 12
dynamic,
                            weakly-typed
                               language
Saturday, November 10, 12
one single thread


Saturday, November 10, 12
Openshift
    Cloud9 datacenter
                                Remote
                                  VM

                                Remote
                   IDE server
                                  VM

                                Remote
                                  VM


Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
Modularization


Saturday, November 10, 12
Black box coding


Saturday, November 10, 12
Saturday, November 10, 12
re
 requi




                            Good at
                        abstracting away


Saturday, November 10, 12
re
 requi




          Not that good at
        app-level abstraction


Saturday, November 10, 12
re
 requi


                            Relies on FS
                              duplicated modules
                             maps to folder names
                            hard to configure module



Saturday, November 10, 12
Dependency error handling

     coding time            compile time   run time
                                                           !
                                                         OM
                                                 - BO
                                           KA

                                           - Server crash
                                           - Unhappy customers
                                           - Developer gets fired




Saturday, November 10, 12
How to fix it?

       Static dependency list        Resolve at startup

       Named services                No FS required

       Easy configuration            Pass an object




Saturday, November 10, 12
Architect




                            github.com/c9/architect

Saturday, November 10, 12
Architect
         Everything is a plugin
         Plugins can consume plugins
         An application is just a set of
         plugins


Saturday, November 10, 12
Dependency model

                    require        runtime

                   Architect   compile time


Saturday, November 10, 12
Dependency error handling
               Architect
  coding time               compile time              run time




                                                      - Happy customers
                             - Fails before release   - Developer keeps job




Saturday, November 10, 12
github.com/sergi/nodejsconfit2012




Saturday, November 10, 12
Saturday, November 10, 12
Declare entity ‘cook’ with behavior
       Use ‘cook’ to do some cooking




Saturday, November 10, 12
Dependency model


                                   Cooking
                            Cook
                                    action




Saturday, November 10, 12
package.json

                            Builds dependency tree

                            without
                            executing code


Saturday, November 10, 12
cook/package.json

                                       {
           do-­‐cooking/package.json

                                       {
Saturday, November 10, 12
Next

      Wrap in Architect plugin code
      Extract the code
      Make two plugins


Saturday, November 10, 12
Function
                                        signature




                            Call when
                              done

Saturday, November 10, 12
Architect plugin code


Module.exports
               Options - we’ll talk about it later
               Imports - everything you ‘consume’
               Register - call when done



Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
Easy to test
                            Mock dependencies



Saturday, November 10, 12
‘cook’ should be called 8 times




Saturday, November 10, 12
No black magic

                        Specify dependency model
 Feed architect a config file
                                  Call ‘createApp’

Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
Configuration

                           Per-plugin options
                     No global options object
                         Specify in config file

Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
Options

                                     Passed in at startup
                            Options can be dependencies
                            Fail if options aren’t present


Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
Your app as
          chunks of functionality
        rather than sets of classes


Saturday, November 10, 12
chunks of functionality


    Implicit type constraints
                            Keep implementation private
    Swap features instead of interfaces


Saturday, November 10, 12
How does Cloud9 use it?

                Open source version
                Local version (OS + sync)
                Hosted version
                       Normal
                       FTP
                       SSH
Saturday, November 10, 12
Saturday, November 10, 12
Swap feature per
                            implementation


               On OSS: talk local filesystem
               On FTP: talk FTP library
               On SSH: talk via a SSH bridge



Saturday, November 10, 12
Architect is a DI
                              framework


Saturday, November 10, 12
But a quite
                            special one


Saturday, November 10, 12
Single node.js process


                                       IDE instance   IDE instance
                                          (FTP)          (SSH)
                      Other code
                    (dashboard etc.)
                                       IDE instance   IDE instance
                                         (Normal)       (Normal)




Saturday, November 10, 12
Architect can do


                    Multiple instances of same plugin
                                     Run independently
                    But in the same process




Saturday, November 10, 12
Centralized event bus

       Loose coupling between plugins
       No hard dependencies!
       Can also do inter-context communication




Saturday, November 10, 12
React on event
           Other plugin




                                             Event
                                              bus



                                                     Emit event
                                                                  Plugin


Saturday, November 10, 12
Saturday, November 10, 12
Saturday, November 10, 12
And now scale


       Swap it with i.e. Redis PubSub
       Plugins will never notice
       Modular awesomeness!



Saturday, November 10, 12
Modularize in feature blocks


                Don’t over engineer
                Don’t create too small blocks
                They aren’t interfaces!




Saturday, November 10, 12
Avoid context switching


                Less code!
                Less errors!
                Less boilerplate!


Saturday, November 10, 12
Loose coupling

                            Use (don’t abuse) an event bus


                             Smaller dependency graph




Saturday, November 10, 12
github.com/c9/architect

Saturday, November 10, 12
Happy coding!

Saturday, November 10, 12
http://c9.io


                                        @sergimansilla
                                       github.com/sergi
Saturday, November 10, 12

Mais conteúdo relacionado

Semelhante a Big app design for Node.js

Rcos presentation
Rcos presentationRcos presentation
Rcos presentationmskmoorthy
 
ZFS and FreeBSD Jails
ZFS and FreeBSD JailsZFS and FreeBSD Jails
ZFS and FreeBSD Jailsapeiron
 
Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5C4Media
 
Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Mark Jaquith
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudAtlassian
 
Modern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureModern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureRaven Tools
 
Fast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserAndreas Bovens
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embettermentAgile Lietuva
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive appYohan Totting
 
Flex além do browser - Lightning talk qcon
Flex além do browser - Lightning talk qcon Flex além do browser - Lightning talk qcon
Flex além do browser - Lightning talk qcon David Paniz
 
Erlang for video delivery
Erlang for video deliveryErlang for video delivery
Erlang for video deliveryHugh Watkins
 
JS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onJS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onBrice Argenson
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.jsRichard Rodger
 
iOS Prototyping with Xcode Storyboards
iOS Prototyping with Xcode StoryboardsiOS Prototyping with Xcode Storyboards
iOS Prototyping with Xcode StoryboardsKyle Oba
 
DrupalCampNYC 10 - Native mobile apps with Drupal
DrupalCampNYC 10 - Native mobile apps with DrupalDrupalCampNYC 10 - Native mobile apps with Drupal
DrupalCampNYC 10 - Native mobile apps with Drupalzroger
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Phase2
 

Semelhante a Big app design for Node.js (20)

Rcos presentation
Rcos presentationRcos presentation
Rcos presentation
 
ZFS and FreeBSD Jails
ZFS and FreeBSD JailsZFS and FreeBSD Jails
ZFS and FreeBSD Jails
 
Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5
 
Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private Cloud
 
Modern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureModern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & Structure
 
Fast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browser
 
Fluentd and WebHDFS
Fluentd and WebHDFSFluentd and WebHDFS
Fluentd and WebHDFS
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive app
 
Wp7 gapmeetup
Wp7 gapmeetupWp7 gapmeetup
Wp7 gapmeetup
 
Mobile? WT... F?
Mobile? WT... F?Mobile? WT... F?
Mobile? WT... F?
 
Flex além do browser - Lightning talk qcon
Flex além do browser - Lightning talk qcon Flex além do browser - Lightning talk qcon
Flex além do browser - Lightning talk qcon
 
Erlang for video delivery
Erlang for video deliveryErlang for video delivery
Erlang for video delivery
 
JS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onJS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-on
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
iOS Prototyping with Xcode Storyboards
iOS Prototyping with Xcode StoryboardsiOS Prototyping with Xcode Storyboards
iOS Prototyping with Xcode Storyboards
 
DrupalCampNYC 10 - Native mobile apps with Drupal
DrupalCampNYC 10 - Native mobile apps with DrupalDrupalCampNYC 10 - Native mobile apps with Drupal
DrupalCampNYC 10 - Native mobile apps with Drupal
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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 MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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 MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Big app design for Node.js