Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MODERN SOFTWARE ARCHITECTURE
styles and patterns
– Roy Fielding
“an architectural style is a co-ordinated set of
architectural constraints that restricts the roles/
featur...
POSA - before and after
Layered
Pipe-and-Filter
Broker
Client-Server
Peer-to-Peer
Blackboard
$ cat limerick.txt
There was a young lady of Niger
Who smiled as she rode on a tiger.
They returned from the ride
With the...
$ cat limerick.txt | tr -cs "[:alpha:]" "n" | awk '{print
length(), $0}' | sort | uniq
1 a
2 as
2 of
2 on
3 And
3 Who
3 sh...
List<String> lines
= Files.readAllLines(Paths.get("./limerick.txt"), Charset.defaultCharset());
	 	 Map<Integer, List<Stri...
What architectural style is
this?
Real-world pipes-and-filters
sediment
pre-
carbon
ultra-filter
post-
carbon
Filtered
water
Pipe-and-filter: Benefits
+ Flexibility by filter exchange
+ Flexibility by recombination
+ Reuse of filter components
+ Rapid...
Pipe-and-filter: Liabilities
- Sharing state information is expensive or
inflexible
- Efficiency gain by parallel processing ...
What is the
architecture style
followed by
World Wide Web
(WWW)?
SOA (Service Oriented
Architecture)
Lambda Style
Microservices
REST (Representational State Transfer)
Map-Reduce
CQRS (Com...
List<String> lines
= Files.readAllLines(Paths.get("./limerick.txt"), Charset.defaultCharset());
	 	 Map<Integer, List<Stri...
Java: Fork-join framework
Map-Reduce pattern
Input
Sara
Booch
Thayer
Merlin
Sara
Ralph
Merlin
Tim
Sara
Christian
Ralph
Cormen
…
Computer Cluster
map...
Lambda style
Batch layer
Serving layerSpeed layer
Lambda style
source: https://spark-summit.org/2014/wp-content/uploads/2014/07/Lambda-Architecture-Jim-Scott..pdf
code-on-
demand
client-server
cache
statelesslayered
system
uniform
interface
REST
constraints
(in www)
Event Sourcing pattern
source: https://msdn.microsoft.com/en-us/library/dn589792.aspx
Command Query Responsibility
Segregation (CQRS) pattern
source: https://msdn.microsoft.com/en-us/library/jj591573.da82141c...
Microservices = “fine
grained SOA” or “SOA 2.0”
Microservices is an
architectural style
Complex application =
composed of tiny services
Communicate over REST API
HTTPGET
HTTPPUT
HTTP POST
HTTPDELETE
Underlying philosophy
“do one thing and do it well”
Monolithic
Microservices
Conway’s law
“Any organization that designs a
system… will inevitably produce
a design whose structure is a
copy of the or...
Conway’s law
Team 1
Team 2Team 3
Team 4
Conway’s law
Team 1 Team 2
Team 3
Team 4
Monolithic to microservices
Monolithic to microservices
Service = manageable by
“two pizza” team
Service = a team can DURS
(Deploy, Update, Replace, Scale)
Microservices = Damn U R Sexy
Amazon case study
2-tier
architecture
SOA Microservices
email sgganesh@gmail.com
website www.designsmells.com
twitter @GSamarthyam
linkedin bit.ly/sgganesh
slideshare slideshare....
Modern Software Architecture Styles and Patterns
Modern Software Architecture Styles and Patterns
Modern Software Architecture Styles and Patterns
Upcoming SlideShare
Loading in …5
×

Modern Software Architecture Styles and Patterns

3,815 views

Published on

Here is a presentation that covers modern software architecture styles and patterns such as microservices, CQRS and event sourcing.

Published in: Software
  • Login to see the comments

Modern Software Architecture Styles and Patterns

  1. 1. MODERN SOFTWARE ARCHITECTURE styles and patterns
  2. 2. – Roy Fielding “an architectural style is a co-ordinated set of architectural constraints that restricts the roles/ features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style” R.T.Fielding “Architectural styles and the design of network-based software architectures. PhD thesis, University of California, 2000.
  3. 3. POSA - before and after
  4. 4. Layered Pipe-and-Filter Broker Client-Server Peer-to-Peer Blackboard
  5. 5. $ cat limerick.txt There was a young lady of Niger Who smiled as she rode on a tiger. They returned from the ride With the lady inside And a smile on the face of the tiger.
  6. 6. $ cat limerick.txt | tr -cs "[:alpha:]" "n" | awk '{print length(), $0}' | sort | uniq 1 a 2 as 2 of 2 on 3 And 3 Who 3 she 3 the 3 was 4 They 4 With 4 face 4 from 4 lady 4 ride 4 rode 5 Niger 5 There 5 smile 5 tiger 5 young 6 inside 6 smiled 8 returned
  7. 7. List<String> lines = Files.readAllLines(Paths.get("./limerick.txt"), Charset.defaultCharset()); Map<Integer, List<String>> wordGroups = lines.stream() .map(line -> line.replaceAll("W", "n").split("n")) .flatMap(Arrays::stream) .sorted() .distinct() .collect(Collectors.groupingBy(String::length)); wordGroups.forEach( (count, words) -> { words.forEach(word -> System.out.printf("%d %s %n", count, word)); }); 1 a 2 as 2 of 2 on 3 And 3 Who 3 she 3 the 3 was 4 They 4 With 4 face 4 from 4 lady 4 ride 4 rode 5 Niger 5 There 5 smile 5 tiger 5 young 6 inside 6 smiled 8 returned
  8. 8. What architectural style is this?
  9. 9. Real-world pipes-and-filters sediment pre- carbon ultra-filter post- carbon Filtered water
  10. 10. Pipe-and-filter: Benefits + Flexibility by filter exchange + Flexibility by recombination + Reuse of filter components + Rapid prototyping of pipelines Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal. 1996. Pattern-Oriented Software Architecture: A System of Patterns. John Wiley & Sons, Inc., NY, USA.
  11. 11. Pipe-and-filter: Liabilities - Sharing state information is expensive or inflexible - Efficiency gain by parallel processing is often an illusion - Data transformation overhead - Difficult to handle errors Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal. 1996. Pattern-Oriented Software Architecture: A System of Patterns. John Wiley & Sons, Inc., NY, USA.
  12. 12. What is the architecture style followed by World Wide Web (WWW)?
  13. 13. SOA (Service Oriented Architecture) Lambda Style Microservices REST (Representational State Transfer) Map-Reduce CQRS (Command-Query Responsibility Segregation ) Software Containers Event Sourcing
  14. 14. List<String> lines = Files.readAllLines(Paths.get("./limerick.txt"), Charset.defaultCharset()); Map<Integer, List<String>> wordGroups = lines.parallelStream() .map(line -> line.replaceAll("W", "n").split("n")) .flatMap(Arrays::stream) .sorted() .distinct() .collect(Collectors.groupingBy(String::length)); wordGroups.forEach( (count, words) -> { words.forEach(word -> System.out.printf("%d %s %n", count, word)); }); 1 a 2 as 2 of 2 on 3 And 3 Who 3 she 3 the 3 was 4 They 4 With 4 face 4 from 4 lady 4 ride 4 rode 5 Niger 5 There 5 smile 5 tiger 5 young 6 inside 6 smiled 8 returned
  15. 15. Java: Fork-join framework
  16. 16. Map-Reduce pattern Input Sara Booch Thayer Merlin Sara Ralph Merlin Tim Sara Christian Ralph Cormen … Computer Cluster map map map Sara, 1 Ralph, 1 Merlin, 1 Tim, 1 Sara, 1 Booch, 1 Thayer, 1 Merlin, 1 Sara, 1 Christian, 1 Ralph, 1 Cormen, 1 reduce reduce Sara, 3 Booch, 1 Thayer,1 Merlin, 2 Ralph, 2 Tim, 1 Christian, 1 Cormen, 1 … OutputSara, 1 Sara, 1 Sara, 1 Booch, 1 Thayer, 1 Merlin, 1 Merlin, 1 Ralph, 1 Ralph, 1 Tim, 1 Christian, 1 Cormen, 1
  17. 17. Lambda style Batch layer Serving layerSpeed layer
  18. 18. Lambda style source: https://spark-summit.org/2014/wp-content/uploads/2014/07/Lambda-Architecture-Jim-Scott..pdf
  19. 19. code-on- demand client-server cache statelesslayered system uniform interface REST constraints (in www)
  20. 20. Event Sourcing pattern source: https://msdn.microsoft.com/en-us/library/dn589792.aspx
  21. 21. Command Query Responsibility Segregation (CQRS) pattern source: https://msdn.microsoft.com/en-us/library/jj591573.da82141c6f9950d64c1263fa4da825ec(l=en-us).png
  22. 22. Microservices = “fine grained SOA” or “SOA 2.0”
  23. 23. Microservices is an architectural style
  24. 24. Complex application = composed of tiny services
  25. 25. Communicate over REST API HTTPGET HTTPPUT HTTP POST HTTPDELETE
  26. 26. Underlying philosophy “do one thing and do it well”
  27. 27. Monolithic
  28. 28. Microservices
  29. 29. Conway’s law “Any organization that designs a system… will inevitably produce a design whose structure is a copy of the organization's communication structure”
  30. 30. Conway’s law Team 1 Team 2Team 3 Team 4
  31. 31. Conway’s law Team 1 Team 2 Team 3 Team 4
  32. 32. Monolithic to microservices
  33. 33. Monolithic to microservices
  34. 34. Service = manageable by “two pizza” team
  35. 35. Service = a team can DURS (Deploy, Update, Replace, Scale) Microservices = Damn U R Sexy
  36. 36. Amazon case study 2-tier architecture SOA Microservices
  37. 37. email sgganesh@gmail.com website www.designsmells.com twitter @GSamarthyam linkedin bit.ly/sgganesh slideshare slideshare.net/sgganesh

×