SlideShare a Scribd company logo
SCALING 
WITH 
Josh Long 
(⻰龙之春) 
@starbuxman 
jlong@pivotal.io 
github.com/joshlong 
SPRING
Spring Developer Advocate 
@Starbuxman 
Josh Long (⻰龙之春) 
@starbuxman | jlong@pivotal.io 
Jean Claude 
van Damme! Java mascot Duke some thing’s I’ve authored...
@Starbuxman
BUILDING ADAPTIVE APPLICATIONS IS HARD 
built WHY on Cloud SCALE? 
Foundry 
code will be open sourced.
Moore’s Law no longer works @Starbuxman 
§ 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 
data production is expected to be 
: 
44000% 
larger in 2020 than 2009
systems are increasingly complex @Starbuxman 
§ 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 
More than 
1.5 MILLION 
activations 
daily * 
@Starbuxman 
* http://www.androidcentral.com/larry-page-15-million-android-devices-activated-every-day
social: a connected world in 60 seconds @Starbuxman 
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 
“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.” 
http://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 
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 
§ 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 
§ 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 
“ ” 
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 
§ 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 
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
NoSQL @Starbuxman
SPRING DATA 
REPOSITORIES
How it Works in Rails @Starbuxman 
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 
•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 
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 
§ GridFS integration 
§ GIS integration 
§ Document mapping
who’s using MongoDB? @Starbuxman 
§ 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 
§ key/value store 
§ data structures 
§ sets 
§ queues 
§ lists 
§ maps 
§ CacheManager implementation 
§ memcached client
who’s using Redis? @Starbuxman 
§ 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 
§ 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 
§ AOL: http://www.couchbase.com/ad_platforms 
§ Playtika: http://www.couchbase.com/social-gaming
NEO4J
complexity vs performance @Starbuxman
who’s using Neo4j? @Starbuxman
the evolution of search 
Pre-1999 
WWW Indexing 
Atomic Data 
1999 - 2012 
Google Invents 
PageRank 
Simple 
Connected Data 
2012-? 
Google Launches the 
Knowledge Graph 
Rich 
Connected Data 
@Starbuxman
Recommenda)ons @Starbuxman
Graph Search! @Starbuxman
What the Cypher Query Looks Like: @Starbuxman 
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
DEMO 
NEO4J TWITTER
HADOOP
spring for 
Surviving the Big Data 
Wild-West with 
Spring for Hadoop 
@Starbuxman
SPRING XD
@Starbuxman 
stream processing, data ingestion & integration 
But How Do You Process Data Realtime? 
@metamarkets founder Michael E. Driscoll:
stream processing, data ingestion & integration @Starbuxman 
Introducing Spring XD 
sources 
sinks
DEMO 
SPRING XD AND PIVOTAL HD
see spring xd + hawq video
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 
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 
…didn’t the monolith win?
so what’s so bad about a monolith? @Starbuxman 
(does your monolith drive you to drink?)
boardroom agility pushes tech agility @Starbuxman 
§ 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
problems with microservices @Starbuxman 
§ 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 
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 
§ 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 
§ 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
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 
§ 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 
§ 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? 
Josh Long 
(⻰龙之春) 
@starbuxman 
jlong@pivotal.io 
github.com/joshlong

More Related Content

PDF
From Grids To Clouds Guy Tel Zur May 2009
PDF
Cloud, Containers, Kubernetes (YOW Melbourne 2018)
KEY
Features: A better way to package stuff in Drupal
PDF
Usability And Software Developers
PDF
Economies of Scaling Software
PDF
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
PDF
Hpc lunch and learn
PDF
Lessons from Highly Scalable Architectures at Social Networking Sites
From Grids To Clouds Guy Tel Zur May 2009
Cloud, Containers, Kubernetes (YOW Melbourne 2018)
Features: A better way to package stuff in Drupal
Usability And Software Developers
Economies of Scaling Software
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
Hpc lunch and learn
Lessons from Highly Scalable Architectures at Social Networking Sites

Similar to The Economies of Scaling Software - Josh Long and Abdelmonaim Remani (20)

