SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
Aesthetics & the Beauty of
an Architecture
Adventures in CQRS & Event Sourcing
Tom Scott
@tomwscott
What’s in it for you?

• Understanding of CQRS & Event Sourcing in
the wild

• The mistakes we made…
• … the lessons we learnt …
• … and why we’re still happy!
rob.knight
1

art |ɑːt|
noun
1 [ mass noun ] the expression or application of human creative
skill and imagination, typically in a visual form such as painting
or sculpture, producing works to be appreciated primarily for their
beauty or emotional power
1

art |ɑːt|
noun
1 [ mass noun ] the expression or application of human creative
skill and imagination, typically in a visual form such as painting
or sculpture, producing works to be appreciated primarily for their
beauty or emotional power
Aesthetics
Aesthetics

Scott’s Purely Arbitrary Criteria, Etceteras
For Evaluating Beautiful Architectures

#SPACE_FEBA
Fully Operational
Simplicity

echerries
Commitment

justageek
Deferring Commitment

justageek
Metaphor

Petar Pavlov - http://bit.ly/9ySEUt
Discipline & Consistency
Serendipity

kathryn_rotondo
#SPACE_FEBA

• Fully Operational
• Simplicity
• Deferred
Commitment


• Metaphor
• Discipline
• Serendipity
Price Comparison

££
The evolution of a system
Presentation

Application

Database





|
The Solution

archer10
Architectural Goals

• Structured
• Horizontal
Scalability

• Availability &
Reliability


• Visibility /

Monitorability

• Flexibility &

Replaceability

archer10
The Mandate!

• Service Oriented
Architecture

• Domain Driven
Design

• Micro-Services


• Continuous
Delivery

• Oh and one more
thing!

archer10
Domain Driven Design

• Entity
• Value Object
• Aggregate
• Service


• Repository
• Factory
• Bounded Context

archer10
Domain Driven Design

• Entity
• Value Object
• Aggregate
• Service


• Repository
• Factory
• Bounded Context

archer10
Service Oriented Architecture






Understand your Domain







Home
Journey

Panel

Quote
Engine

Risk

Enquiry

Provider
Quote
T

d?
En
he
Just one more thing…

http://m.cdn.blog.hu/ke/kedvessigmund/image/columbo.jpg
CQRS & Event Sourcing

• CQRS or “Why do we use the same schema
for reads and writes?”

• Event Sourcing or “Why do we allow ORMs to
dictate our object model?”

archer10
CQRS
Command Query Responsibility Segregation





}

}

write

read
Use SQL?




{	
  
{	
  
	
  	
  	
  	
  “_id”	
  :	
  “590b9902”,	
  
UPDATE	
  Address	
  	
  
	
  	
  	
  	
  “_id”	
  :	
  “590b9902”,	
  
	
  	
  	
  	
  “event”	
  :	
  “AddressModified”,	
  
SET	
  	
   umber	
  =	
  10,	
  	
  
n
	
  	
  	
  	
  “event”	
  :	
  “PolicySpecified”,	
  
	
  	
  	
  	
  “data”	
  :	
  {	
  
	
   	
  	
  	
  street	
  =	
  ‘Downing	
  Street’,	
  
	
  	
  	
  	
  “data”	
  :	
  {	
  
	
  	
  	
  	
  	
   “number”	
  :	
  10,	
  
c
	
  	
  	
  	
  	
   “type”	
  :	
  “ContentsInsurance”,	
  
	
   	
  	
  	
  	
  	
   ity	
  =	
  ‘London’,	
  
	
   “street”	
  :	
  “Downing	
  Street”,	
  
p
	
   	
  	
  	
  	
  	
   ostcode	
  =	
  ‘SW1A	
  2AA’	
  
	
   “excess”	
  :	
  750	
  
	
  	
  	
  	
  	
  	
  “city”	
  :	
  “London”,	
  
	
   WHERE	
  _id	
  =	
  ‘590b9902’
	
  }	
  “postcode”	
  :	
  “SW1A	
  2AA”	
  
	
  
} 	
  }	
  
	
  
}
Event Sourcing (C#)
	
  	
  	
  public	
  class	
  Customer	
  :	
  AggregateRoot	
  
	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  private	
  readonly	
  Guid	
  id;	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  private	
  Address	
  currentAddress;	
  
	
   	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Business	
  Logic	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  ChangeAddress(Address	
  newAddress)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
   	
   	
  
	
  	
  	
  	
  if	
  (newAddress.IsValid())	
  	
  
	
   	
   	
  
	
  
{	
   	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  
Raise(new	
  AddressModified(id,	
  newAddress));	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
   	
   	
  
	
  
}	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  	
  	
  	
  	
  	
  	
  	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  //	
  State	
  Transition	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  Apply(AddressModified	
  @event)	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  currentAddress	
  =	
  @event.Address;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  

!
!

	
   	
   	
  

!
!

......	
  

	
  	
  	
  	
  	
  	
  	
  	
  //	
  Business	
  Logic	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  SpecifyCommunicationPreferences(CommunicationPrefs	
  preferences)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Raise(new	
  CommunicationPreferencesSpecified(id,	
  preferences));	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
   	
   	
  
	
  
	
  
Eventual Consistency



POST /risk/new HTTP/1.1 302 !
GET /risk/590b9902:v1
Location: /risk/590b9902:v1
What we ended up with:













The Conclusion

tim_norris
?
Simple

Metaphor

?
Discipline

Commitment

+

Fully Operational

Serendipity
The Power!

	
  	
  	
  public	
  class	
  Customer	
  :	
  AggregateRoot	
  
	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  private	
  readonly	
  Guid	
  id;	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  private	
  Address	
  currentAddress;	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  ChangeAddress(Address	
  newAddress)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Raise(new	
  AddressModified(id,	
  newAddress));	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  Apply(AddressModified	
  @event)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  currentAddress	
  =	
  @event.Address;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }
