Slide 1

Slide 1 text

Developing  Cloud9  in  Cloud9 Sergi  Mansilla Brescia,  24  September  2011 Sunday, October 2, 11

Slide 2

Slide 2 text

@sergimansilla Developer  -­‐  Ajax.org hEp://github.com/sergi Language  programming  geek Sunday, October 2, 11

Slide 3

Slide 3 text

What  is  it? It  is  to  Eclipse  what  Google  Docs  is  to  Office Easiest  way  to  create  Nodejs  apps  (including  Windows) Free  for  public  projects Open  Source Fully  funcXonal  IDE Sunday, October 2, 11

Slide 4

Slide 4 text

Developers  carry  too  much  weight  nowadays Sunday, October 2, 11

Slide 5

Slide 5 text

Developers  carry  too  much  weight  nowadays Sunday, October 2, 11

Slide 6

Slide 6 text

and  someXmes  too  liEle debugging? code analysis? deployment? source control? Sunday, October 2, 11

Slide 7

Slide 7 text

Other  advantages Runs  on  any  computer  with  a  modern  browser No  configuraXon  needed Deployment  in  the  cloud Share  by  URL You  can  use  your  own Sunday, October 2, 11

Slide 8

Slide 8 text

So  why  not  let  the  IDE  wait  for  you  in  the  Clouds? Sunday, October 2, 11

Slide 9

Slide 9 text

1  year  ago Sunday, October 2, 11

Slide 10

Slide 10 text

We  build  Cloud9  IDE  with  Cloud9  IDE Sunday, October 2, 11

Slide 11

Slide 11 text

Today Sunday, October 2, 11

Slide 12

Slide 12 text

What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 13

Slide 13 text

Proxy  servers What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 14

Slide 14 text

Proxy  servers File  servers  (webDAV  based) What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 15

Slide 15 text

Proxy  servers File  servers  (webDAV  based) Database  interacXon  (redis) What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 16

Slide 16 text

Proxy  servers File  servers  (webDAV  based) Database  interacXon  (redis) Hosted  running/debugging What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 17

Slide 17 text

Proxy  servers File  servers  (webDAV  based) Database  interacXon  (redis) Hosted  running/debugging Deployment  to  cloud  services What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 18

Slide 18 text

Proxy  servers File  servers  (webDAV  based) Database  interacXon  (redis) Hosted  running/debugging Deployment  to  cloud  services GitHub  /  BitBucket  /  FTP  hardcore  acXon What  the  eye  doesn’t  meet Sunday, October 2, 11

Slide 19

Slide 19 text

Sunday, October 2, 11

Slide 20

Slide 20 text

Full  nodejs  stack  (except  for  redis  and  nginx) 50000+  users Big  producXon  system  in  nodejs 100+  concurrent  users  and  growing Fast. 1  main  server  4Gb 1  staXc  server 2  runVm Sunday, October 2, 11

Slide 21

Slide 21 text

Ide Server reverse proxy NGINX project.user.c9.io *.c9.io run VM control node process control Client static.c9.io Sunday, October 2, 11

Slide 22

Slide 22 text

IDE Server Client Connect JSDav Socket IO Sunday, October 2, 11

Slide 23

Slide 23 text

Foundations APF - High performance UI library Socket.io - Realtime socket networking jsDAV - Filesystem layer ACE - Source code editor in JS Sunday, October 2, 11

Slide 24

Slide 24 text

The best stuff That thing is fast Never blocks As low-level as you want, and makes it easy Running multiple servers in one process is awesome Sunday, October 2, 11

Slide 25

Slide 25 text

It hasn’t been a bed of roses Sunday, October 2, 11

Slide 26

Slide 26 text

Requires discipline Sunday, October 2, 11

Slide 27

Slide 27 text

High learning curve Sunday, October 2, 11

Slide 28

Slide 28 text

                                                                                               db.isCommercialProject(pid,  function(err,  isCommercial)                                                                                                        if  (isCommercial)  {                                                                                                                var  transactionData  =  {                                                                                                                        members:  members,                                                                                                                        extensions:  extensions                                                                                                                };                                                                                                                _self.setProjectTransactions(db,  type,  id,  tran                                                                                                                        if  (err)                                                                                                                                return  cleanup(err);                                                                                                                        end();                                                                                                                });                                                                                                        }                                                                                                        else  {                                                                                                                app.get('/index',  function(req,  res,  next)  {                                                                                                                        User.get(req.params.userId,  function(err,  u                                                                                                                                if(err)  next(err);                                                                                                                                db.find({user:  user.name},  function(err                                                                                                                                        if(err)  next(err);                                                                                                                                        cursor.toArray(function(err,  items)                                                                                                                                                if(err)  next(err);                                                                                                                                                res.send(items);                                                                                                                                        });                                                                                                                                });                                                                                                                        });                                                                                                                });                                                                                                        }                                                                                                        function  end()  {                                                                                                                db.getProject(pid,  function(err,  project)  {                                                                                                                        if  (err)                                                                                                                                return  cleanup(err);                                                                                                                        callback(null,  project);                                                                                                                });                                                                                                        }                                                                                                });                                                                                        });                                                                                });                                                                        });                                                                });                                                        });                                                });                                        });                                });                        });                });        }; “Christmas  tree”  code (also  known  as  callbacks  from  hell) looks  familiar? Sunday, October 2, 11

