Slide 1

Slide 1 text

Open source development trends By Thijs Feryn

Slide 2

Slide 2 text

Hi, I’m Thijs

Slide 3

Slide 3 text

I’m @ThijsFeryn on Twitter

Slide 4

Slide 4 text

I’m an at Evangelist

Slide 5

Slide 5 text

I’m a at board member

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Modern  web  developer

Slide 8

Slide 8 text

Modern  web  developer Code Infrastructure Agile  processes Quality  assurance Frontend  vs   backend Project   management Build  &  release  cycles Performance  &  scalability Security Flexibility

Slide 9

Slide 9 text

Internet

Slide 10

Slide 10 text

Military

Slide 11

Slide 11 text

Scientific

Slide 12

Slide 12 text

Public (hobbyism)

Slide 13

Slide 13 text

Corporate

Slide 14

Slide 14 text

E-commerce & web applications

Slide 15

Slide 15 text

Web 2.0

Slide 16

Slide 16 text

Software As A Service

Slide 17

Slide 17 text

Social media

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Mobile

Slide 20

Slide 20 text

Big data

Slide 21

Slide 21 text

Evolution of programming languages

Slide 22

Slide 22 text

EvoluDon  of  programming  languages ✓C ✓C++ ✓C# ✓Objective C ✓Perl ✓VB(A) ✓Java ✓Javascript ✓PHP ✓Ruby ✓Python ✓Node.js

Slide 23

Slide 23 text

Traditional language are still there

Slide 24

Slide 24 text

Interpreted languages are accepted & respected

Slide 25

Slide 25 text

PHP, Perl, Javascript, Ruby, Python, Bash

Slide 26

Slide 26 text

Mix & match

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Proprietary vs open source

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Security through obscurity

Slide 31

Slide 31 text

The big boys

Slide 32

Slide 32 text

Liability

Slide 33

Slide 33 text

Linux is a cancer Steve Ballmer, CEO of Microsoft, June 2001

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Microsoft has changed as a company and is becoming more open in the way that we work with and collaborate with others in the industry, in how we listen to customers, and in our approach to the cloud. We contribute to and partner with open source communities and promote interoperability to make it easier and less costly for customers to develop and manage mixed IT environments. We actively participate in the standards setting process and support established and emerging standards in our products. In the cloud, we support key standards that provide the building blocks for open, interoperable cloud services, and we support developer choice of programming languages. We support data portability and believe customers own and control their data, no matter where it resides.

Slide 36

Slide 36 text

Passion

Slide 37

Slide 37 text

Business model

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Frontend vs backend

Slide 40

Slide 40 text

Design patterns

Slide 41

Slide 41 text

Decorator

Slide 42

Slide 42 text

interface ServiceClient { function getData(); } ! class MyWebServiceClient implements ServiceClient { private $data; function MyWebServiceClient() { $client = new SoapClient("some.wsdl"); $this->data = $client->getDataFunction(); } function getData() { return $this->data; } }

Slide 43

Slide 43 text

$client = new MyWebServiceClient(); // Later in your code, and possibly in multiple places print $client->getData();

Slide 44

Slide 44 text

