La computadora HAL 9000 es uno de los personajes centrales de "2001 Odisea del Espacio". Considerando que esta historia fue escrita en 1968, podemos decir que la tecnología ha tenido un tremendo avance desde entonces. Y nuestra habilidad para crear software también ha mejorado un poco. Pero todavía estamos muy lejos de poder construir algo como HAL 9000. En esta conferencia echaremos un vistazo a las principales tendencias en desarrollo de software hacia los próximos años.
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
From concept to cloud a look at modern software development
1. From concept to cloud:
A look at modern software
development
From concept to cloud:
Chris Richardson
A look Author original CloudFoundry.com
atthe of POJOs in Action
Founder of
modern software
development
crichardson@vmware.com
@crichardson
plainoldobjects.com
Chris Richardson
Author of POJOs in Action,
Founder of the original CloudFoundry.com
crichardson@vmware.com, @crichardson
plainoldobjects.com
12. We still have a long way
to go before we can
build HAL
But despite that....
13. Today, a small team of
people can easily build
an application that’s
used by millions of
people world-wide
http://highscalability.com/blog/2012/5/7/startups-are-creating-a-new-
system-of-the-world-for-it.html
29. 1958 - Lisp
2010
(defun factorial (n) garbage collection
2000
(if (<= n 1) dynamic typing
1990 1 self-hosting compiler
1980 (* n (factorial (- n 1))))) tree data structures
1970
1960
1950 http://en.wikipedia.org/wiki/
Lisp_(programming_language)
1940
30. 1960 - Algol 60
procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
2010 value n, m; Many
array a; integer n, m, i, k; real y;
2000 begin integer p, q; languages
y := 0; i := k := 1;
for p:=1 step 1 until n do
including Java
1990
for q:=1 step 1 until m do are derived
if abs(a[p, q]) > y then
1980
begin y := abs(a[p, q]); from Algol
i := p; k := q
1970 end
end Absmax
1960
http://en.wikipedia.org/wiki/Algol_60
1950
1940
32. So what have programming
language designers been
doing since then?
33. 1995 - Java
Not innovative BUT
2010
2000
1990
Brought garbage collection, object-
oriented programming, exception
1980
handling, safety ... to mainstream
1970
developers
1960
1950
Gosling “Java is a blue collar
google “Gosling the feel of Java”
language”
1940
35. 1980s - Cool IDEs for Lisp
and Smalltalk
2010
Editor
2000
Class
1990
List
1980
Repl
1970
1960 Class
hierarchy
1950
Debugger
1940
36. 1990s
2010
• CVS - Lockless version management
2000
• DVCS - distributed version control
1990 • Refactoring
1980 • Agile/XP starts to become popular
1970
• Mosaic web browser
1960
• Web crawlers
1950
1940 http://www2.jpl.nasa.gov/sl9/
38. 2000s - DevOps, NoOps,
Continuous Deployment, etc
2010
• Developers responsible for testing,
2000
operations, ...
1990
• Continuous deployment: update production
1980
many times a day
• Chaos monkeys - constantly verify that the
1970
1960
system can tolerate failure
1950
http://highscalability.com/blog/2012/5/7/startups-are-creating-a-new-system-of-the-world-for-it.html
1940
39. William Gibson
“The future is already here –
it's just not evenly distributed.”
Ideas take a long time to
diffuse through the software
community
44. Ruby on Rails became popular
• Web application framework for Ruby
• Significantly more productive
• Simplicity of Convention over Configuration
• Motivated the Java community to improve:
• e.g. Spring became even easier to use
But...
45. …Highlighted problems with Java
• Tedious collection processing
• Painful object construction code
• Tedious XML processing
• Types: verboseness and complexity of
generics
• Limited support for DSLs
Reopened the debate about programming
languages
53. Traditional web application architecture
WAR
StoreFrontUI
Billing
Service
Customer MySQL
Browser Apache Management Database
Inventory
Service
Simple to Shipping
Service
develop Tomcat
test
deploy
scale
54. But there are problems
• Inadequate for modern, real-time web applications
(need NodeJS)
• Obstacle to frequent deployments
• Slows down IDE and dev/test cycle
• Obstacle to scaling development
• Requires long term commitment to technology
stack
55. Modular, polyglot application architecture
Desktop Browser Native Mobile application HTML5 mobile application
StoreUI StoreUI StoreUI
Asynchronous, NodeJS
Javascript
scalable StoreUI
communication
RabbitMQ
Spring/
Rails Inventory
Scala web Shipping Service
Service
application
Customer Inventory Order
Billing Service
Management Database Database
Standalone
“headless”
Customer Spring/Java
Database applications
56. Real world examples
http://techblog.netflix.com/
Between 100-150 services are accessed to build a
page.
http://highscalability.com/amazon-architecture
http://www.addsimplicity.com/downloads/
eBaySDForum2006-11-29.pdf
http://queue.acm.org/detail.cfm?id=1394128
57. There are drawbacks
• Complexity: Architectural, development,
deployment
• Deciding when to use it
• In the beginning: you don’t need it and it will
slow you down
• When you do need it: refactoring existing code
is painful
58. But there are many benefits
• Scales development: focused two pizza devops teams
• Deploy services independently
• Scale services independently
• Improves fault isolation
• Enforces well defined interfaces between components
• Eliminates long-term commitment to a single technology stack
Modular, polyglot applications
59. If services are small...
• Regularly rewrite using a better technology stack
• Pick the best developers rather than best <pick a
language> developers polyglot culture
• Adapt system to changing requirements and
better technology without a total rewrite
60. Moreover: you are not the same you ...
• 50 to 70 billion of your cells die each day
Can we build software
• Cell lifetimes:
systems with these
• hours - some white blood cells
characteristics?
• days - stomach lining cells
• years - bone cells Too much technical debt
• lifetime - brain cells component death?
• Yet you (the system) remains intact
http://dreamsongs.com/Files/
DesignBeyondHumanAbilitiesSimp.pdf
http://dreamsongs.com/Files/WhitherSoftware.pdf
71. Let’s imagine that you
want to deploy an app...
• Do you know how much hardware to buy?
• Can you afford it?
• How long does it take to approve, buy and install?
• Who is going to set it up?
• What happens if the traffic increases 10x?
• Can we afford a test lab?
76. Sign up and deploy your
application a few minutes later
• Login using your
existing Amazon
account
• Select the web
77. Benefits of IaaS
• Agility
• Pay per use
• Elasticity
• Focus on deploying your application
But you need to configure and maintain the
operating systems, the app servers and the
databases etc.
79. PaaS
=
Application deployment
and management
+
Service provisioning
80. The Open
Platform as a Service
Deploy and scale applications in seconds,
without locking yourself into a single cloud
Flex ible,
pen,
le, O lable
Simp Sca
81. Easy polyglot application deployment and
service provisioning
OSS community
vFabric
Postgres
Private
Ap
Clouds
p
Data Services
lica
'o
n
S
vFabric
Public
erv
RabbitMQTM
ice
Msg Services
Clouds
In
ter
fac
Micro
e
Other Services
Clouds
Additional partners services …
83. Micro Cloud Foundry – Industry first TM
downloadable PaaS
Micro Cloud Foundry
Services
Runtimes & Frameworks
Your Laptop/PC
Single VM instance of
Cloud Foundry
that runs on a developer’s
MAC or PC
84. CloudFoundry.ORG - Community open-source project
Apache2 license
CloudFoundry.ORG
Your Infrastructure
Download Setup Deploy Behind
Code Environment BOSH Firewall
85. Sinatra + Redis
require 'sinatra'
require 'redis' Connect to Redis
configure do
$r = Redis.new(:host => '127.0.0.1', :port => '6379') if !$r
end
get '/' do
"Hello World! " + $r.incr("hitcounter").to_s
end
Increment hit
counter
http://sgce2012.cloudfoundry.com/
88. Thousands of 3rd party
services
http://www.programmableweb.com/apis/directory
Number of APIs increasing exponentially
89. Cloud service trends
• Predominantly REST
• Predominantly JSON
• > billion API calls/day: Twitter, Google, Facebook,
Netflix, Accuweather, ...
• Increasing number of API-only companies
http://www.slideshare.net/jmusser/j-musser-apishotnotgluecon2012
90. Diverse
Paypal SendGrid Face.com Google
Cybersource Twilio GeoNames Aviary.com Yahoo
AlchemyAPI Tropo WorldAddresses Amazon
Mashery
91. Amazon Simple Storage Service (S3)
• Bucket
• has a globally unique name, e.g. cloudtools.org.photos
• contains objects
• Objects - 1 byte – 5 Tbytes
• Pay per use: storage + bandwidth
• Accessed via RESTful API
• PUT – create bucket or object
• GET – retrieve object
1T objects
• DELETE – delete an object
June 2012
92. face.com - face detection and recognition
http://api.face.com/faces
/detect.json
?api_key=
&api_secret=
&urls=<url>
&detector=Aggressive
&attributes=all
93. Twilio - Telephony and SMS
as a service
• REST API
• Allocate phone numbers
• Make and receive phone calls
• Send and receive SMS messages
• Pay per use:
• Phone number – per month
• Phone calls - per-minute
• SMS – per SMS sent or received
• Example: Salesforce – SMS-based voting for 19,000
conference attendees
96. Going beyond today’s pop
culture
But love is blind and lovers cannot see
The pretty follies that themselves commit;
For if they could, Cupid himself would blush
To see me thus transformed to a boy.
William Shakespeare, The Mechant of Venice
103. The problem
=
Mutable state that’s
shared between multiple
threads (using locks)
104. Not thread safe
public class InventoryTracker {
private int inStock;
private int sold = 0;
public InventoryTracker(int initialInventory) {
this.inStock = initialInventory;
}
public int getInStock() { return inStock; }
public int sell(int units) {
inStock -= units;
sold += units;
return inStock;
}
}
105. Thread safe
public class InventoryTracker {
private int inStock;
private int sold = 0;
public InventoryTracker(int initialInventory) {
this.inStock = initialInventory;
}
public synchronized int getInStock() { return inStock; }
public synchronized int sell(int units) {
inStock -= units;
sold += units;
return inStock;
}
}
106. NodeJS - Event driven
• Single threaded runtime no concurrency
• Runs an event loop that waits for i/o events
• i/o event callback function
• Updates state
• Publishes events triggers more callbacks)
• Initiates i/o, registering callbacks
Mutable state that’s
• Returns shared between
multiple threads
107. NodeJS example
var http = require('http');
var fs = require('fs'); HTTP request handler
var url = require('url');
var inStock = 100;
var sold = 0;
http.createServer(function (req, res) {
var quantity = parseInt(url.parse(req.url, true).query.quantity);
inStock -= quantity;
sold += quantity;
var message = "inStock=" + inStock + ", sold=" + sold;
res.end(message);
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
http://127.0.0.1:1337?quantity=1
108. Scala Actors
• Actor = object that asynchronously exchanges
immutable messages with other actors
• Actor processes one message at a time
• Sends messages
• Updates its private mutable state
• Creates new actors
• No shared state Mutable state that’s
shared between
multiple threads
109. Scala example
case class Sell(quantity: Int) Message types
case class Sale(inStock : Int, sold : Int)
class InventoryTracker(initialInventory : Int) extends Actor {
var inStock = initialInventory
var sold = 0
def receive = {
case Sell(quantity) => Update state
inStock -= quantity
sold += quantity
sender ! Sale(inStock, sold)
}
}
Send reply
case class Order(quantity: Int)
class StoreFront(inventoryTracker: ActorRef) extends Actor {
var numberOfOrders = 0
def receive = {
case Order(quantity) => Send message
numberOfOrders += 1
inventoryTracker ! Sell(quantity)
case Sale(inStock, sold) =>
println("numberOfOrders=" + numberOfOrders + ",inStock=" +
inStock + ", sold=" + sold) Handle reply
}
}
110. Pure functional
programming
• Eliminates mutable state
BUT
• I/O and state management require Monads
• Monads are extremely difficult to learn
Mutable state that’s
shared between
multiple threads
111. Clojure - a modern LISP
• Practical functional programming language
• Runs on the JVM
• Core data structures are immutable
BUT
• Ref = object that holds a mutable reference to a value
• Refs can only be updated within a transaction
• Software Transaction Memory
• Atomic, Consistent, Isolated
Mutable state that’s
• No explicit locks shared between multiple
threads
113. Final thoughts
Software development is an old
... yet immature profession
Multi-core programming is a challenge
BUT
The cloud enables anyone with a good idea to
create an application that touches the lives of
millions of people
114. Thank you!
Chris Richardson
Author of POJOs in Action
Founder of the original CloudFoundry.com
crichardson@vmware.com
@crichardson
plainoldobjects.com
Signup @ cloudfoundry.com Promo code: sgce2012