PDF
Java scalability considerations yogesh deshpande
PPT
UnConference for Georgia Southern Computer Science March 31, 2015
PDF
Couchbase b jmeetup
PDF
Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...
PPTX
Application architecture for cloud
PDF
Voldemort Nosql
KEY
Software architectures for the cloud
PDF
"Portrait of the developer as The Artist" Lockheed Architect Workshop
DOCX
Architecting extremelylargescalewebapplications
PPTX
Iot cloud service v2.0
PPSX
Microservices Architecture - Cloud Native Apps
PPT
Architecture to Scale. DONN ROCHETTE at Big Data Spain 2012
PDF
Spring in the Cloud
PDF
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
PDF
Brandon
PDF
Introduction To Apache Mesos
PPS
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
PDF
Scaling data on public clouds
PPTX
Understanding Microservices
PDF
System Design Interview Questions PDF By ScholarHat
Java scalability considerations yogesh deshpande
UnConference for Georgia Southern Computer Science March 31, 2015
Couchbase b jmeetup
Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...
Application architecture for cloud
Voldemort Nosql
Software architectures for the cloud
"Portrait of the developer as The Artist" Lockheed Architect Workshop
Architecting extremelylargescalewebapplications
Iot cloud service v2.0
Microservices Architecture - Cloud Native Apps
Architecture to Scale. DONN ROCHETTE at Big Data Spain 2012
Spring in the Cloud
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
Brandon
Introduction To Apache Mesos
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scaling data on public clouds
Understanding Microservices
System Design Interview Questions PDF By ScholarHat
Ad

More from JAXLondon2014 (20)

PDF
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
PDF
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
PPTX
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
PDF
Conditional Logging Considered Harmful - Sean Reilly
PDF
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
PPT
API Management - a hands on workshop - Paul Fremantle
PDF
'Bootiful' Code with Spring Boot - Josh Long
PDF
The Full Stack Java Developer - Josh Long
PDF
Dataflow, the Forgotten Way - Russel Winder
PDF
Habits of Highly Effective Technical Teams - Martijn Verburg
PDF
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
PPTX
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
PDF
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
PDF
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
PDF
Spocktacular Testing - Russel Winder
PDF
Server Side JavaScript on the Java Platform - David Delabassee
PDF
Reflection Madness - Dr. Heinz Kabutz
PDF
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
PDF
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
PDF
Personal Retrospectives - Johannes Thönes
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
Conditional Logging Considered Harmful - Sean Reilly
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
API Management - a hands on workshop - Paul Fremantle
'Bootiful' Code with Spring Boot - Josh Long
The Full Stack Java Developer - Josh Long
Dataflow, the Forgotten Way - Russel Winder
Habits of Highly Effective Technical Teams - Martijn Verburg
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
Spocktacular Testing - Russel Winder
Server Side JavaScript on the Java Platform - David Delabassee
Reflection Madness - Dr. Heinz Kabutz
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Personal Retrospectives - Johannes Thönes
Ad

Recently uploaded (20)

PPTX
An Unlikely Response 08 10 2025.pptx
PDF
Instagram's Product Secrets Unveiled with this PPT
PDF
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
PPTX
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
PPTX
Intro to ISO 9001 2015.pptx wareness raising
PPTX
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PPTX
Emphasizing It's Not The End 08 06 2025.pptx
PDF
oil_refinery_presentation_v1 sllfmfls.pdf
PPTX
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
PPTX
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
PPTX
Impressionism_PostImpressionism_Presentation.pptx
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
Relationship Management Presentation In Banking.pptx
PPTX
Tour Presentation Educational Activity.pptx
PPTX
Project and change Managment: short video sequences for IBA
PDF
Swiggy’s Playbook: UX, Logistics & Monetization
PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
Human Mind & its character Characteristics
An Unlikely Response 08 10 2025.pptx
Instagram's Product Secrets Unveiled with this PPT
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
Intro to ISO 9001 2015.pptx wareness raising
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
2025-08-10 Joseph 02 (shared slides).pptx
Emphasizing It's Not The End 08 06 2025.pptx
oil_refinery_presentation_v1 sllfmfls.pdf
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
Non-Verbal-Communication .mh.pdf_110245_compressed.pptx
Impressionism_PostImpressionism_Presentation.pptx
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
Relationship Management Presentation In Banking.pptx
Tour Presentation Educational Activity.pptx
Project and change Managment: short video sequences for IBA
Swiggy’s Playbook: UX, Logistics & Monetization
nose tajweed for the arabic alphabets for the responsive
Human Mind & its character Characteristics