The Power!
	
  	
  	
  public	
  class	
  Customer	
  :	
  AggregateRoot	
  
	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  private	
  readonly	
  Guid	
  id;	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  private	
  Address	
  currentAddress;	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  ChangeAddress(Address	
  newAddress)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (currentAddress.IsSignificantlyDifferentFrom(newAddress))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Raise(new	
  CustomerMoved(id,	
  newAddress));	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Raise(new	
  AddressModified(id,	
  newAddress));	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  Apply(CustomerMoved	
  @event)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  currentAddress	
  =	
  @event.Address;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  

!

	
  	
  	
  	
  	
  	
  	
  	
  public	
  void	
  Apply(AddressModified	
  @event)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  currentAddress	
  =	
  @event.Address;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }
The Flexibility!
var	
  connection	
  =	
  rabbit.createConnection({	
  url:	
  ‘amqp://localhost:5672'	
  })	
  

!

connection.on('ready',	
  function	
  ()	
  {	
  
	
  	
  	
  	
  console.info('Connected');	
  
	
  	
  	
  	
  exchange	
  =	
  connection.exchange('SOURCE:Exchange',	
  {	
  'type':	
  'topic',	
  durable:	
  true	
  },	
  function	
  
()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  var	
  queue	
  =	
  connection.queue('PROJECTION:Map',	
  {	
  durable:	
  false,	
  exclusive:	
  true	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  function	
  ()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  console.info("Joined	
  Queue");	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  queue.subscribe(function	
  (message,	
  headers,	
  deliveryInfo)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  policyDetails	
  =	
  JSON.parse(message.data.toString());	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  io.sockets.emit('postcode',	
  policyDetails.Address.Postcode);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  });	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  queue.bind(exchange.name,	
  'AddressDetailsSpecified');	
  
	
  	
  	
  	
  	
  	
  	
  	
  });	
  
	
  	
  	
  	
  	
  	
  	
  	
  queue.on('queueBindOk',	
  function	
  ()	
  {	
  console.info('Bound	
  queue	
  to	
  exchange');	
  });	
  
	
  	
  	
  	
  });	
  

!

});
Is it a silver bullet?
Lessons Learnt

• Prefer simpler communication protocols
• Messaging == Push == Transient,
• HTTP == Pull == Permanent
• Difficult to evolve Domain Events
• Events as the system contract
rob.knight
ha
T

u!
Yo
nk

Tom Scott
@tomwscott

Contenu connexe

Tendances

Theory of architecture
Theory of architectureTheory of architecture
Theory of architectureKrishna Jhawar
 
