SlideShare a Scribd company logo
THE NEVER CHANGING FACE OF
IMMUTABILITY
CHRIS HOWE-JONES
@AGILE_GEEK
15TH DECEMBER 2015
WARNING!!
There will be a Lisp!
There will be Entomology!
There will be History!
THE NEVER CHANGING FACE OF IMMUTABILITY
WHO AM I?
Name: Chris Howe-Jones
Job Title: Technical Navigator
Twitter: @agile_geek
Github: github.com/chrishowejones
Blog: chrishowejones.wordpress.com
CREDENTIALS
28 years of pushing data around
Procedural/OOP/FP
Architecture & Design
RAD/Agile/Lean
CTO
HISTORY LESSON
ONCE UPON A TIME..
Book Keeping
List of entries in a ledger No 'crossing out'!
DAWN OF COMPUTING
Math
Transient storage
60'S-90'S
Spot the expense? Memory Tape Disk
21ST CENTURY
Spot the expense?
Developers
Cheap resources: SSD/Disk, Memory, CPU
AND..
IN PLACE COMPUTING
Update data in place Reuse expensive real estate
RDBMS
Data updated Values overwritten Reuse memory and disk
RESULT?
In place oriented programming (PLOP) relies on…
MUTATION
WHICH LEADS TO..
COMPLECT
Complecting Identity & Value Especially RDBMS, OOP
Pessimistic concurrency strategies
WHAT'S CHANGED?
Computing capacity has increased by a million fold!
IMMUTABILITY (AND VALUES) TO THE RESCUE!
VALUES
Values are generic
Values are easy to fabricate
Drives reuse
Values aggregate to values
Distributable
ISN'T COPYING VALUES INEFFICIENT?
Structural sharing
For example in Clojure:
persistent bit-partitioned vector trie
32 node tries
Wide shallow trees
WHAT DOES IT LOOK LIKE?
Immutable by default
Explicit state change
Database as a value
CLOJURESCRIPT ON THE CLIENT
(def initial-state
{:event {:event/name "" :event/speaker ""} :server-state nil})
(defn- event-form
[ui-channel {:keys [event/name event/speaker] :as event}]
[:table.table
[:tr
[:td [:label "Event name:"]]
[:td [:input {:type :text
:placeholder "Event name..."
:defaultValue event/name
:on-change (send-value! ui-channel m/->ChangeEventName)}]]]
[:tr
[:td [:label "Speaker:"]]
[:td [:input {:type :text
:placeholder "Speaker..."
:defaultValue event/speaker
:on-change (send-value! ui-channel m/->ChangeEventSpeaker)}]]]
[:tr
[:td
[:button.btn.btn-success
{:on-click (send! ui-channel (m/->CreateEvent))}
"Go"]]]])
(defrecord ChangeEventName [name])
(defrecord ChangeEventSpeaker [speaker])
(defrecord CreateEvent [event])
(defrecord CreateEventResults [body])
(extend-protocol Message
m/ChangeEventName
(process-message [{:keys [name]} app]
(assoc-in app [:event :event/name] name)))
;; redacted for clarity ...
(extend-protocol EventSource
m/CreateEvent
(watch-channels [_ {:keys [event]
:as app}]
#{(rest/create-event event)}))
(extend-protocol Message
m/CreateEventResults
(process-message [response app]
(assoc app :server-state (-> response :body))))
EFFICIENCY
CLOJURE ON THE SERVER
(defn- handle-query
[db-conn]
(fn [{req-body :body-params}]
{:body (case (:type req-body)
:get-events (data/get-events db-conn)
:create-event (data/create-entity db-conn (:txn-data req-body)))}))
(defn app [dbconn]
(-> (routes
(GET "/" [] home-page)
(POST "/q" []
(handle-query dbconn))
(resources "/"))
(wrap-restful-format :formats [:edn :transit-json])
(rmd/wrap-defaults (-> rmd/site-defaults
(assoc-in [:security :anti-forgery] false)))))
DATOMIC FOR DATA
App get's its own query, comms, memory- Each App is a peer
DATABASE AS A VALUE
Entity Attribute Value Time
Fiona likes Ruby 01/06/2015
Dave likes Haskell 25/09/2015
Fiona likes Clojure 15/12/2015
       
       
Effectively DB is local
Datalog query language
[:find ?e :where [?e :likes “Clojure”]]
SCHEMA
;;event
{
:db/id #db/id[:db.part/db]
:db/ident :event/name
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db.install/_attribute :db.part/db
}
{
:db/id #db/id[:db.part/db]
:db/ident :event/description
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db.install/_attribute :db.part/db
}
{
:db/id #db/id[:db.part/db]
:db/ident :event/location
:db/cardinality :db.cardinality/one
:db/valueType :db.type/ref
:db.install/_attribute :db.part/db
}
...
;;location
{
:db/id #db/id[:db.part/db]
:db/ident :location/postCode
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db.install/_attribute :db.part/db
}
{
:db/id #db/id[:db.part/db]
:db/ident :location/description
:db/cardinality :db.cardinality/one
:db/valueType :db.type/string
:db.install/_attribute :db.part/db
}
...
PERSISTENCE
(defn create-entity
"Takes transaction data and returns the resolved tempid"
[conn tx-data]
(let [had-id (contains? tx-data ":db/id")
data-with-id (if had-id
tx-data
(assoc tx-data :db/id #db/id[:db.part/user -1000001]))
tx @(d/transact conn [data-with-id])]
(if had-id (tx-data ":db/id")
(d/resolve-tempid (d/db conn) (:tempids tx)
(d/tempid :db.part/user -1000001)))))
(defn get-events [db]
(d/pull-many db [:*]
(->> (d/q '{:find [?event-id]
:where [[?event-id :event/name]]}
db)
(map first))))
CONCLUSION?
Immutability simplifies
State as function call stack
Mostly pure functions
Easier to test & reason about
Time as first class concept
Easier to distribute
RESOURCES
Rich Hickey talks -
'The Value of Values'
'The Language of the System'
'Simple Made Easy'
'Clojure, Made Simple'
'The Database as a Value'
'The Language of Systems'
Moseley and Marks - Out of the Tar Pit
Kris Jenkins
'ClojureScript - Architecting for Scale' (Clojure eXchange 2015)

More Related Content

What's hot

A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
Dr. Volkan OBAN
 
CouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce ViewsCouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce Views
IBM Cloud Data Services
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Hidenori Fujimura
 
Api design
Api designApi design
Api design
Michael Francis
 
Building Maps with Leaflet
Building Maps with LeafletBuilding Maps with Leaflet
Building Maps with Leaflet
Andrew Howard
 
It’s about time to embrace Node.js Streams - Austin Node.js meetup
It’s about time to embrace Node.js Streams - Austin Node.js meetupIt’s about time to embrace Node.js Streams - Austin Node.js meetup
It’s about time to embrace Node.js Streams - Austin Node.js meetup
Luciano Mammino
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Vinh Nguyen
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Steven Pousty
 
When RegEx is not enough
When RegEx is not enoughWhen RegEx is not enough
When RegEx is not enough
Nati Cohen
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSteven Pousty
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
frewmbot
 
Simple tricks to speed you up on the command line
Simple tricks to speed you up on the command lineSimple tricks to speed you up on the command line
Simple tricks to speed you up on the command line
Janos Gyerik
 
Responsive Maps in WordPress
Responsive Maps in WordPressResponsive Maps in WordPress
Responsive Maps in WordPress
Alicia Duffy
 
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
IBM Cloud Data Services
 
Where can you dine like a king?
Where can you dine like a king?Where can you dine like a king?
Where can you dine like a king?
Stefan Keller
 
Swift and the BigData
Swift and the BigDataSwift and the BigData
Swift and the BigData
Carlos Alonso Pérez
 
LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js
drshade
 

What's hot (17)

A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
CouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce ViewsCouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce Views
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
 
Api design
Api designApi design
Api design
 
Building Maps with Leaflet
Building Maps with LeafletBuilding Maps with Leaflet
Building Maps with Leaflet
 
It’s about time to embrace Node.js Streams - Austin Node.js meetup
It’s about time to embrace Node.js Streams - Austin Node.js meetupIt’s about time to embrace Node.js Streams - Austin Node.js meetup
It’s about time to embrace Node.js Streams - Austin Node.js meetup
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
 
When RegEx is not enough
When RegEx is not enoughWhen RegEx is not enough
When RegEx is not enough
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
 
Simple tricks to speed you up on the command line
Simple tricks to speed you up on the command lineSimple tricks to speed you up on the command line
Simple tricks to speed you up on the command line
 
Responsive Maps in WordPress
Responsive Maps in WordPressResponsive Maps in WordPress
Responsive Maps in WordPress
 
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
 
Where can you dine like a king?
Where can you dine like a king?Where can you dine like a king?
Where can you dine like a king?
 
Swift and the BigData
Swift and the BigDataSwift and the BigData
Swift and the BigData
 
LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js LiveScript <| Rocking your world.js
LiveScript <| Rocking your world.js
 

Viewers also liked

Erlang
ErlangErlang
Swift: Immutability and You
Swift: Immutability and YouSwift: Immutability and You
Swift: Immutability and You
Jens Ravens
 
Doge-driven design
Doge-driven designDoge-driven design
Doge-driven design
Scott Wlaschin
 
The Theory of Chains
The Theory of ChainsThe Theory of Chains
The Theory of Chains
Scott Wlaschin
 
Swift vs. Language X
Swift vs. Language XSwift vs. Language X
Swift vs. Language X
Scott Wlaschin
 
Immutability in Scala
Immutability in ScalaImmutability in Scala
Immutability in Scala
BoldRadius Solutions
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013
Scott Wlaschin
 
Designing with capabilities (DDD-EU 2017)
Designing with capabilities (DDD-EU 2017)Designing with capabilities (DDD-EU 2017)
Designing with capabilities (DDD-EU 2017)
Scott Wlaschin
 
Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming Fundamentals
Shahriar Hyder
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
Scott Wlaschin
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)
Scott Wlaschin
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Scott Wlaschin
 
Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)
Scott Wlaschin
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scalapramode_ce
 

Viewers also liked (14)

Erlang
ErlangErlang
Erlang
 
Swift: Immutability and You
Swift: Immutability and YouSwift: Immutability and You
Swift: Immutability and You
 
Doge-driven design
Doge-driven designDoge-driven design
Doge-driven design
 
The Theory of Chains
The Theory of ChainsThe Theory of Chains
The Theory of Chains
 
Swift vs. Language X
Swift vs. Language XSwift vs. Language X
Swift vs. Language X
 
Immutability in Scala
Immutability in ScalaImmutability in Scala
Immutability in Scala
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013
 
Designing with capabilities (DDD-EU 2017)
Designing with capabilities (DDD-EU 2017)Designing with capabilities (DDD-EU 2017)
Designing with capabilities (DDD-EU 2017)
 
Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming Fundamentals
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
 
Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scala
 

Similar to The never changing face of immutability

Bidirectional Programming for Self-adaptive Software
Bidirectional Programming for Self-adaptive SoftwareBidirectional Programming for Self-adaptive Software
Bidirectional Programming for Self-adaptive Software
Lionel Montrieux
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
Kévin Margueritte
 
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube GoldbergReplacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
Danny Bryant
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with Scala
Oto Brglez
 
SparkR - Play Spark Using R (20160909 HadoopCon)
SparkR - Play Spark Using R (20160909 HadoopCon)SparkR - Play Spark Using R (20160909 HadoopCon)
SparkR - Play Spark Using R (20160909 HadoopCon)
wqchen
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
Simon Su
 
Keeping Spark on Track: Productionizing Spark for ETL
Keeping Spark on Track: Productionizing Spark for ETLKeeping Spark on Track: Productionizing Spark for ETL
Keeping Spark on Track: Productionizing Spark for ETL
Databricks
 
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Skilld
 
Express Presentation
Express PresentationExpress Presentation
Express Presentation
aaronheckmann
 
Make BDD great again
Make BDD great againMake BDD great again
Make BDD great again
Yana Gusti
 
Using Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsUsing Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion Dollars
Mike Pack
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
Andrew Liu
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
iguazio
 
Microsoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaMicrosoft R Server for Data Sciencea
Microsoft R Server for Data Sciencea
Data Science Thailand
 
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
DevOpsDays Tel Aviv
 
Google Cluster Innards
Google Cluster InnardsGoogle Cluster Innards
Google Cluster Innards
Martin Dvorak
 
Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQLData Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL
DATAVERSITY
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Zalando Technology
 
OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL Suraj Bang
 

Similar to The never changing face of immutability (20)

Bidirectional Programming for Self-adaptive Software
Bidirectional Programming for Self-adaptive SoftwareBidirectional Programming for Self-adaptive Software
Bidirectional Programming for Self-adaptive Software
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube GoldbergReplacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
Replacing Cron Jobs with EBS Concurrent Requests: Abandoning Rube Goldberg
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with Scala
 
SparkR - Play Spark Using R (20160909 HadoopCon)
SparkR - Play Spark Using R (20160909 HadoopCon)SparkR - Play Spark Using R (20160909 HadoopCon)
SparkR - Play Spark Using R (20160909 HadoopCon)
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
Clojure@Nuday
Clojure@NudayClojure@Nuday
Clojure@Nuday
 
Keeping Spark on Track: Productionizing Spark for ETL
Keeping Spark on Track: Productionizing Spark for ETLKeeping Spark on Track: Productionizing Spark for ETL
Keeping Spark on Track: Productionizing Spark for ETL
 
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
 
Express Presentation
Express PresentationExpress Presentation
Express Presentation
 
Make BDD great again
Make BDD great againMake BDD great again
Make BDD great again
 
Using Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsUsing Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion Dollars
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
 
Microsoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaMicrosoft R Server for Data Sciencea
Microsoft R Server for Data Sciencea
 
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
 
Google Cluster Innards
Google Cluster InnardsGoogle Cluster Innards
Google Cluster Innards
 
Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQLData Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
 
OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL
 

Recently uploaded

Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 

Recently uploaded (20)

Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 

The never changing face of immutability

  • 1. THE NEVER CHANGING FACE OF IMMUTABILITY CHRIS HOWE-JONES @AGILE_GEEK 15TH DECEMBER 2015
  • 2. WARNING!! There will be a Lisp! There will be Entomology! There will be History!
  • 3. THE NEVER CHANGING FACE OF IMMUTABILITY
  • 4. WHO AM I? Name: Chris Howe-Jones Job Title: Technical Navigator Twitter: @agile_geek Github: github.com/chrishowejones Blog: chrishowejones.wordpress.com
  • 5. CREDENTIALS 28 years of pushing data around Procedural/OOP/FP Architecture & Design RAD/Agile/Lean CTO
  • 7. ONCE UPON A TIME.. Book Keeping List of entries in a ledger No 'crossing out'!
  • 9. 60'S-90'S Spot the expense? Memory Tape Disk
  • 10. 21ST CENTURY Spot the expense? Developers Cheap resources: SSD/Disk, Memory, CPU
  • 11. AND..
  • 12. IN PLACE COMPUTING Update data in place Reuse expensive real estate
  • 13. RDBMS Data updated Values overwritten Reuse memory and disk
  • 14. RESULT? In place oriented programming (PLOP) relies on…
  • 17. COMPLECT Complecting Identity & Value Especially RDBMS, OOP Pessimistic concurrency strategies
  • 18. WHAT'S CHANGED? Computing capacity has increased by a million fold!
  • 19. IMMUTABILITY (AND VALUES) TO THE RESCUE!
  • 20. VALUES Values are generic Values are easy to fabricate Drives reuse Values aggregate to values Distributable
  • 21. ISN'T COPYING VALUES INEFFICIENT? Structural sharing For example in Clojure: persistent bit-partitioned vector trie 32 node tries Wide shallow trees
  • 22. WHAT DOES IT LOOK LIKE? Immutable by default Explicit state change Database as a value
  • 23. CLOJURESCRIPT ON THE CLIENT (def initial-state {:event {:event/name "" :event/speaker ""} :server-state nil}) (defn- event-form [ui-channel {:keys [event/name event/speaker] :as event}] [:table.table [:tr [:td [:label "Event name:"]] [:td [:input {:type :text :placeholder "Event name..." :defaultValue event/name :on-change (send-value! ui-channel m/->ChangeEventName)}]]] [:tr [:td [:label "Speaker:"]] [:td [:input {:type :text :placeholder "Speaker..." :defaultValue event/speaker :on-change (send-value! ui-channel m/->ChangeEventSpeaker)}]]] [:tr [:td [:button.btn.btn-success {:on-click (send! ui-channel (m/->CreateEvent))} "Go"]]]])
  • 24. (defrecord ChangeEventName [name]) (defrecord ChangeEventSpeaker [speaker]) (defrecord CreateEvent [event]) (defrecord CreateEventResults [body]) (extend-protocol Message m/ChangeEventName (process-message [{:keys [name]} app] (assoc-in app [:event :event/name] name))) ;; redacted for clarity ... (extend-protocol EventSource m/CreateEvent (watch-channels [_ {:keys [event] :as app}] #{(rest/create-event event)})) (extend-protocol Message m/CreateEventResults (process-message [response app] (assoc app :server-state (-> response :body))))
  • 26. CLOJURE ON THE SERVER (defn- handle-query [db-conn] (fn [{req-body :body-params}] {:body (case (:type req-body) :get-events (data/get-events db-conn) :create-event (data/create-entity db-conn (:txn-data req-body)))})) (defn app [dbconn] (-> (routes (GET "/" [] home-page) (POST "/q" [] (handle-query dbconn)) (resources "/")) (wrap-restful-format :formats [:edn :transit-json]) (rmd/wrap-defaults (-> rmd/site-defaults (assoc-in [:security :anti-forgery] false)))))
  • 27. DATOMIC FOR DATA App get's its own query, comms, memory- Each App is a peer
  • 28. DATABASE AS A VALUE Entity Attribute Value Time Fiona likes Ruby 01/06/2015 Dave likes Haskell 25/09/2015 Fiona likes Clojure 15/12/2015                 Effectively DB is local Datalog query language [:find ?e :where [?e :likes “Clojure”]]
  • 29. SCHEMA ;;event { :db/id #db/id[:db.part/db] :db/ident :event/name :db/cardinality :db.cardinality/one :db/valueType :db.type/string :db/unique :db.unique/identity :db.install/_attribute :db.part/db } { :db/id #db/id[:db.part/db] :db/ident :event/description :db/cardinality :db.cardinality/one :db/valueType :db.type/string :db.install/_attribute :db.part/db } { :db/id #db/id[:db.part/db] :db/ident :event/location :db/cardinality :db.cardinality/one :db/valueType :db.type/ref :db.install/_attribute :db.part/db } ...
  • 30. ;;location { :db/id #db/id[:db.part/db] :db/ident :location/postCode :db/cardinality :db.cardinality/one :db/valueType :db.type/string :db.install/_attribute :db.part/db } { :db/id #db/id[:db.part/db] :db/ident :location/description :db/cardinality :db.cardinality/one :db/valueType :db.type/string :db.install/_attribute :db.part/db } ...
  • 31. PERSISTENCE (defn create-entity "Takes transaction data and returns the resolved tempid" [conn tx-data] (let [had-id (contains? tx-data ":db/id") data-with-id (if had-id tx-data (assoc tx-data :db/id #db/id[:db.part/user -1000001])) tx @(d/transact conn [data-with-id])] (if had-id (tx-data ":db/id") (d/resolve-tempid (d/db conn) (:tempids tx) (d/tempid :db.part/user -1000001))))) (defn get-events [db] (d/pull-many db [:*] (->> (d/q '{:find [?event-id] :where [[?event-id :event/name]]} db) (map first))))
  • 32. CONCLUSION? Immutability simplifies State as function call stack Mostly pure functions Easier to test & reason about Time as first class concept Easier to distribute
  • 33. RESOURCES Rich Hickey talks - 'The Value of Values' 'The Language of the System' 'Simple Made Easy' 'Clojure, Made Simple' 'The Database as a Value' 'The Language of Systems' Moseley and Marks - Out of the Tar Pit Kris Jenkins 'ClojureScript - Architecting for Scale' (Clojure eXchange 2015)