Slide 29

Slide 29 text

                                                                                               db.isCommercialProject(pid,  function(err,  isCommercial)                                                                                                        if  (isCommercial)  {                                                                                                                var  transactionData  =  {                                                                                                                        members:  members,                                                                                                                        extensions:  extensions                                                                                                                };                                                                                                                _self.setProjectTransactions(db,  type,  id,  tran                                                                                                                        if  (err)                                                                                                                                return  cleanup(err);                                                                                                                        end();                                                                                                                });                                                                                                        }                                                                                                        else  {                                                                                                                app.get('/index',  function(req,  res,  next)  {                                                                                                                        User.get(req.params.userId,  function(err,  u                                                                                                                                if(err)  next(err);                                                                                                                                db.find({user:  user.name},  function(err                                                                                                                                        if(err)  next(err);                                                                                                                                        cursor.toArray(function(err,  items)                                                                                                                                                if(err)  next(err);                                                                                                                                                res.send(items);                                                                                                                                        });                                                                                                                                });                                                                                                                        });                                                                                                                });                                                                                                        }                                                                                                        function  end()  {                                                                                                                db.getProject(pid,  function(err,  project)  {                                                                                                                        if  (err)                                                                                                                                return  cleanup(err);                                                                                                                        callback(null,  project);                                                                                                                });                                                                                                        }                                                                                                });                                                                                        });                                                                                });                                                                        });                                                                });                                                        });                                                });                                        });                                });                        });                });        }; “Christmas  tree”  code (also  known  as  callbacks  from  hell) looks  familiar? Sunday, October 2, 11

Slide 30

Slide 30 text

Error handling is hard Never EVER throw Sunday, October 2, 11

Slide 31

Slide 31 text

Learn (and maintain) conventions Sunday, October 2, 11

Slide 32

Slide 32 text

Don’t mix sync/async (unless you know what you’re doing) streamline.js stratified JavaScript Common Node But if you do be sure to check those Sunday, October 2, 11

Slide 33

Slide 33 text

Clean after yourself and minimize side-effects Sunday, October 2, 11

Slide 34

Slide 34 text

No CI = it’s not gonna work Sunday, October 2, 11

Slide 35

Slide 35 text

Modules Sunday, October 2, 11

Slide 36

Slide 36 text

Get your hands dirty Sunday, October 2, 11

Slide 37

Slide 37 text

Get your hands dirty Everything is new Or under heavy development Or sucks Manual digging often necessary Fix it yourself Authors love pull requests Sunday, October 2, 11

Slide 38

Slide 38 text

Roll your own Sunday, October 2, 11

Slide 39

Slide 39 text

Roll your own Node.js is still young Some modules are still missing Be prepared to write your own Contribute back! Sunday, October 2, 11

Slide 40

Slide 40 text

Cloud9 OSS side-effects Cloud9 IDE (github.com/ajaxorg/cloud9) jsDAV (github.com/ajaxorg/jsdav) jsFTP (github.com/ajaxorg/jsftp) node-github (github.com/ajaxorg/node-github) ACE (github.com/ajaxorg/node-github) async.js (github.com/ajaxorg/async.js) ... Sunday, October 2, 11

Slide 41

Slide 41 text

Demo time! Sunday, October 2, 11

Slide 42

Slide 42 text

What’s coming Sunday, October 2, 11

Slide 43

Slide 43 text

What’s coming Collaboration Sunday, October 2, 11

Slide 44

Slide 44 text

Sunday, October 2, 11

Slide 45

Slide 45 text

What’s coming Moar languages Sunday, October 2, 11

Slide 46

Slide 46 text

What’s coming Code analysis Code completion Refactoring Sunday, October 2, 11

Slide 47

Slide 47 text

What’s coming Git UI Sunday, October 2, 11

Slide 48

Slide 48 text

Sunday, October 2, 11

Slide 49

Slide 49 text

Is node.js ready for production? Sunday, October 2, 11

Slide 50

Slide 50 text

Is node.js ready for production? YES! (But you will have to work at it) Sunday, October 2, 11

Slide 51

Slide 51 text

Questions? Sunday, October 2, 11

Slide 52

Slide 52 text

Thanks! Rate  my  talk:    hEp://joind.in/talk/view/3710 Twitter: @sergimansilla Email: [email protected] http://c9.io or http://cloud9ide.com We are hiring!!! Sunday, October 2, 11

Slide 53

Slide 53 text

Images • http://www.flickr.com/photos/earlg/280538938/sizes/o/in/photostream/ • http://www.flickr.com/photos/imaginedreality/275853161/sizes/z/in/photostream/ • http://www.flickr.com/photos/bdewey/4965925131/sizes/o/in/photostream/ • http://www.flickr.com/photos/polanri/74381759/sizes/o/in/photostream/ Sunday, October 2, 11