Late modern architecture and post modern architecture
Late modern architecture and post modern architectureLate modern architecture and post modern architecture
Late modern architecture and post modern architectureOnal Kothari
 
Architectural design
Architectural designArchitectural design
Architectural designSunita Sinha
 
Site approach and building entrance
Site approach and building entranceSite approach and building entrance
Site approach and building entranceshahul130103
 
Sustainable architecture and green design (passive design)
Sustainable architecture and green design (passive design)Sustainable architecture and green design (passive design)
Sustainable architecture and green design (passive design)cagrihank
 
Architectural design - FORM AND SPACE
Architectural design - FORM AND SPACEArchitectural design - FORM AND SPACE
Architectural design - FORM AND SPACEBimenpreet Kaur
 
Rationalism Architecture
Rationalism ArchitectureRationalism Architecture
Rationalism ArchitectureMayur Waghulde
 
Toilet and Bath Working Drawing
Toilet and Bath Working DrawingToilet and Bath Working Drawing
Toilet and Bath Working DrawingGeeva Chandana
 
TADAO ANDO - ARCHITECT OF LIGHT
TADAO ANDO - ARCHITECT OF LIGHTTADAO ANDO - ARCHITECT OF LIGHT
TADAO ANDO - ARCHITECT OF LIGHTNidhi Thigale
 
Advance structural system. pptx
Advance structural system. pptxAdvance structural system. pptx
Advance structural system. pptxShivani Nandgowle
 

Tendances (20)

Zaha Hadid's Architecture of Form
Zaha Hadid's Architecture of FormZaha Hadid's Architecture of Form
Zaha Hadid's Architecture of Form
 
Theory of architecture
Theory of architectureTheory of architecture
Theory of architecture
 
Late modern architecture and post modern architecture
Late modern architecture and post modern architectureLate modern architecture and post modern architecture
Late modern architecture and post modern architecture
 
Biophilic architecture
Biophilic architectureBiophilic architecture
Biophilic architecture
 
Biophilic Design
Biophilic DesignBiophilic Design
Biophilic Design
 
Architectural design
Architectural designArchitectural design
Architectural design
 
Site approach and building entrance
Site approach and building entranceSite approach and building entrance
Site approach and building entrance
 
Green Architecture
Green ArchitectureGreen Architecture
Green Architecture
 
Deconstructivism
DeconstructivismDeconstructivism
Deconstructivism
 
Design principal
Design principalDesign principal
Design principal
 
Sustainable architecture and green design (passive design)
Sustainable architecture and green design (passive design)Sustainable architecture and green design (passive design)
Sustainable architecture and green design (passive design)
 
Architectural design - FORM AND SPACE
Architectural design - FORM AND SPACEArchitectural design - FORM AND SPACE
Architectural design - FORM AND SPACE
 
Rationalism Architecture
Rationalism ArchitectureRationalism Architecture
Rationalism Architecture
 
Toilet and Bath Working Drawing
Toilet and Bath Working DrawingToilet and Bath Working Drawing
Toilet and Bath Working Drawing
 
HITECH ARCHITECTURE
HITECH ARCHITECTUREHITECH ARCHITECTURE
HITECH ARCHITECTURE
 
Le corbusier - A Brief
Le corbusier - A BriefLe corbusier - A Brief
Le corbusier - A Brief
 
Architectural concepts
Architectural conceptsArchitectural concepts
Architectural concepts
 
TADAO ANDO - ARCHITECT OF LIGHT
TADAO ANDO - ARCHITECT OF LIGHTTADAO ANDO - ARCHITECT OF LIGHT
TADAO ANDO - ARCHITECT OF LIGHT
 
Advance structural system. pptx
Advance structural system. pptxAdvance structural system. pptx
Advance structural system. pptx
 
Residential Design Portfolio
Residential Design PortfolioResidential Design Portfolio
Residential Design Portfolio
 

En vedette

Case Study - Transport for NSW - Old for New
Case Study - Transport for NSW - Old for NewCase Study - Transport for NSW - Old for New
Case Study - Transport for NSW - Old for NewRowan Tombs
 
Intro to Arch Week 4 [compatibility mode]
Intro to Arch Week 4 [compatibility mode]Intro to Arch Week 4 [compatibility mode]
Intro to Arch Week 4 [compatibility mode]Hamdija Velagic
 
