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...
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
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
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
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(){ .. }
}
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
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
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
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
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
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