abstract class ServiceClientDecorator implements ServiceClient { protected $serviceClient; public function __construct(ServiceClient $serviceClient) { $this->serviceClient = $serviceClient; } } ! class HtmlEntitiesDecorator extends ServiceClientDecorator { public function getData() { return htmlentities($this->serviceClient->getData()); } } ! class ParagraphDecorator extends ServiceClientDecorator { public function getData() { return '

'.$this->serviceClient->getData().'

'; } }

Slide 45

Slide 45 text

$client = new MyWebServiceClient(); // Add our decorators $client = new HtmlEntititesDecorator($client); $client = new ParagraphDecorator($client); ! // Later in your code, and possibly in multiple places print $client->getData();

Slide 46

Slide 46 text

Factory

Slide 47

Slide 47 text

class DatabaseFactory { // The factory function takes as an argument the // name of the class to produce public static function getInstance($driver) { // Attempt to include the the file containing the class // (not necessary if you use a custom autoloader) if(include_once(dirname(__FILE__).'/drivers/database_'. $driver.'.php')) { // Build the name of the class, instantiate, and return $driver_class = 'Database_'.$driver; return new $driver_class; } else { throw new Exception('Database driver not found'); } } } ! // To use, call the factory's static method: $db = DatabaseFactory::getInstance('MySQL');

Slide 48

Slide 48 text

Singleton

Slide 49

Slide 49 text

class Database { // A static property to hold the single instance of the class private static $instance; ! // The constructor is private so that outside code cannot instantiate private function __construct() { } ! // All code that needs to get and instance of the class should call // this function like so: $db = Database::getInstance(); public function getInstance() { // If there is no instance, create one if (!isset(self::$instance)) { $c = __CLASS__; self::$instance = new $c; } return self::$instance; } // Block the clone method private function __clone() {} } ! // To use, call the static method to get the only instance $db = Database::getInstance();

Slide 50

Slide 50 text

Dependency injection

Slide 51

Slide 51 text

class Book ! {! ! public function __construct() ! {! ! ! $registry = RegistrySingleton::getInstance();! ! ! $this->_database = $registry->database;! ! ! // or! ! ! global $databaseConnection;! ! ! $this->_database = $database;! ! }! }! ! $book = new Book();

Slide 52

Slide 52 text

class Book ! { ! ! private $_databaseConnection;! ! public function __construct() { }! ! public function setDatabaseConnection($databaseConnection) {! ! ! $this->_databaseConnection = $databaseConnection;! ! }! ! }! ! $book = new Book();! $book->setDatabase($databaseConnection);

Slide 53

Slide 53 text

Javascript is back

Slide 54

Slide 54 text

✓Jquery ✓Angular.js ✓Backbone.js ✓D3.js ✓Node.js & NPM ✓Reveal.js ✓Yo ✓Grunt ✓Bower ✓Yeoman ✓Phantom.js

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

✓Canvas drawing ✓Movie support ✓Offline data ✓Document editing ✓Drag & drop ✓Geolocation ✓File manipulation ✓New intuitive tags & elements

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

Request & reponse

Slide 61

Slide 61 text

Methods & status codes

Slide 62

Slide 62 text

Headers & body

Slide 63

Slide 63 text

GET  /  HTTP/1.1   Host:  www.erasmushogeschool.be   User-­‐Agent:  Mozilla/5.0  (Macintosh;  Intel  Mac  OS  X   10.9;  rv:27.0)  Gecko/20100101  Firefox/27.0   Accept:  text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8   Accept-­‐Language:  en,nl;q=0.7,fr-­‐be;q=0.3   Accept-­‐Encoding:  gzip,  deflate   Cookie:   SESScb94af3218bddf8a6a8a156d8d1cb02a=64a18f65470ea229 b5ad23a83566ab45;  has_js=1;   __utma=26413801.1654633732.1395239322.1395239322.1395 239322.1;  __utmb=26413801.1.10.1395239322;   __utmc=26413801;   __utmz=26413801.1395239322.1.1.utmcsr=(direct)| utmccn=(direct)|utmcmd=(none)   Connection:  keep-­‐alive   Cache-­‐Control:  max-­‐age=0   !

Slide 64

Slide 64 text

HTTP/1.1  200  OK   Date:  Wed,  19  Mar  2014  14:28:31  GMT   Server:  Apache/2.2.16  (Debian)  PHP/5.3.3-­‐7+squeeze15   with  Suhosin-­‐Patch   X-­‐Powered-­‐By:  PHP/5.3.3-­‐7+squeeze15   Last-­‐Modified:  Wed,  19  Mar  2014  11:00:54  GMT   Etag:  "9eb48667197c0cd1817601c4bff5738c"   Expires:  Sun,  19  Nov  1978  05:00:00  GMT   Cache-­‐Control:  must-­‐revalidate   Content-­‐Encoding:  gzip   Keep-­‐Alive:  timeout=15,  max=91   Connection:  Keep-­‐Alive   Transfer-­‐Encoding:  chunked   Content-­‐Type:  text/html;  charset=utf-­‐8   !

Slide 65

Slide 65 text

Status codes hFp://www.w3.org/Protocols/rfc2616/rfc2616-­‐sec10.html hFp://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Slide 66

Slide 66 text

100 range Magic, fuggedaboudid!

Slide 67

Slide 67 text

200 range Check!

Slide 68

Slide 68 text

200 range Check!

Slide 69

Slide 69 text

200: OK 201: Created 202: Accepted 203: Non-Authoritative 
 Information 204: No content 205: Reset content 206: Partial content

Slide 70

Slide 70 text

300 range Talk to that guy over there

Slide 71

Slide 71 text

301: Moved permanently 302: Found 303: See other 304: Not modified 305: Use proxy 306: Unused 307: Temporary redirect

Slide 72

Slide 72 text

400 range Dude, you f’d up!

Slide 73

Slide 73 text

400: Bad request 401: Unauthorized 402: Payment required 403: Forbidden 404: Not found 405: Method not allowed 406: Not acceptable 407: Proxy authentication required 408: Request timeout

Slide 74

Slide 74 text

409: Conflict 410: Gone 411: Length required 412: Precondition failed 413: Request enitity too large 414: Request URI too long 415: Unsupported media type 416: Request range not satisfiable 417: Expectation failed

Slide 75

Slide 75 text

500 range Sorry man, we f’d up!

Slide 76

Slide 76 text

500: Internal server error 501: Not implemented 502: Bad gateway 503: Service unavailable 504: Gateway timeout 505: HTTP version not supported

Slide 77

Slide 77 text

Request headers

Slide 78

Slide 78 text

✓Accept ✓Accept-Charset ✓Accept-Encoding ✓Accept- language ✓Authorization ✓Cache-control ✓Connection ✓Cookie ✓Content-length ✓Date ✓Host ✓If-None-Match ✓Pragma ✓Proxy- Authorization ✓Referer ✓Upgrade ✓User-Agent ✓Via

Slide 79

Slide 79 text

Response headers

Slide 80

Slide 80 text

✓Age ✓Allow ✓Cache-control ✓Connection ✓Content- Encoding ✓Content- Language ✓Content-Length ✓Content-Type ✓Date ✓ETag ✓Expires ✓Last-Modified ✓Location ✓Pragma ✓Server ✓Set-Cookie ✓Transfer- Encoding ✓Vary

Slide 81

Slide 81 text

GET  /  HTTP/1.1   Host:  www.erasmushogeschool.be   User-­‐Agent:  Mozilla/5.0  (Macintosh;  Intel  Mac  OS  X   10.9;  rv:27.0)  Gecko/20100101  Firefox/27.0   Accept:  text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8   Accept-­‐Language:  en,nl;q=0.7,fr-­‐be;q=0.3   Accept-­‐Encoding:  gzip,  deflate   Cookie:   SESScb94af3218bddf8a6a8a156d8d1cb02a=64a18f65470ea229 b5ad23a83566ab45;  has_js=1;   __utma=26413801.1654633732.1395239322.1395239322.1395 239322.1;  __utmb=26413801.1.10.1395239322;   __utmc=26413801;   __utmz=26413801.1395239322.1.1.utmcsr=(direct)| utmccn=(direct)|utmcmd=(none)   Connection:  keep-­‐alive   Cache-­‐Control:  max-­‐age=0   !

Slide 82

Slide 82 text

HTTP/1.1  200  OK   Date:  Wed,  19  Mar  2014  14:28:31  GMT   Server:  Apache/2.2.16  (Debian)  PHP/5.3.3-­‐7+squeeze15   with  Suhosin-­‐Patch   X-­‐Powered-­‐By:  PHP/5.3.3-­‐7+squeeze15   Last-­‐Modified:  Wed,  19  Mar  2014  11:00:54  GMT   Etag:  "9eb48667197c0cd1817601c4bff5738c"   Expires:  Sun,  19  Nov  1978  05:00:00  GMT   Cache-­‐Control:  must-­‐revalidate   Content-­‐Encoding:  gzip   Keep-­‐Alive:  timeout=15,  max=91   Connection:  Keep-­‐Alive   Transfer-­‐Encoding:  chunked   Content-­‐Type:  text/html;  charset=utf-­‐8   !

Slide 83

Slide 83 text

Caching

Slide 84

Slide 84 text

ETag If-­‐Non-­‐Match:  "3e86-­‐410-­‐3596=bc" ETag:  "3e86-­‐410-­‐3596=bc"

Slide 85

Slide 85 text

Expires Expires  "Wed,  1  Jan  2014  20:00:00  GMT"

Slide 86

Slide 86 text

Cache-­‐control Cache-­‐Control  “max-­‐age=3600,  s-­‐ maxage=1000,  public,  must-­‐revalidate”

Slide 87

Slide 87 text

Max-Age: TTL for browsers in seconds S-maxage: TTL for proxies in seconds Public: Proxies & browsers can cache Private: Only browsers can cache No-cache: Revalidate before dropping from cache No-store: don’t cache at all Must-revalidate: Browser revalidate before serving from cache Proxy-revalidate: Browser revalidate before serving from cache

Slide 88

Slide 88 text

Cookies

Slide 89

Slide 89 text

Cookies Tracking Sessions Language

Slide 90

Slide 90 text

Cookies HTTP cookie request header via browser HTTP set-cookie response header via webserver

Slide 91

Slide 91 text

Service oriented architecture

Slide 92

Slide 92 text

API/webservice

Slide 93

Slide 93 text

SOAP ✓WSDL = HTTP GET ✓RPC call = HTTP POST ✓Not cacheable ✓No HTTP vocabuliary re-use ✓Complex markup

Slide 94

Slide 94 text

REpresentational State Transfer

Slide 95

Slide 95 text

Developed in parallel with HTTP/1.1

Slide 96

Slide 96 text

The way the web
 *should* work

Slide 97

Slide 97 text

REST ✓Resources ✓Stateless ✓Cacheable ✓Layered ✓Uniform interface ✓Vocabulary re-use ✓HATEOAS

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

David Zülke @dzuelke

Slide 100

Slide 100 text

Quoting David Zülke ✓A URL identifies a resource. ✓Resources have a hierarchy, so you know that something with additional slashes is a subordinate resource ✓Verbs are used to perform operations on resources ✓The operation is implicit and not part of the URL ✓A hypermedia format is used to represent the data ✓Link relations are used to navigate a service

Slide 101

Slide 101 text

GET POST PUT DELETE Retrieve Insert Update Remove

Slide 102

Slide 102 text

HATEOAS   WTF?

Slide 103

Slide 103 text

Hypertext As The Engine Of Application State

Slide 104

Slide 104 text

GET  /products/1234  HTTP/1.1   Host:  example.com   Accept:  application/vnd.com.example+xml   HTTP/1.1  200  OK   Content-­‐Type:  application/vnd.com.example+xml;  charset=utf-­‐8   Allow:  GET,  PUT,  DELETE    xml  version="1.0"  encoding="utf-­‐8"  ?>        1234      My  product      Mijn  product   5   6.5       Thx   David!

Slide 105

Slide 105 text

REST implementations

Slide 106

Slide 106 text

Javascript Ajax Jquery Backbone.js Websockets

Slide 107

Slide 107 text

Open data ✓hFp://appsforghent.be   ✓hFp://opendata.antwerpen.be/apps-­‐antwerp   ✓hFp://www.openbelgium.be  

Slide 108

Slide 108 text

Version Control

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

✓Twitter Bootstrap ✓Homebrew ✓Ruby On Rails ✓HTML5 Boilerplate ✓Jquery ✓Node.js ✓Phonegap ✓Backbone.js ✓Linux Kernel ✓Symfony2 Frame work ✓Django Framework ✓Zend Framework 2 ✓Git Popular GitHub projects

Slide 117

Slide 117 text

Not Invented Here

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

Managing dependencies

Slide 120

Slide 120 text

Managing dependencies ✓Add to project ✓Share across environment ✓Beste of both worlds: package managers

Slide 121

Slide 121 text

Package managers ✓Ruby: Gem ✓Python: Pip ✓Perl: CPAN ✓PHP: PEAR, PECL & Composer ✓.NET: NuGet ✓Linux: yum, apt-get ✓Javascript: npm, bower

Slide 122

Slide 122 text

Dependency injection pattern

Slide 123

Slide 123 text

Webservers

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

GWS 3%   of  the   internet

Slide 128

Slide 128 text

Facebook’s   PHP  runtime

Slide 129

Slide 129 text

Database servers

Slide 130

Slide 130 text

No content

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

No content

Slide 133

Slide 133 text

No content

Slide 134

Slide 134 text

“I wish I had enough money to run Oracle instead of Postgres." ! “Why do you want to do that?" ! “I dont, I just wish I had enough money to”

Slide 135

Slide 135 text

Addressing the needs of today’s internet

Slide 136

Slide 136 text

Stability

Slide 137

Slide 137 text

Availability

Slide 138

Slide 138 text

Perform ance

Slide 139

Slide 139 text

No content

Slide 140

Slide 140 text

Scalability Social Mobile Cloud Data

Slide 141

Slide 141 text

No content

Slide 142

Slide 142 text

Mobile

Slide 143

Slide 143 text

Big data

Slide 144

Slide 144 text

The tools have evolved

Slide 145

Slide 145 text

Not only SQL

Slide 146

Slide 146 text

No content

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

No content

Slide 149

Slide 149 text

Message queues

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

Varnish

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

✓Async, non-blocking, event-driven ✓Javascript based ✓Callbacks ✓Data intensive ✓CK10 problem ✓Not for websites ✓Real-time communication ✓Websockets ✓Hipsters

Slide 154

Slide 154 text

var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http:// 127.0.0.1:1337/');

Slide 155

Slide 155 text

Change

Slide 156

Slide 156 text

✓Flexibility/elasticity ✓Scalability ✓Distributed systems ✓Any server could die any moment ✓Clustering ✓Replication ✓Sharding ✓Modularity

Slide 157

Slide 157 text

Developers Agile

Slide 158

Slide 158 text

✓People > processes ✓Usability > documentation ✓Late requirement changes ✓Fast changes ✓Prototype ~ production ✓Continuous delivery ✓Short cycles ✓Quick releases

Slide 159

Slide 159 text

Fail fast

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

No content

Slide 162

Slide 162 text

Sysadmins DevOps

Slide 163

Slide 163 text

Patrick Debois “What is this DevOps thing anyway?” http://www.jedi.be/blog/2010/02/12/ what-is-this-devops-thing-anyway

Slide 164

Slide 164 text

✓Fear of change ✓Risky deployment ✓It work on my machine ✓Siloisation

Slide 165

Slide 165 text

Kris Buytaert “Building Clouds since before the bookstore” http://www.krisbuytaert.be/blog/what-devops

Slide 166

Slide 166 text

Everything is a Freaking DNS problem

Slide 167

Slide 167 text

That sweet spot between "operating system" or platform stack and the application layer

Slide 168

Slide 168 text

Tearing down silos

Slide 169

Slide 169 text

Infrastructure As Code

Slide 170

Slide 170 text

No content

Slide 171

Slide 171 text

class  apache  (      $default_mods  =  true,      $service_enable  =  true,      $serveradmin    =  'root@localhost',      $sendfile          =  false,      $purge_vdir      =  true   )  {      include  apache::params   !    package  {  'httpd':          ensure  =>  installed,          name      =>  $apache::params::apache_name,      }   !    #  true/false  is  sufficient  for  both  ensure  and  enable      validate_bool($service_enable)   !    service  {  'httpd':          ensure        =>  $service_enable,          name            =>  $apache::params::apache_name,          enable        =>  $service_enable,  

Slide 172

Slide 172 text

!    file  {  'httpd_vdir':          ensure    =>  directory,          path        =>  $apache::params::vdir,          recurse  =>  true,          purge      =>  $purge_vdir,          notify    =>  Service['httpd'],          require  =>  Package['httpd'],      }   !    if  $apache::params::conf_dir  and  $apache::params::conf_file   {          #  Template  uses:          #  -­‐  $apache::params::user          #  -­‐  $apache::params::group          #  -­‐  $apache::params::conf_dir          #  -­‐  $serveradmin          file  {  "${apache::params::conf_dir}/$ {apache::params::conf_file}":              ensure    =>  present,              content  =>  template("apache/$ {apache::params::conf_file}.erb"),  

Slide 173

Slide 173 text

No content

Slide 174

Slide 174 text

Vagrant::Config.run  do  |config|      config.vm.box  =  "lucid32"      config.vm.box_url  =  "http://files.vagrantup.com/lucid32.box"      config.vm.customize  [                  "modifyvm",  :id,                  "-­‐-­‐name",  "Varnish  Training",                  "-­‐-­‐memory",  "512"      ]      config.vm.network  :hostonly,  "12.12.12.6"      config.vm.share_folder  "v-­‐data",  "/home/data",  "./"      config.vm.provision  :chef_solo  do  |chef|          chef.cookbooks_path  =  "./tools/chef/cookbooks"          chef.json  =  {              :varnish  =>  {                          :vcl_dir  =>  "/home/data",                                                  :version  =>  "3.0",                          :listen_port  =>  "80",                          :storage  =>  "malloc",                          :storage_size  =>  "256m",                      },              :apache  =>  {                          :listen_ports  =>  ["8080"]       }                                 }          chef.add_recipe("vim")          chef.add_recipe("apache2")          chef.add_recipe("apache2::mod_php5")                  chef.add_recipe("varnish::apt_repo")          chef.add_recipe("varnish::default")      end   end  

Slide 175

Slide 175 text

Measure

Slide 176

Slide 176 text

✓Google Analytics ✓Access_logs ✓Logstash ✓Graphite ✓Collectd ✓Statsd ✓New Relic ✓Datadog ✓Kibana

Slide 177

Slide 177 text

The community

Slide 178

Slide 178 text

Move fast. Keep up.

Slide 179

Slide 179 text

And   on  that   bombshell  ...

Slide 180

Slide 180 text

No content

Slide 181

Slide 181 text

Thanks