City of San Antonio Historic Design Guidelines
City of San Antonio Historic Design GuidelinesCity of San Antonio Historic Design Guidelines
City of San Antonio Historic Design GuidelinesBecentro Bedowntown
 
Aesthetic of Street Environment and the link to pedestrian activity poster
Aesthetic of Street Environment and the link to pedestrian activity posterAesthetic of Street Environment and the link to pedestrian activity poster
Aesthetic of Street Environment and the link to pedestrian activity posteraswin2812
 
Cc 5 14-13 - design and historic review commission
Cc 5 14-13 - design and historic review commissionCc 5 14-13 - design and historic review commission
Cc 5 14-13 - design and historic review commissionCity of San Angelo Texas
 
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...Eduardo Zilles Borba
 
Historic Preservation - City Studios Architecture
Historic Preservation - City Studios ArchitectureHistoric Preservation - City Studios Architecture
Historic Preservation - City Studios ArchitectureHeritage Ohio
 
Urban Decay and Collective Memory
Urban Decay and Collective MemoryUrban Decay and Collective Memory
Urban Decay and Collective MemoryKanelia Koutsandrea
 
Reading Cultural Landscapes
Reading Cultural LandscapesReading Cultural Landscapes
Reading Cultural LandscapesSally Longford
 
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016RI_FMA
 
The Studentification of Urban Space
The Studentification of Urban SpaceThe Studentification of Urban Space
The Studentification of Urban SpaceTina Richardson
 
The Future of LEED and Historic Preservation
The Future of LEED and Historic PreservationThe Future of LEED and Historic Preservation
The Future of LEED and Historic PreservationBrian Rich
 
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...Regional Science Academy
 
Cultural Landscape
Cultural LandscapeCultural Landscape
Cultural LandscapeE. Rueber
 
Ratio, variation and proportion
Ratio, variation and proportionRatio, variation and proportion
Ratio, variation and proportionMalikahmad105
 
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 Aesthetics
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 AestheticsArchitectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 Aesthetics
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 AestheticsGalala University
 
Activities and materials to encourage aesthetic development through
Activities and materials to encourage aesthetic development throughActivities and materials to encourage aesthetic development through
Activities and materials to encourage aesthetic development throughsaba_kese
 

En vedette (20)

Aesthetics
AestheticsAesthetics
Aesthetics
 
Case Study - Transport for NSW - Old for New
Case Study - Transport for NSW - Old for NewCase Study - Transport for NSW - Old for New
Case Study - Transport for NSW - Old for New
 
Intro to Arch Week 4 [compatibility mode]
Intro to Arch Week 4 [compatibility mode]Intro to Arch Week 4 [compatibility mode]
Intro to Arch Week 4 [compatibility mode]
 
City of San Antonio Historic Design Guidelines
City of San Antonio Historic Design GuidelinesCity of San Antonio Historic Design Guidelines
City of San Antonio Historic Design Guidelines
 
Aesthetic of Street Environment and the link to pedestrian activity poster
Aesthetic of Street Environment and the link to pedestrian activity posterAesthetic of Street Environment and the link to pedestrian activity poster
Aesthetic of Street Environment and the link to pedestrian activity poster
 
Cc 5 14-13 - design and historic review commission
Cc 5 14-13 - design and historic review commissionCc 5 14-13 - design and historic review commission
Cc 5 14-13 - design and historic review commission
 
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...
Urban space design in virtual worlds. An analyses to the aesthetic-spatial an...
 
Historic Preservation - City Studios Architecture
Historic Preservation - City Studios ArchitectureHistoric Preservation - City Studios Architecture
Historic Preservation - City Studios Architecture
 
Urban Decay and Collective Memory
Urban Decay and Collective MemoryUrban Decay and Collective Memory
Urban Decay and Collective Memory
 
Reading Cultural Landscapes
Reading Cultural LandscapesReading Cultural Landscapes
Reading Cultural Landscapes
 
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016
Reinventing Urban Landscapes with Green Infrastructure_RIFMA2016
 
The Studentification of Urban Space
The Studentification of Urban SpaceThe Studentification of Urban Space
The Studentification of Urban Space
 
The Future of LEED and Historic Preservation
The Future of LEED and Historic PreservationThe Future of LEED and Historic Preservation
The Future of LEED and Historic Preservation
 