The Economies of Scaling Software - Josh Long and Abdelmonaim Remani

  • 1. SCALING WITH Josh Long (⻰龙之春) @starbuxman jlong@pivotal.io github.com/joshlong SPRING
  • 2. Spring Developer Advocate @Starbuxman Josh Long (⻰龙之春) @starbuxman | jlong@pivotal.io Jean Claude van Damme! Java mascot Duke some thing’s I’ve authored...
  • 4. BUILDING ADAPTIVE APPLICATIONS IS HARD built WHY on Cloud SCALE? Foundry code will be open sourced.
  • 5. Moore’s Law no longer works @Starbuxman § 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
  • 6. data @Starbuxman data production is expected to be : 44000% larger in 2020 than 2009
  • 7. systems are increasingly complex @Starbuxman § 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
  • 8. mobile More than 1.5 MILLION activations daily * @Starbuxman * http://www.androidcentral.com/larry-page-15-million-android-devices-activated-every-day
  • 9. social: a connected world in 60 seconds @Starbuxman 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
  • 10. the internet of things @Starbuxman “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.” http://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
  • 11. how to think about scale? @Starbuxman Chris Richardson (http://microservices.io/articles/scalecube.html) introduced me to this “scale cube” from The Art of Scaling Software
  • 12. BUILDING ADAPTIVE APPLICATIONS IS HARD X-AXIS HORIZONTAL DUPLICATION built on Cloud Foundry code will be open sourced.
  • 14. no state and lots of gain @Starbuxman § 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
  • 16. WHAT IF I HAVE SOME STATE?
  • 17. http sessions? @Starbuxman § 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
  • 20. why PaaS? @Starbuxman “ ” 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
  • 21. The Impact of the Cloud @Starbuxman § 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
  • 22. DEMO SIMPLE SCALING ON THE CLOUD
  • 23. BUILDING ADAPTIVE APPLICATIONS IS HARD Z-AXIS DATA PARTITIONING built on Cloud Foundry code will be open sourced.
  • 25. Brewer’s Conjecture (CAP) @Starbuxman 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.
  • 26. choose the best store for the job @Starbuxman
  • 29. How it Works in Rails @Starbuxman class Car < ActiveRecord end # and then magic happens car = Car.new cars = car.find_cars_by_id(232) # where did this method come from?
  • 30. Using Spring Data Repositories @Starbuxman •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(){ .. } }
  • 31. Custom Repository @Starbuxman 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)
  • 33. Spring Data MongoDB @Starbuxman § GridFS integration § GIS integration § Document mapping
  • 34. who’s using MongoDB? @Starbuxman § 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
  • 35. DEMO MONGODB GIS & FACEBOOK PLACES
  • 36. REDIS
  • 37. Spring Data Redis @Starbuxman § key/value store § data structures § sets § queues § lists § maps § CacheManager implementation § memcached client
  • 38. who’s using Redis? @Starbuxman § 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
  • 40. Spring Data Couchbase @Starbuxman § 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 ""; } }
  • 41. who’s using Couchbase? @Starbuxman § AOL: http://www.couchbase.com/ad_platforms § Playtika: http://www.couchbase.com/social-gaming
  • 42. NEO4J
  • 44. who’s using Neo4j? @Starbuxman
  • 45. the evolution of search Pre-1999 WWW Indexing Atomic Data 1999 - 2012 Google Invents PageRank Simple Connected Data 2012-? Google Launches the Knowledge Graph Rich Connected Data @Starbuxman
  • 48. What the Cypher Query Looks Like: @Starbuxman 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
  • 49. What the Search Looks Like: @Starbuxman
  • 52. spring for Surviving the Big Data Wild-West with Spring for Hadoop @Starbuxman
  • 54. @Starbuxman stream processing, data ingestion & integration But How Do You Process Data Realtime? @metamarkets founder Michael E. Driscoll:
  • 55. stream processing, data ingestion & integration @Starbuxman Introducing Spring XD sources sinks
  • 56. DEMO SPRING XD AND PIVOTAL HD
  • 57. see spring xd + hawq video
  • 58. BUILDING ADAPTIVE APPLICATIONS IS HARD Y-AXIS BOUNDED CONTEXTS built on Cloud Foundry code will be open sourced.
  • 59. micro- vs. monolith… is not a new discussion @Starbuxman 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
  • 60. hold on a tick.. @Starbuxman …didn’t the monolith win?
  • 61. so what’s so bad about a monolith? @Starbuxman (does your monolith drive you to drink?)
  • 62. boardroom agility pushes tech agility @Starbuxman § 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
  • 64. problems with microservices @Starbuxman § hard to deploy (devops!) § hard to tease into separate deployable modules (Boot!) § lots of moving parts introduces complexity (PaaS & Spring Cloud!)
  • 66. harder to tease into separate microservices? …No. @Starbuxman 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); } }
  • 67. managing many processes with a PaaS @Starbuxman § 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
  • 68. emergent patterns of microservices @Starbuxman § distributed / versioned configuration § service registration + discovery § client-side routing, service-to-service calls § load-balancing § minimizing failure cascades § proxies
  • 69. Standing on the Shoulders of Spring & @Starbuxman
  • 72. SERVICE REGISTRATION & DISCOVERY WITH EUREKA http://techblog.netflix.com/2012/09/eureka.html
  • 73. MANAGING FAILURES WITH HYSTRIX http://techblog.netflix.com/2012/11/hystrix.html
  • 74. DYNAMIC ROUTING WITH ZUUL http://techblog.netflix.com/2012/11/hystrix.html
  • 75. Bookmark.. @Starbuxman § 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
  • 76. Bookmark.. @Starbuxman § 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
  • 77. 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? Josh Long (⻰龙之春) @starbuxman jlong@pivotal.io github.com/joshlong