SlideShare uma empresa Scribd logo
1 de 52
Baixar para ler offline
Ardoq.com @ebaxt
Erik Bakstad
Clojure
at
Ardoq
Oslo Socially Functional Programmers
Ardoq.com @ebaxt
! 6 years as consultant (finance/telecom)
! Mostly Java & JavaScript professionally
! Discovered Clojure in 2009
! Groovy, Ruby, Python, SML, Racket, Scala …
! CTO & Co-founder of Ardoq
My background
Ardoq.com @ebaxt
AGENDA
! What is Ardoq?
! Why we decided to use Clojure
! Overview Clojure at Ardoq + 2 Cases
! REPL/development environment
! Experience so far / Q&A / Discussions
Ardoq.com @ebaxt
What is Ardoq?
Ardoq.com @ebaxt
We‘re building larger, more complex systems
! Many different “sub-systems“
! Different technologies
! Wide range of integrations
! System-of-systems problem
Ardoq.com @ebaxt
To achieve conceptual understanding we create artifacts
! Documents
! System maps
! Diagrams
! Flowcharts
These artifacts are hard to maintain!
Ardoq.com @ebaxt
Existing tools are either ...
Enterprise architecture
software
Very
Complex
Word
Not
powerfull
enough
Excel
PowerPoint
Wikis
Visio
Ardoq.com @ebaxt
Ardoq is a documentation platform that offers
! Explorable, “Living” documentation
! Automatically visualizes dependencies and hierarchies
! REST-api for data import/export
! Supports custom visualizations via plugins
Ardoq.com @ebaxt
DEMO
Ardoq.com @ebaxt
Why Clojure?
Ardoq.com @ebaxt
Ardoq.com @ebaxt
Ardoq.com @ebaxt
Ship
software
Quickly
Fun!
Consistently
(over time)
Quality
Try out different
solutions
Understand
How it works!
Leverage
Ardoq.com @ebaxt
JavaScript
MongoDB
Clojure
BSON
JSON
{
"firstname": "Erik",
"lastname": "Bakstad",
"age": 30,
"hobby": ["hockey", "cycling"]
}
{
"firstname": "Erik",
"lastname": "Bakstad",
"age": 30,
"hobby": ["hockey", "cycling"]
}
{
:firstname "Erik"
:lastname "Bakstad"
:age 30
:hobby ["hockey", "cycling"]
}
EDN
Ardoq.com @ebaxt
! Extensive REST-api
! “Version control” on top of MongoDB
! Real-time web backend
! 3-party integrations (recurly, jira, segment.io, +++)
! Attachment service with pluggable storage provider
Stuff we‘ve built in Clojure
Ardoq.com @ebaxt
Architecture
Ardoq.com @ebaxt
Backbone.js !
D3.js!
jQuery!
Require.js! JavaScript-app!
Clojure!
backend!
MongoDB!
!
Redis!
HT TP Websockets SNS!
S3!
Segment.io!
Mailchimp!
Mandrill!
Recurly!
JIRA!
Tarsnap!
!
HT TP
TCP
Plugins!
JavaDoc / Excel!
HT TP
Ardoq.com @ebaxt
api!
com.ardoq.*
utils! service!
gateway!persistence!
MongoDB!
!
SNS!
S3!
Segment.io!
Mailchimp!
Mandrill!
Recurly!
JIRA!
!
!
hAp://www.infoq.com/presentaGons/DDDIClojure$
Ardoq.com @ebaxt
Libraries
! Carmine
! amazonica
! core.async
! Pantomime
! clj-http/chime/clostach
! Ring/compojure/Liberator
! http-kit/clj-wamp
! Friend/oauthentic/clj-oauth
! clj-schema/antisamy
! Monger/ragtime
Ardoq.com @ebaxt
Testing/debugging
! Started out with midje
! Now using clojure.test
! ring.mock
! Lein test selectors
! Mongodb + redis
! clojure.tools.trace
! IntelliJ with Cursive
! Embedded REPL
! criterium
Ardoq.com @ebaxt
Editor/IDE
! Emacs + Cider
! clojure-mode + paredit
! clojure-test-mode
! clojure-refactor (just started)
! company-cider
Ardoq.com @ebaxt
Infrastructure/monitoring
! S3 (wagon)
! SNS
! Zapier
! Tarsnap
! HipChat
! AWS / on-site
! Ansible /python/bash
! Circle-CI
! Logstash + Kibana
! Pingdom
Ardoq.com @ebaxt
Case 1
REST-api
Ardoq.com @ebaxt
Request Response
Servlet Container
Servlet AP I
Ring
Application
Ardoq.com @ebaxt
{:scheme(:http,(
(:session({}(
(:request3method(:get,(
(:query3string("q=hello"(
(:cookies({}(
(:uri("/test"(
(:headers(
({"accept3encoding"("gzip,(deflate"}(
(:body(...}$
(defn%handler([request](
...(
)$
{:status(200(
(:headers({"Content3Type"((
((((((((((("text/plain"}(
(:body("Hello(World!"}$
Ardoq.com @ebaxt
(defn%middleware([handler](
(
(
(
(
)$
Ardoq.com @ebaxt
(defn%middleware([handler](
(((fn%[req](
((...(
(((handler(req)(
((...(
))$
Ardoq.com @ebaxt
(defroutes(api(
(((GET("/"([](...)(
(((POST("/"([](...))(
(
(def%handler(
((((logging((session((security(app))))(
(
(
(run3jetty(handler({:port(8080}))$
Ardoq.com @ebaxt
(defroutes(api(
(((GET("/"([](...))(
?
Ardoq.com @ebaxt
Ardoq.com @ebaxt
Liberator
hAp://clojureIliberator.github.io/liberator/$
(defroutes(api(
(((GET("/"([](...))(
Decision graph
Ardoq.com @ebaxt
Decision graph
hAp://clojureIliberator.github.io/liberator/assets/img/decisionIgraph.svg$
(resource(
(((((((((:allowed3methods([:get](
(((((((((:allowed?((fn%[_]((permission/is3admin?))(
(((((((((:available3media3types(["application/json"](
(((((((((:exists?((fn%[_]({::result(...)(
(((((((((:handle3ok(::result)))$
Ardoq.com @ebaxt
Authentication
hAps://github.com/cemerick/friend$
! Basic Auth
! Token Auth
! Oauth (Log in with Github, Google, Live Connect)
Ardoq.com @ebaxt
Friend
hAps://github.com/cemerick/friend$
Ardoq.com @ebaxt
Friend
hAps://github.com/cemerick/friend$
{:workflows([(ajax3login)(
((((((((((((((token3workflow(:realm("Ardoq"(:credential3fn(...)(
((((((((((((((workflows/http3basic(:realm("Ardoq")(
((((((((((((((github3oauth(system)(
((((((((((((((live3connect3oauth(system)(
((((((((((((((google3oauth(system)](
(:credential3fn((partial(verify3credentials(system)(
(:login3uri("/login"(
(:unauthorized3redirect3uri("/login"(
(:default3landing3uri("/index.html"}$
Ardoq.com @ebaxt
Middleware
! wrap-impersonate
! wrap-organization
! wrap-session-expiry
! clojure-metrics
Ardoq.com @ebaxt
Case 2
Real-time web
Ardoq.com @ebaxt
API-1! API-2!
Nginx-1! Nginx-2!
Browser-1! Browser-2!
POST$/api/component$
{“name”:$“foo”}$
NoGfy$user$of$BrowserI1’s$
POST$
Ardoq.com @ebaxt
Why not use something like
Pusher.app or firebase?
Ardoq.com @ebaxt
The Web Application
Messaging Protocol
hAp://wamp.ws/$
Ardoq.com @ebaxt
API-1! API-2!
Nginx-1! Nginx-2!
Browser-1! Browser-2!
Websocket
+ Wamp
Http-kit
+ clj-wamp
Autobahn.js
+ flash-fallback
?
Ardoq.com @ebaxt
API-1! API-2!
Nginx-1! Nginx-2!
Browser-1! Browser-2!
Redis PubSub
+ core.async Redis!
Ardoq.com @ebaxt
Publish!
Event!
Redis!
Carmine!
listener!
Core.async!
mult-channel!
(loop!
…!
(wamp/send-event …)!
(recur))!
!
Browser-2!Browser-1!
Workspace-event
Organization-
event
dao!
Ardoq.com @ebaxt
Publish!
Event!
Redis!
Carmine!
listener!
Core.async!
mult-channel!
(loop!
…!
(wamp/send-event …)!
(recur))!
!
Analytics!
Testing!
dao!
Ardoq.com @ebaxt
REPL
Driven Development
Ardoq.com @ebaxt
http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
https://github.com/juxt/jig
https://github.com/stuartsierra/component
https://www.youtube.com/watch?v=13cmHf_kt-Q
Ardoq.com @ebaxt
The Clojure experience
So far
Ardoq.com @ebaxt
Ardoq.com @ebaxt
Other benefits
Tiny codebase
Fast feedback
Libraries (both Java and Clojure)
Concurrency
Ardoq.com @ebaxt
Challenges
Dynamic language - tradeoffs
Lack of signatures
LISP – with great power comes…
Ardoq.com @ebaxt
Thank you!
Questions?
Ardoq.com @ebaxt
THANK YOU!

Mais conteúdo relacionado

Semelhante a Clojure at ardoq

Imola informatica - cloud computing and software development
Imola informatica - cloud computing and software developmentImola informatica - cloud computing and software development
Imola informatica - cloud computing and software development
Filippo Bosi
 
Sparkling Water 5 28-14
Sparkling Water 5 28-14Sparkling Water 5 28-14
Sparkling Water 5 28-14
Sri Ambati
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
Pierre Joye
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
Zaiyang Li
 

Semelhante a Clojure at ardoq (20)

Developer < eat love code >
Developer   < eat love code >Developer   < eat love code >
Developer < eat love code >
 
How to be a Developer
How to be a DeveloperHow to be a Developer
How to be a Developer
 
WebWorkersCamp 2010
WebWorkersCamp 2010WebWorkersCamp 2010
WebWorkersCamp 2010
 
2015 Pharo Prague Lambda Meetup
2015 Pharo Prague Lambda Meetup2015 Pharo Prague Lambda Meetup
2015 Pharo Prague Lambda Meetup
 
Pharo Hands-On: 01 welcome
Pharo Hands-On: 01 welcomePharo Hands-On: 01 welcome
Pharo Hands-On: 01 welcome
 
Imola informatica - cloud computing and software development
Imola informatica - cloud computing and software developmentImola informatica - cloud computing and software development
Imola informatica - cloud computing and software development
 
Pharo Status
Pharo StatusPharo Status
Pharo Status
 
Bringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersBringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkers
 
PyData Frankfurt - (Efficient) Data Exchange with "Foreign" Ecosystems
PyData Frankfurt - (Efficient) Data Exchange with "Foreign" EcosystemsPyData Frankfurt - (Efficient) Data Exchange with "Foreign" Ecosystems
PyData Frankfurt - (Efficient) Data Exchange with "Foreign" Ecosystems
 
Apache Flex and the imperfect Web
Apache Flex and the imperfect WebApache Flex and the imperfect Web
Apache Flex and the imperfect Web
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
MongoDB and Spark
MongoDB and SparkMongoDB and Spark
MongoDB and Spark
 
MongoDB.local Dallas 2019: MongoDB and Spark
MongoDB.local Dallas 2019: MongoDB and SparkMongoDB.local Dallas 2019: MongoDB and Spark
MongoDB.local Dallas 2019: MongoDB and Spark
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
 
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
Cristiano Rastelli - Atomic Design, Design Systems and React. Cool, but... - ...
 
Sparkling Water 5 28-14
Sparkling Water 5 28-14Sparkling Water 5 28-14
Sparkling Water 5 28-14
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 

Último

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Clojure at ardoq