Smart Environment - understanding and meaning
Smart Environment  - understanding and meaningSmart Environment  - understanding and meaning
Smart Environment - understanding and meaning
 
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...
The Cultural/Historic Urban Landscape: A Resource for Urban Regeneration and ...
 
Cultural Landscape
Cultural LandscapeCultural Landscape
Cultural Landscape
 
Ratio, variation and proportion
Ratio, variation and proportionRatio, variation and proportion
Ratio, variation and proportion
 
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 Aesthetics
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 AestheticsArchitectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 Aesthetics
Architectural Design 1 Lectures by Dr. Yasser Mahgoub - Lecture 10 Aesthetics
 
Activities and materials to encourage aesthetic development through
Activities and materials to encourage aesthetic development throughActivities and materials to encourage aesthetic development through
Activities and materials to encourage aesthetic development through
 
Understanding Our Environment
Understanding Our EnvironmentUnderstanding Our Environment
Understanding Our Environment
 

Similaire à Aesthetics and the Beauty of an Architecture

TDC2016SP - Trilha .NET
TDC2016SP - Trilha .NETTDC2016SP - Trilha .NET
TDC2016SP - Trilha .NETtdc-globalcode
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
 
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Ismael Celis
 
Eve - REST API for Humans™
Eve - REST API for Humans™Eve - REST API for Humans™
Eve - REST API for Humans™Nicola Iarocci
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"LogeekNightUkraine
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silexMichele Orselli
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedMarcinStachniuk
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile servicesAymeric Weinbach
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group RheinlandDavid Schmitz
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Wann soll ich mocken?
Wann soll ich mocken?Wann soll ich mocken?
Wann soll ich mocken?David Völkel
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennJavaDayUA
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedMarcinStachniuk
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in SwiftPeter Friese
 

Similaire à Aesthetics and the Beauty of an Architecture (20)

TDC2016SP - Trilha .NET
TDC2016SP - Trilha .NETTDC2016SP - Trilha .NET
TDC2016SP - Trilha .NET
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
 
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
 
Eve - REST API for Humans™
Eve - REST API for Humans™Eve - REST API for Humans™
Eve - REST API for Humans™
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Writing Good Tests
Writing Good TestsWriting Good Tests
Writing Good Tests
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silex
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile services
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group Rheinland
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Wann soll ich mocken?
Wann soll ich mocken?Wann soll ich mocken?
Wann soll ich mocken?
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
Intro to Sail.js
Intro to Sail.jsIntro to Sail.js
Intro to Sail.js
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 

