SlideShare ist ein Scribd-Unternehmen logo
1 von 80
Downloaden Sie, um offline zu lesen
Abdelmonaim Remani 
@PolymathicCoder 
PolymathicCoder@gmail.com 
github.com/PolymathicCoder 
Josh Long 
(⻰龙之春) 
@starbuxman 
jlong@pivotal.io 
github.com/joshlong 
ECONOMIES 
SCALING SOFTWAREOF
Spring Developer Advocate 
@Starbuxman @PolymathicCoder 
Josh Long (⻰龙之春) 
@starbuxman | jlong@pivotal.io 
Jean Claude 
van Damme! Java mascot Duke some thing’s I’ve authored...
@Starbuxman @PolymathicCoder 
Abdelmonaim Remani 
@PolymathicCoder polymathicCoder@| gmail.com
@Starbuxman @PolymathicCoder
BUILDING ADAPTIVE APPLICATIONS IS HARD 
built WHY on Cloud SCALE? 
Foundry 
! 
code will be open sourced.
Moore’s Law no longer works @Starbuxman @PolymathicCoder 
§ processing can’t scale up 
§ concurrent, horizontal architectures are easier to scale 
§ “process”-style concurrency is easy to scale still 
Moore's law is the observation that, over the 
history of computing hardware, the number of 
transistors in a dense integrated circuit doubles 
approximately every two years. The law is 
named after Gordon E. Moore, co-founder of the 
Intel Corporation, who described the trend in his 
1965 paper.! !http://en.wikipedia.org/wiki/Moore's_law
data @Starbuxman @PolymathicCoder 
data production is expected to be 
: 
44000% 
larger in 2020 than 2009
systems are increasingly complex @Starbuxman @PolymathicCoder 
§ a complex system today has a lot of moving parts 
§ security 
§ multiple clients (iOS, Android, Windows Mobile, etc.) 
§ multiple (business) domains 
§ integration between systems 
§ requires more people working on the same problem
mobile 
@Starbuxman @PolymathicCoder 
More than 
1.5 MILLION 
activations 
daily * 
* http://www.androidcentral.com/larry-page-15-million-android-devices-activated-every-day
social: a connected world in 60 seconds @Starbuxman @PolymathicCoder 
1090 visitors 
700k messages sent 
2000 checkins 175k tweets 
7610 searches 2MM videos viewed 
3125 photos uploaded 7630 messages sent 
* source: visual.ly/60-seconds-social-media
the internet of things @Starbuxman @PolymathicCoder 
“In five years, by 2018, Earth will be home to 7.6 
billion people, says the United Nations. By 
contrast, some 25 billion devices will be 
connected by 2015, and 50 billion by 2020, 
says Cisco.”! 
!h 
ttp://www.businessinsider.com/what-you-need-to-know-about-the-internet- 
of-things-2013-3?op=1#ixzz3FxCafwWe 
§ IPv6 gives us more addresses 
§ devices are getting smaller, 
more ubiquitous 
§ “devices” include homes 
appliances (refrigerators, 
washers, coffee machines, 
dryers), roads, air pollution 
monitors, (human) body 
monitors, etc
how to think about scale? @Starbuxman @PolymathicCoder 
Chris Richardson (http://microservices.io/articles/scalecube.html) introduced me to this “scale cube” 
from The Art of Scaling Software
BUILDING ADAPTIVE APPLICATIONS IS HARD 
X-AXIS 
HORIZONTAL DUPLICATION 
built on Cloud Foundry 
! 
code will be open sourced.
STATELESS APPS 
SCALE
no state and lots of gain @Starbuxman @PolymathicCoder 
§ obvious: no state means no sharing 
§ no sharing means that applications can be scaled horizontally easily 
§ requires very little: 
§ HTTP load balancers are ubiquitous. 
§ message queues (like RabbitMQ) make effective load balancers
DEMO 
RABBITMQ PING PONG
WHAT IF I 
HAVE SOME STATE?
http sessions? @Starbuxman @PolymathicCoder 
§ Spring Session 
§ useful in a PaaS 
§ useful when you need state 
§ useful when you need durable, replicated state 
§ pluggable: Redis out-of-the-box, but feel free to bring your own
DEMO 
REDIS-BACKED HTTP SESSIONS
PAAS: 
PLATFORM-AS-A-SERVICE
why PaaS? @Starbuxman @PolymathicCoder 
“ ” 
Imagine if architects had to be the 
janitor for every building they designed. 
This is how the development team felt 
prior to moving to Windows Azure. 
Duncan Mackenzie Nov 07, 2011 
http://www.infoq.com/articles/Channel-9-Azure
The Impact of the Cloud @Starbuxman @PolymathicCoder 
§ Spring Boot makes it dead simple to stand up services. 
(Where do they live? Who runs them?) 
§ Things get Distributed REALLY quickly! CF provides a way to simplify 
! 
> cf push hystrix.jar 
! 
> cf push … 
§ Manifests are are the ultimate installer. 
(cf push an entire distributed system!) 
§ Spring Cloud PaaS connectors simplify service-consumption
DEMO 
SIMPLE SCALING ON THE CLOUD
BUILDING ADAPTIVE APPLICATIONS IS HARD 
Z-AXIS 
DATA PARTITIONING 
built on Cloud Foundry 
! 
code will be open sourced.
CAP & NOSQL
Brewer’s Conjecture (CAP) @Starbuxman @PolymathicCoder 
Many datastores provide some of the following three characteristics: ! 
! 
§ Consistency ! 
§ Availability ! 
§ Partitionability 
! 
clarification #1: in a system with no network partitions (such as a single-node 
RDBMS), then there's no need to sacrifice C & A.! 
clarification #2: availability is a continuous value: 0-100%. there are many 
levels of consistency, and even partitions have nuances, including 
disagreement within the system about whether a partition exists.!
choose the best store for the job @Starbuxman @PolymathicCoder
NoSQL @Starbuxman @PolymathicCoder
SPRING DATA 
REPOSITORIES
How it Works in Rails @Starbuxman @PolymathicCoder 
class Car < ActiveRecord 
end 
# and then magic happens 
car = Car.new 
cars = car.find_cars_by_id(232) 
# where did this method come from?
Using Spring Data Repositories @Starbuxman @PolymathicCoder 
•Spring Data Neo4J @EnableNeo4jRepositories 
•Spring Data JPA @EnableJpaRepositories 
•Spring Data MongoDB @EnableMongoRepositories 
•Spring Data GemFire @EnableGemfireRepositories 
@Configuration 
@EnableTransactionManagement 
@ComponentScan 
@EnableJpaRepositories( basePackageClasses = BlogRepository.class) 
public class ServiceConfiguration { 
! 
@Bean public DataSource dataSource(){ .. } 
@Bean public PlatformTransactionManager transactionManager(){ .. } 
}
Custom Repository @Starbuxman @PolymathicCoder 
Keyword Sample Resulting MongoDB Query * 
GreaterThan findByAgeGreaterThan(int 
age) 
{"age" : {"$gt" : age}} 
LessThan findByAgeLessThan(int age) {"age" : {"$lt" : age}} 
Between findByAgeBetween(int from, 
int to) 
{"age" : {"$gt" : from, "$lt" : 
NotNull findByFirstnameNotNull() t{o”fi}}rstname" : {"$ne" : null}} 
Null findByFirstnameNull() {”firstname" : null} 
Like findByFirstnameLike(String 
name) 
"firstname" : firstname} 
(regex)
MONGODB
Spring Data MongoDB @Starbuxman @PolymathicCoder 
§ GridFS integration 
§ GIS integration 
§ Document mapping
who’s using MongoDB? @Starbuxman @PolymathicCoder 
§ Mailbox.app: https://tech.dropbox.com/2013/09/scaling-mongodb-at-mailbox/ 
§ eHarmony: https://www.mongodb.com/presentations/big-dating-eharmony-0? 
_ga=1.259505294.567221685.1413121358 
§ Expedia: https://www.mongodb.com/presentations/building-expedia 
%E2%80%99s-travel-graph-using-mongodb? 
_ga=1.26276665.567221685.1413121358
DEMO 
MONGODB GIS & 
FACEBOOK PLACES
REDIS
Spring Data Redis @Starbuxman @PolymathicCoder 
§ key/value store 
§ data structures 
§ sets 
§ queues 
§ lists 
§ maps 
§ CacheManager implementation 
§ memcached client
who’s using Redis? @Starbuxman @PolymathicCoder 
§ Twitter: http://www.infoq.com/presentations/Real-Time-Delivery-Twitter 
§ Sina Weibo http://www.xdata.me/?p=353 
§ GitHub https://github.com/blog/530-how-we-made-github-fast 
§ Snapchat https://twitter.com/robustcloud/status/448503100056535040 
§ Pinterest http://engineering.pinterest.com/post/55272557617/building-a-follower-model- 
from-scratch
COUCHBASE
Spring Data Couchbase @Starbuxman @PolymathicCoder 
§ keyed document access 
§ sort of like a mix of Redis 
and MongoDB 
§ horizontally scalable 
! 
@Configuration 
@EnableCouchbaseRepositories 
public class Application 
extends AbstractCouchbaseConfiguration { 
! 
@Override 
protected List<String> bootstrapHosts() { 
return Arrays.asList( “127.0.0.1" ); 
} 
! 
@Override 
protected String getBucketName() { 
return "default"; 
} 
! 
@Override 
protected String getBucketPassword() { 
return ""; 
} 
! 
}
who’s using Couchbase? @Starbuxman @PolymathicCoder 
§ AOL: http://www.couchbase.com/ad_platforms 
§ Playtika: http://www.couchbase.com/social-gaming
NEO4J
complexity vs performance @Starbuxman @PolymathicCoder
who’s using Neo4j? @Starbuxman @PolymathicCoder
the evolution of search 
Pre-1999 
WWW Indexing 
Atomic Data 
1999 - 2012 
Google Invents 
PageRank 
Simple 
Connected Data 
@Starbuxman @PolymathicCoder 
2012-? 
Google Launches the 
Knowledge Graph 
Rich 
Connected Data
Recommenda)ons @Starbuxman @PolymathicCoder
Graph Search! @Starbuxman @PolymathicCoder
Graph Search! @Starbuxman @PolymathicCoder
What the Cypher Query Looks Like: @Starbuxman @PolymathicCoder 
MATCH (person:Person)-[:IS_FRIEND_OF]->(friend), 
(friend)-[:LIKES]->(restaurant), 
(restaurant)-[:LOCATED_IN]->(loc:Location), 
(restaurant)-[:SERVES]->(type:Cuisine) 
! 
WHERE person.name = 'Philip' AND loc.location='New York' AND 
type.cuisine='Sushi' ! 
RETURN restaurant.name 
* Cypher http://maxdemarzi.com/?s=facebook query language example
What the Search Looks Like: @Starbuxman @PolymathicCoder
What the Search Looks Like: @Starbuxman @PolymathicCoder
DEMO 
NEO4J TWITTER
HADOOP
spring for 
Surviving the Big Data 
Wild-West with 
Spring for Hadoop 
@Starbuxman @PolymathicCoder
SPRING XD
@Starbuxman @PolymathicCoder 
stream processing, data ingestion & integration 
But How Do You Process Data Realtime? 
@metamarkets founder Michael E. Driscoll:
stream processing, data ingestion & integration @Starbuxman @PolymathicCoder 
Introducing Spring XD 
sources 
sinks
DEMO 
SPRING XD AND PIVOTAL HD
BUILDING ADAPTIVE APPLICATIONS IS HARD 
Y-AXIS 
BOUNDED CONTEXTS 
built on Cloud Foundry 
! 
code will be open sourced.
micro- vs. monolith… is not a new discussion @Starbuxman @PolymathicCoder 
From: kt4@prism.gatech.EDU (Ken Thompson) 
Subject: Re: LINUX is obsolete 
Date: 3 Feb 92 23:07:54 GMT 
Organization: Georgia Institute of Technology 
I would generally agree that microkernels are probably the wave of 
the future. However, it is in my opinion easier to implement a 
monolithic kernel. It is also easier for it to turn into a mess in 
a hurry as it is modified. 
Regards, 
Ken
hold on a tick.. 
@Starbuxman @PolymathicCoder 
…didn’t the monolith win?
so what’s so bad about a monolith? @Starbuxman @PolymathicCoder 
(does your monolith drive you to drink?)
boardroom agility pushes tech agility @Starbuxman @PolymathicCoder 
§ boardroom agility manifest in technology: 
• 2-pizza box teams are a result of eschewing organizational norms 
! 
§ easier to scale (in development teams, and at runtime) 
! 
§ shorter iterations: 
• small services > 
continuous integration > 
shorter release cycles > 
deployment automation
the elegant microservice @Starbuxman @PolymathicCoder
problems with microservices @Starbuxman @PolymathicCoder 
§ hard to deploy (devops!) 
§ hard to tease into separate deployable modules (Boot!) 
§ lots of moving parts introduces complexity (PaaS & Spring Cloud!)
WHY BOOT
harder to tease into separate microservices? …No. @Starbuxman @PolymathicCoder 
import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 
import org.springframework.context.annotation.Configuration; 
import org.springframework.web.bind.annotation.* 
! 
// assumes org.springframework.boot:spring-boot-starter-web on CLASSPATH 
@Configuration 
@RestController 
@EnableAutoConfiguration 
public class GreetingsController { 
! 
@RequestMapping("/hi/{name}") 
String hello(@PathVariable String name) { 
return "Hello, " + name + "!"; 
} 
! 
public static void main(String[] args) { 
SpringApplication.run(GreetingsController.class, args); 
} 
}
managing many processes with a PaaS @Starbuxman @PolymathicCoder 
§ services are explicit about what they bundle 
§ services are attached resources (locally or remote, who cares) 
§ configuration is external 
§ scaling is easy 
§ isolation is provided at the process level
emergent patterns of microservices @Starbuxman @PolymathicCoder 
§ distributed / versioned configuration 
§ service registration + discovery 
§ client-side routing, service-to-service calls 
§ load-balancing 
§ minimizing failure cascades 
§ proxies
Standing on the Shoulders of 
Spring & 
@Starbuxman @PolymathicCoder
CONFIG-SERVER
REFRESH-ABLE 
CONFIGURATION
SERVICE REGISTRATION 
& DISCOVERY 
WITH EUREKA 
http://techblog.netflix.com/2012/09/eureka.html
MANAGING 
FAILURES WITH 
HYSTRIX 
http://techblog.netflix.com/2012/11/hystrix.html
DYNAMIC ROUTING 
WITH ZUUL 
http://techblog.netflix.com/2012/11/hystrix.html
Bookmark.. @Starbuxman @PolymathicCoder 
§ The Netflix Techblog http://techblog.netflix.com 
§ Fred Georges on Programmer Anarchy 
http://www.infoq.com/news/2012/02/programmer-anarchy 
§ Matt Stine’s CF + Microservices: a Mutualistic Symbiotic Relationship 
http://www.youtube.com/watch?v=RGZefc92tZs 
§ Martin Fowler’s article - http://martinfowler.com/articles/microservices.html
Bookmark.. @Starbuxman @PolymathicCoder 
§ Former Netflix DevOps Guru Adrian Cockroft on DevOps + MS 
http://www.infoq.com/interviews/adrian-cockcroft-microservices-devops 
§ Bootiful Applications with Spring Boot 
http://http://www.youtube.com/watch?v=eCos5VTtZoI 
§ Chris Richardson’s http://microservices.io site and his 
Decomposing Applications for Scalability talks 
§ github.com/joshlong/scaling-software-talk
References 
spring.io/guides 
github.com/spring-cloud/ 
github.com/spring-cloud-samples/ 
github.com/joshlong/spring-doge 
github.com/joshlong/spring-doge-microservice 
docs.spring.io/spring-boot/ 
! 
Questions? 
Abdelmonaim Remani 
@PolymathicCoder 
PolymathicCoder@gmail.com 
github.com/PolymathicCoder 
Josh Long 
(⻰龙之春) 
@starbuxman 
jlong@pivotal.io 
github.com/joshlong

Weitere ähnliche Inhalte

Was ist angesagt?

JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 
WuKong - Framework for Integrated Test
WuKong - Framework for Integrated TestWuKong - Framework for Integrated Test
WuKong - Framework for Integrated Test
Summer Lu
 

Was ist angesagt? (20)

#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSSpark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RS
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
 
React & The Art of Managing Complexity
React &  The Art of Managing ComplexityReact &  The Art of Managing Complexity
React & The Art of Managing Complexity
 
The JSON REST API for WordPress
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPress
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Regex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language InsteadRegex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language Instead
 
Ten practical ways to improve front-end performance
Ten practical ways to improve front-end performanceTen practical ways to improve front-end performance
Ten practical ways to improve front-end performance
 
What's New in Spring 3.1
What's New in Spring 3.1What's New in Spring 3.1
What's New in Spring 3.1
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
 
SocketStream
SocketStreamSocketStream
SocketStream
 
Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Os Johnson
Os JohnsonOs Johnson
Os Johnson
 
WuKong - Framework for Integrated Test
WuKong - Framework for Integrated TestWuKong - Framework for Integrated Test
WuKong - Framework for Integrated Test
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 

Ähnlich wie Economies of Scaling Software

The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
ploibl
 
Systems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop KeynoteSystems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop Keynote
Deepak Singh
 

Ähnlich wie Economies of Scaling Software (20)

The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
 
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
 
Rental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean DownesRental Cars and Industrialized Learning to Rank with Sean Downes
Rental Cars and Industrialized Learning to Rank with Sean Downes
 
Brandon
BrandonBrandon
Brandon
 
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
 
Big Data Analytics with Google BigQuery, by Javier Ramirez, datawaki, at Span...
Big Data Analytics with Google BigQuery, by Javier Ramirez, datawaki, at Span...Big Data Analytics with Google BigQuery, by Javier Ramirez, datawaki, at Span...
Big Data Analytics with Google BigQuery, by Javier Ramirez, datawaki, at Span...
 
Ionic 4 + capacitor + angular 7
Ionic 4 +  capacitor + angular 7 Ionic 4 +  capacitor + angular 7
Ionic 4 + capacitor + angular 7
 
Offline first development - Glasgow PHP - January 2016
Offline first development - Glasgow PHP - January 2016Offline first development - Glasgow PHP - January 2016
Offline first development - Glasgow PHP - January 2016
 
CloudCamp Chicago - Big Data & Cloud May 2015 - All Slides
CloudCamp Chicago - Big Data & Cloud May 2015 - All SlidesCloudCamp Chicago - Big Data & Cloud May 2015 - All Slides
CloudCamp Chicago - Big Data & Cloud May 2015 - All Slides
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
 
Ingesting streaming data into Graph Database
Ingesting streaming data into Graph DatabaseIngesting streaming data into Graph Database
Ingesting streaming data into Graph Database
 
Systems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop KeynoteSystems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop Keynote
 
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & AlluxioUltra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
 
Real-time Semantic Web with Twitter Annotations
Real-time Semantic Web with Twitter AnnotationsReal-time Semantic Web with Twitter Annotations
Real-time Semantic Web with Twitter Annotations
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCPSimpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
 
Data Science with Spark
Data Science with SparkData Science with Spark
Data Science with Spark
 
The spring ecosystem in 50 min
The spring ecosystem in 50 minThe spring ecosystem in 50 min
The spring ecosystem in 50 min
 
Structured Data & Schema.org - SMX Milan 2014
Structured Data & Schema.org - SMX Milan 2014Structured Data & Schema.org - SMX Milan 2014
Structured Data & Schema.org - SMX Milan 2014
 
How to build simple web apps to automate your SEO tasks - BrightonSEO Spring ...
How to build simple web apps to automate your SEO tasks - BrightonSEO Spring ...How to build simple web apps to automate your SEO tasks - BrightonSEO Spring ...
How to build simple web apps to automate your SEO tasks - BrightonSEO Spring ...
 

Mehr von Joshua Long

The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update final
Joshua Long
 
Spring in-the-cloud
Spring in-the-cloudSpring in-the-cloud
Spring in-the-cloud
Joshua Long
 

Mehr von Joshua Long (20)

Bootiful Code with Spring Boot
Bootiful Code with Spring BootBootiful Code with Spring Boot
Bootiful Code with Spring Boot
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 update
 
The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update final
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Integration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud FoundryIntegration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud Foundry
 
using Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundryusing Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundry
 
Spring in-the-cloud
Spring in-the-cloudSpring in-the-cloud
Spring in-the-cloud
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
The Cloud Foundry bootcamp talk from SpringOne On The Road - EuropeThe Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Multi client Development with Spring
Multi client Development with SpringMulti client Development with Spring
Multi client Development with Spring
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the Scenes
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry Bootcamp
 
Spring in the Cloud - using Spring with Cloud Foundry
Spring in the Cloud - using Spring with Cloud FoundrySpring in the Cloud - using Spring with Cloud Foundry
Spring in the Cloud - using Spring with Cloud Foundry
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in Heaven
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom Usage
 
Using Spring's IOC Model
Using Spring's IOC ModelUsing Spring's IOC Model
Using Spring's IOC Model
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Economies of Scaling Software

  • 1. Abdelmonaim Remani @PolymathicCoder PolymathicCoder@gmail.com github.com/PolymathicCoder Josh Long (⻰龙之春) @starbuxman jlong@pivotal.io github.com/joshlong ECONOMIES SCALING SOFTWAREOF
  • 2. Spring Developer Advocate @Starbuxman @PolymathicCoder Josh Long (⻰龙之春) @starbuxman | jlong@pivotal.io Jean Claude van Damme! Java mascot Duke some thing’s I’ve authored...
  • 3. @Starbuxman @PolymathicCoder Abdelmonaim Remani @PolymathicCoder polymathicCoder@| gmail.com
  • 5. BUILDING ADAPTIVE APPLICATIONS IS HARD built WHY on Cloud SCALE? Foundry ! code will be open sourced.
  • 6. Moore’s Law no longer works @Starbuxman @PolymathicCoder § processing can’t scale up § concurrent, horizontal architectures are easier to scale § “process”-style concurrency is easy to scale still Moore's law is the observation that, over the history of computing hardware, the number of transistors in a dense integrated circuit doubles approximately every two years. The law is named after Gordon E. Moore, co-founder of the Intel Corporation, who described the trend in his 1965 paper.! !http://en.wikipedia.org/wiki/Moore's_law
  • 7. data @Starbuxman @PolymathicCoder data production is expected to be : 44000% larger in 2020 than 2009
  • 8. systems are increasingly complex @Starbuxman @PolymathicCoder § a complex system today has a lot of moving parts § security § multiple clients (iOS, Android, Windows Mobile, etc.) § multiple (business) domains § integration between systems § requires more people working on the same problem
  • 9. mobile @Starbuxman @PolymathicCoder More than 1.5 MILLION activations daily * * http://www.androidcentral.com/larry-page-15-million-android-devices-activated-every-day
  • 10. social: a connected world in 60 seconds @Starbuxman @PolymathicCoder 1090 visitors 700k messages sent 2000 checkins 175k tweets 7610 searches 2MM videos viewed 3125 photos uploaded 7630 messages sent * source: visual.ly/60-seconds-social-media
  • 11. the internet of things @Starbuxman @PolymathicCoder “In five years, by 2018, Earth will be home to 7.6 billion people, says the United Nations. By contrast, some 25 billion devices will be connected by 2015, and 50 billion by 2020, says Cisco.”! !h ttp://www.businessinsider.com/what-you-need-to-know-about-the-internet- of-things-2013-3?op=1#ixzz3FxCafwWe § IPv6 gives us more addresses § devices are getting smaller, more ubiquitous § “devices” include homes appliances (refrigerators, washers, coffee machines, dryers), roads, air pollution monitors, (human) body monitors, etc
  • 12. how to think about scale? @Starbuxman @PolymathicCoder Chris Richardson (http://microservices.io/articles/scalecube.html) introduced me to this “scale cube” from The Art of Scaling Software
  • 13. BUILDING ADAPTIVE APPLICATIONS IS HARD X-AXIS HORIZONTAL DUPLICATION built on Cloud Foundry ! code will be open sourced.
  • 15. no state and lots of gain @Starbuxman @PolymathicCoder § obvious: no state means no sharing § no sharing means that applications can be scaled horizontally easily § requires very little: § HTTP load balancers are ubiquitous. § message queues (like RabbitMQ) make effective load balancers
  • 17. WHAT IF I HAVE SOME STATE?
  • 18. http sessions? @Starbuxman @PolymathicCoder § Spring Session § useful in a PaaS § useful when you need state § useful when you need durable, replicated state § pluggable: Redis out-of-the-box, but feel free to bring your own
  • 21. why PaaS? @Starbuxman @PolymathicCoder “ ” Imagine if architects had to be the janitor for every building they designed. This is how the development team felt prior to moving to Windows Azure. Duncan Mackenzie Nov 07, 2011 http://www.infoq.com/articles/Channel-9-Azure
  • 22. The Impact of the Cloud @Starbuxman @PolymathicCoder § Spring Boot makes it dead simple to stand up services. (Where do they live? Who runs them?) § Things get Distributed REALLY quickly! CF provides a way to simplify ! > cf push hystrix.jar ! > cf push … § Manifests are are the ultimate installer. (cf push an entire distributed system!) § Spring Cloud PaaS connectors simplify service-consumption
  • 23. DEMO SIMPLE SCALING ON THE CLOUD
  • 24. BUILDING ADAPTIVE APPLICATIONS IS HARD Z-AXIS DATA PARTITIONING built on Cloud Foundry ! code will be open sourced.
  • 26. Brewer’s Conjecture (CAP) @Starbuxman @PolymathicCoder Many datastores provide some of the following three characteristics: ! ! § Consistency ! § Availability ! § Partitionability ! clarification #1: in a system with no network partitions (such as a single-node RDBMS), then there's no need to sacrifice C & A.! clarification #2: availability is a continuous value: 0-100%. there are many levels of consistency, and even partitions have nuances, including disagreement within the system about whether a partition exists.!
  • 27. choose the best store for the job @Starbuxman @PolymathicCoder
  • 30. How it Works in Rails @Starbuxman @PolymathicCoder class Car < ActiveRecord end # and then magic happens car = Car.new cars = car.find_cars_by_id(232) # where did this method come from?
  • 31. Using Spring Data Repositories @Starbuxman @PolymathicCoder •Spring Data Neo4J @EnableNeo4jRepositories •Spring Data JPA @EnableJpaRepositories •Spring Data MongoDB @EnableMongoRepositories •Spring Data GemFire @EnableGemfireRepositories @Configuration @EnableTransactionManagement @ComponentScan @EnableJpaRepositories( basePackageClasses = BlogRepository.class) public class ServiceConfiguration { ! @Bean public DataSource dataSource(){ .. } @Bean public PlatformTransactionManager transactionManager(){ .. } }
  • 32. Custom Repository @Starbuxman @PolymathicCoder Keyword Sample Resulting MongoDB Query * GreaterThan findByAgeGreaterThan(int age) {"age" : {"$gt" : age}} LessThan findByAgeLessThan(int age) {"age" : {"$lt" : age}} Between findByAgeBetween(int from, int to) {"age" : {"$gt" : from, "$lt" : NotNull findByFirstnameNotNull() t{o”fi}}rstname" : {"$ne" : null}} Null findByFirstnameNull() {”firstname" : null} Like findByFirstnameLike(String name) "firstname" : firstname} (regex)
  • 34. Spring Data MongoDB @Starbuxman @PolymathicCoder § GridFS integration § GIS integration § Document mapping
  • 35. who’s using MongoDB? @Starbuxman @PolymathicCoder § Mailbox.app: https://tech.dropbox.com/2013/09/scaling-mongodb-at-mailbox/ § eHarmony: https://www.mongodb.com/presentations/big-dating-eharmony-0? _ga=1.259505294.567221685.1413121358 § Expedia: https://www.mongodb.com/presentations/building-expedia %E2%80%99s-travel-graph-using-mongodb? _ga=1.26276665.567221685.1413121358
  • 36. DEMO MONGODB GIS & FACEBOOK PLACES
  • 37. REDIS
  • 38. Spring Data Redis @Starbuxman @PolymathicCoder § key/value store § data structures § sets § queues § lists § maps § CacheManager implementation § memcached client
  • 39. who’s using Redis? @Starbuxman @PolymathicCoder § Twitter: http://www.infoq.com/presentations/Real-Time-Delivery-Twitter § Sina Weibo http://www.xdata.me/?p=353 § GitHub https://github.com/blog/530-how-we-made-github-fast § Snapchat https://twitter.com/robustcloud/status/448503100056535040 § Pinterest http://engineering.pinterest.com/post/55272557617/building-a-follower-model- from-scratch
  • 41. Spring Data Couchbase @Starbuxman @PolymathicCoder § keyed document access § sort of like a mix of Redis and MongoDB § horizontally scalable ! @Configuration @EnableCouchbaseRepositories public class Application extends AbstractCouchbaseConfiguration { ! @Override protected List<String> bootstrapHosts() { return Arrays.asList( “127.0.0.1" ); } ! @Override protected String getBucketName() { return "default"; } ! @Override protected String getBucketPassword() { return ""; } ! }
  • 42. who’s using Couchbase? @Starbuxman @PolymathicCoder § AOL: http://www.couchbase.com/ad_platforms § Playtika: http://www.couchbase.com/social-gaming
  • 43. NEO4J
  • 44. complexity vs performance @Starbuxman @PolymathicCoder
  • 45. who’s using Neo4j? @Starbuxman @PolymathicCoder
  • 46. the evolution of search Pre-1999 WWW Indexing Atomic Data 1999 - 2012 Google Invents PageRank Simple Connected Data @Starbuxman @PolymathicCoder 2012-? Google Launches the Knowledge Graph Rich Connected Data
  • 48. Graph Search! @Starbuxman @PolymathicCoder
  • 49. Graph Search! @Starbuxman @PolymathicCoder
  • 50. What the Cypher Query Looks Like: @Starbuxman @PolymathicCoder MATCH (person:Person)-[:IS_FRIEND_OF]->(friend), (friend)-[:LIKES]->(restaurant), (restaurant)-[:LOCATED_IN]->(loc:Location), (restaurant)-[:SERVES]->(type:Cuisine) ! WHERE person.name = 'Philip' AND loc.location='New York' AND type.cuisine='Sushi' ! RETURN restaurant.name * Cypher http://maxdemarzi.com/?s=facebook query language example
  • 51. What the Search Looks Like: @Starbuxman @PolymathicCoder
  • 52. What the Search Looks Like: @Starbuxman @PolymathicCoder
  • 55. spring for Surviving the Big Data Wild-West with Spring for Hadoop @Starbuxman @PolymathicCoder
  • 57. @Starbuxman @PolymathicCoder stream processing, data ingestion & integration But How Do You Process Data Realtime? @metamarkets founder Michael E. Driscoll:
  • 58. stream processing, data ingestion & integration @Starbuxman @PolymathicCoder Introducing Spring XD sources sinks
  • 59. DEMO SPRING XD AND PIVOTAL HD
  • 60.
  • 61. BUILDING ADAPTIVE APPLICATIONS IS HARD Y-AXIS BOUNDED CONTEXTS built on Cloud Foundry ! code will be open sourced.
  • 62. micro- vs. monolith… is not a new discussion @Starbuxman @PolymathicCoder From: kt4@prism.gatech.EDU (Ken Thompson) Subject: Re: LINUX is obsolete Date: 3 Feb 92 23:07:54 GMT Organization: Georgia Institute of Technology I would generally agree that microkernels are probably the wave of the future. However, it is in my opinion easier to implement a monolithic kernel. It is also easier for it to turn into a mess in a hurry as it is modified. Regards, Ken
  • 63. hold on a tick.. @Starbuxman @PolymathicCoder …didn’t the monolith win?
  • 64. so what’s so bad about a monolith? @Starbuxman @PolymathicCoder (does your monolith drive you to drink?)
  • 65. boardroom agility pushes tech agility @Starbuxman @PolymathicCoder § boardroom agility manifest in technology: • 2-pizza box teams are a result of eschewing organizational norms ! § easier to scale (in development teams, and at runtime) ! § shorter iterations: • small services > continuous integration > shorter release cycles > deployment automation
  • 66. the elegant microservice @Starbuxman @PolymathicCoder
  • 67. problems with microservices @Starbuxman @PolymathicCoder § hard to deploy (devops!) § hard to tease into separate deployable modules (Boot!) § lots of moving parts introduces complexity (PaaS & Spring Cloud!)
  • 69. harder to tease into separate microservices? …No. @Starbuxman @PolymathicCoder import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.web.bind.annotation.* ! // assumes org.springframework.boot:spring-boot-starter-web on CLASSPATH @Configuration @RestController @EnableAutoConfiguration public class GreetingsController { ! @RequestMapping("/hi/{name}") String hello(@PathVariable String name) { return "Hello, " + name + "!"; } ! public static void main(String[] args) { SpringApplication.run(GreetingsController.class, args); } }
  • 70. managing many processes with a PaaS @Starbuxman @PolymathicCoder § services are explicit about what they bundle § services are attached resources (locally or remote, who cares) § configuration is external § scaling is easy § isolation is provided at the process level
  • 71. emergent patterns of microservices @Starbuxman @PolymathicCoder § distributed / versioned configuration § service registration + discovery § client-side routing, service-to-service calls § load-balancing § minimizing failure cascades § proxies
  • 72. Standing on the Shoulders of Spring & @Starbuxman @PolymathicCoder
  • 75. SERVICE REGISTRATION & DISCOVERY WITH EUREKA http://techblog.netflix.com/2012/09/eureka.html
  • 76. MANAGING FAILURES WITH HYSTRIX http://techblog.netflix.com/2012/11/hystrix.html
  • 77. DYNAMIC ROUTING WITH ZUUL http://techblog.netflix.com/2012/11/hystrix.html
  • 78. Bookmark.. @Starbuxman @PolymathicCoder § The Netflix Techblog http://techblog.netflix.com § Fred Georges on Programmer Anarchy http://www.infoq.com/news/2012/02/programmer-anarchy § Matt Stine’s CF + Microservices: a Mutualistic Symbiotic Relationship http://www.youtube.com/watch?v=RGZefc92tZs § Martin Fowler’s article - http://martinfowler.com/articles/microservices.html
  • 79. Bookmark.. @Starbuxman @PolymathicCoder § Former Netflix DevOps Guru Adrian Cockroft on DevOps + MS http://www.infoq.com/interviews/adrian-cockcroft-microservices-devops § Bootiful Applications with Spring Boot http://http://www.youtube.com/watch?v=eCos5VTtZoI § Chris Richardson’s http://microservices.io site and his Decomposing Applications for Scalability talks § github.com/joshlong/scaling-software-talk
  • 80. References spring.io/guides github.com/spring-cloud/ github.com/spring-cloud-samples/ github.com/joshlong/spring-doge github.com/joshlong/spring-doge-microservice docs.spring.io/spring-boot/ ! Questions? Abdelmonaim Remani @PolymathicCoder PolymathicCoder@gmail.com github.com/PolymathicCoder Josh Long (⻰龙之春) @starbuxman jlong@pivotal.io github.com/joshlong