Dernier

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Aesthetics and the Beauty of an Architecture

  • 1. Aesthetics & the Beauty of an Architecture Adventures in CQRS & Event Sourcing Tom Scott @tomwscott
  • 2. What’s in it for you? • Understanding of CQRS & Event Sourcing in the wild • The mistakes we made… • … the lessons we learnt … • … and why we’re still happy! rob.knight
  • 3. 1 art |ɑːt| noun 1 [ mass noun ] the expression or application of human creative skill and imagination, typically in a visual form such as painting or sculpture, producing works to be appreciated primarily for their beauty or emotional power
  • 4. 1 art |ɑːt| noun 1 [ mass noun ] the expression or application of human creative skill and imagination, typically in a visual form such as painting or sculpture, producing works to be appreciated primarily for their beauty or emotional power
  • 6. Aesthetics Scott’s Purely Arbitrary Criteria, Etceteras For Evaluating Beautiful Architectures #SPACE_FEBA
  • 11. Metaphor Petar Pavlov - http://bit.ly/9ySEUt
  • 14. #SPACE_FEBA • Fully Operational • Simplicity • Deferred Commitment
 • Metaphor • Discipline • Serendipity
  • 16. The evolution of a system Presentation Application Database   |
  • 18. Architectural Goals • Structured • Horizontal Scalability • Availability & Reliability
 • Visibility / Monitorability • Flexibility & Replaceability archer10
  • 19. The Mandate! • Service Oriented Architecture • Domain Driven Design • Micro-Services
 • Continuous Delivery • Oh and one more thing! archer10
  • 20. Domain Driven Design • Entity • Value Object • Aggregate • Service
 • Repository • Factory • Bounded Context archer10
  • 21. Domain Driven Design • Entity • Value Object • Aggregate • Service
 • Repository • Factory • Bounded Context archer10
  • 25. Just one more thing… http://m.cdn.blog.hu/ke/kedvessigmund/image/columbo.jpg
  • 26. CQRS & Event Sourcing • CQRS or “Why do we use the same schema for reads and writes?” • Event Sourcing or “Why do we allow ORMs to dictate our object model?” archer10
  • 27. CQRS
  • 28. Command Query Responsibility Segregation   } } write read
  • 29. Use SQL?   {   {          “_id”  :  “590b9902”,   UPDATE  Address            “_id”  :  “590b9902”,          “event”  :  “AddressModified”,   SET     umber  =  10,     n        “event”  :  “PolicySpecified”,          “data”  :  {          street  =  ‘Downing  Street’,          “data”  :  {             “number”  :  10,   c           “type”  :  “ContentsInsurance”,               ity  =  ‘London’,     “street”  :  “Downing  Street”,   p             ostcode  =  ‘SW1A  2AA’     “excess”  :  750              “city”  :  “London”,     WHERE  _id  =  ‘590b9902’  }  “postcode”  :  “SW1A  2AA”     }  }     }
  • 30. Event Sourcing (C#)      public  class  Customer  :  AggregateRoot        {                  private  readonly  Guid  id;   !                private  Address  currentAddress;                                  //  Business  Logic                  public  void  ChangeAddress(Address  newAddress)                  {                if  (newAddress.IsValid())             {                                 Raise(new  AddressModified(id,  newAddress));                                 }                  }                 !                //  State  Transition                  public  void  Apply(AddressModified  @event)                    {                          currentAddress  =  @event.Address;                  }   ! !       ! ! ......                  //  Business  Logic                  public  void  SpecifyCommunicationPreferences(CommunicationPrefs  preferences)                  {                          Raise(new  CommunicationPreferencesSpecified(id,  preferences));                                  
  • 31. Eventual Consistency  POST /risk/new HTTP/1.1 302 ! GET /risk/590b9902:v1 Location: /risk/590b9902:v1
  • 32. What we ended up with:       
  • 35. The Power!      public  class  Customer  :  AggregateRoot        {                  private  readonly  Guid  id;   !                private  Address  currentAddress;   !                public  void  ChangeAddress(Address  newAddress)                  {                                              Raise(new  AddressModified(id,  newAddress));                                        }   !                public  void  Apply(AddressModified  @event)                  {                          currentAddress  =  @event.Address;                  }          }
  • 36. The Power!      public  class  Customer  :  AggregateRoot        {                  private  readonly  Guid  id;   !                private  Address  currentAddress;   !                public  void  ChangeAddress(Address  newAddress)                  {                          if  (currentAddress.IsSignificantlyDifferentFrom(newAddress))                          {                                  Raise(new  CustomerMoved(id,  newAddress));                          }                          else                          {                                  Raise(new  AddressModified(id,  newAddress));                          }                  }   !                public  void  Apply(CustomerMoved  @event)                  {                          currentAddress  =  @event.Address;                  }   !                public  void  Apply(AddressModified  @event)                  {                          currentAddress  =  @event.Address;                  }          }
  • 37. The Flexibility! var  connection  =  rabbit.createConnection({  url:  ‘amqp://localhost:5672'  })   ! connection.on('ready',  function  ()  {          console.info('Connected');          exchange  =  connection.exchange('SOURCE:Exchange',  {  'type':  'topic',  durable:  true  },  function   ()  {                  var  queue  =  connection.queue('PROJECTION:Map',  {  durable:  false,  exclusive:  true  },                  function  ()  {                          console.info("Joined  Queue");                          queue.subscribe(function  (message,  headers,  deliveryInfo)  {                                  var  policyDetails  =  JSON.parse(message.data.toString());                                  io.sockets.emit('postcode',  policyDetails.Address.Postcode);                          });                          queue.bind(exchange.name,  'AddressDetailsSpecified');                  });                  queue.on('queueBindOk',  function  ()  {  console.info('Bound  queue  to  exchange');  });          });   ! });
  • 38. Is it a silver bullet?
  • 39. Lessons Learnt • Prefer simpler communication protocols • Messaging == Push == Transient, • HTTP == Pull == Permanent • Difficult to evolve Domain Events • Events as the system contract rob.knight