SlideShare a Scribd company logo
1 of 32
Download to read offline
Zotonic




A modern web framework and CMS


Arjan Scherpenisse
MiracleThings
arjan@miraclethings.nl
Overview


    Yet another CMS?
   Why Erlang?

    Inside Zotonic
   The future
Websites: a history


    First generation
       static text, images

    Second generation
       Database driven, templates, CMS.

    Now:
       Highly interactive, realtime, data exchange,
        personalization
Our wish list


    CMS
   Framework

    Connectivity
   Frontender friendly

    Efficient use of hardware
Now: <?php ?>


    Slow
       More code => slower

    Shared nothing
       Amnesia doesn't make it faster

    Big non threaded web server
       Forget long living connections...
Now: Python, Ruby...


    One process per core
   Multithreading? Better not

    No sharing of state and data
   Memcache is common state

    On failure your server crashes
Erlang?


    Website is communication hub
   Many kinds of data streams

    Many Parallel connections
   Lots of short requests

    Long living connections
   …this looks like a phone switch!
Why not Erlang?


    Esoteric language
       Greate error/failure handling
       Very compact
       Mature

    String processing?
       Data preprocessing, iolist()s
Demo time!
So, what's in the box?


    Multiple sites            
                                  Integrated e-mail
   Admin interface               sending + receiving (!)

    Member administration
                                 API OAuth
   Page management
                                 i18n

    Menu creator
                                 Atom feeds
   Commenting
                                 Import CSV /
                                  Wordpress
   Image scaling / preview   
                                  Mailinglist
   Video embedding
Getting technical


    Where we started
   Our data model

    Open source puzzle
   OTP hierarchy

    Modules
   URL dispatching
   The building blocks
Data model: everything is a thing

                    Article
                     Article




           author              depiction




          Person
           Person                Image
                                  Image
Full data model

                                                 identity
                                                   identity



                                                 medium
                                                  medium
    config
     config

                            rsc
                             rsc
                                                category
                                                 category
   persistent
    persistent
                       predicate
                                                 protect
                                                  protect
    module        subject          object
     module

                                            predicate_category
                                             predicate_category
                            edge
                             edge
Open source puzzle


    Webmachine
       Forked to webzmachine

    Nitrogen
   ErlyDTL

    Mochiweb, erlang-gettext, erlang-oauth, gen_smtp
   PostgreSQL driver: epgsql
   Imagemagick (cli)
Diagram


                      Modules
                       Modules



      Zotonic core
       Zotonic core   Sites
                       Sites           Webmachine
                                        Webmachine



      epgsql
       epgsql                  Webmachine
                                Webmachine
OTP hierarchy
                              zotonic.app




                              zotonic_sup




z_email_receive               z_sites_sup       wm_mochiweb_*       dispatcher          z_config                     z_ids



            z_email_server                                                                         z_media_preview



                             z_sites_sup
                              z_sites_sup
                                z_sites_sup
                                                                         z_pivot_rsc         z_dropbox                 z_installer




       z_depcache        z_module_manager          z_site_startup         z_session         z_template               z_trans_server



                                                                                            z_dispatcher         z_module_indexer
                             z_sites_sup
                              z_sites_sup
                             Module processes                       z_session_page
                                                                      z_session_page
                                                                       z_session_page                                  z_notifier
Modules


    Modules are self-contained:
        Dispatch rules, resources, templates, css, javascript,
         images, translations, template filters, actions, validators,
         API services, models, …
   Prioritized list
   File lookup mechanism
   Every module can be a gen_server
Notification system
   Is how modules extend and offer functionality
   gen_event-like
   Listen to notifications
   Send notifications:
       notify, notify1, fold, map, first
       Both sync and async
% @doc Check if the recipient is a known user, if so redirect the received e-
mail
observe_email_received(#email_received{localpart=Recipient} = Received,
Context) ->
     case m_identity:lookup_by_username(Recipient, Context) of
         undefined ->
             undefined;
         Props ->
             case proplists:get_value(is_verified, Props) of
                  true ->
URL dispatching


    Dispatch rules per site
       (and per module)

    Dispatch rules have names

    {contact,     [“contact”],   resource_template, [ {template,
    "contact.tpl"} ]},
The page controller


    Webmachine entrypoint for pages
   404 check

    Authorization check + logon redirect
   Template selection
Template system


    Extended ErlyDTL
       Expressions: {% if a + b > c %}
       Tuple and list data types
       Data access through models: {{ m.rsc[id].title }}

    Templates can be made more specific by category
    and/or unique page name
   Templates with the same name override each
    other
       Uses module priority
Template ex.: page.page_projects.tpl
{% extends "page.tpl" %}

{% block content_body %}
{% cache 7200 %}

{% for r in m.search[{archive_year cat='project'}] %}
    <div class="grid_9 alpha omega">
        <h2 class="year">{{ r.year }}</h2>
    </div>

   {% for group in m.search[{query publication_year=r.year|append:""
                         cat='project'
                         sort="-publication_start"}]|chunk:3 %}

    <div class="grid_9 alpha omega">

        {% for id in group %}
        {% catinclude "inc/listitem.tpl" id alpha=forloop.first
omega=forloop.last%}
        {% endfor %}

   </div>
   {% endfor %}

{% endfor %}

{% endcache %}
{% endblock %}
Scomps — screen components


    For when you need more logic than a template can
    handle
   Erlang module
   Cacheable
   Example: {% menu id=id %}
Javascript — Event handling


    Ajax postbacks
   Form submits

    Calls event/2 function
   Communicates back to browser by sending
    javascript
       Inspired by Nitrogen

{% button postback={click foo=”bar”} text=”click me” %}


event({postback, {click, Args}, _Trigger, _Target}, Context) ->
z_render:wire({alert, [{text,”hello”}]}, Context).
Javascript — Push connections


    Uses either Comet or WebSockets
   Attaches to the page process

    Transports Javascript to the UA
API services


    API method is an Erlang module
   /api/mymodule/mymethod

    In /services module directory
   JSON input / output

    Process GET and POST
Performance optimizations


    Caching (don't hit the database)
   Prevent data copying

    Memo-caching in process dict
   Pre-computed HTML

    Share computations between requests
Compute less


    Parallel requests have similar computations
   Only one time calculated

    Lightweight and simple optimization against /.
    effect
   Uses memo functionality of depcache
   Kind of caching, with 0 expire.
Future directions


    Information exchange hub
       PubSub (XMPP, pubsubhubub)
       Push & pull (feeds, atom, email)
   Scaling up.... Elastic Zotonic
       Distributed
       Fault tolerant
       Buzzword compliancy :-)
Elastic Zotonic goals


    Scalable
   Robust

    Fault tolerant
   Low maintainance

    Easy to setup
   KISS
   Time scale: first release Q4 2011
The community


    www.zotonic.com — always improving with latest
    documentation
   Great mailing list with helpful people
       zotonic-users@groups.google.com
   XMPP chat room
       zotonic@conference.zotonic.com
Thank you!


    Online resources:
       MiracleThings website
        http://miraclethings.nl/media/attachment/2011/8/13/arjan_miraclethings_789d763.zip
        Presentation slides
        http://miraclethings.nl/media/attachment/2011/8/13/20110813_erlangcamp.pdf

   … any questions?

More Related Content

What's hot

ActiveMQ Configuration
ActiveMQ ConfigurationActiveMQ Configuration
ActiveMQ ConfigurationAshish Mishra
 
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용Sungchul Park
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013Jagadish Prasath
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)Daniel Bryant
 
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009Alexandre Morgaut
 
Gentle Intro to Drupal Code
Gentle Intro to Drupal CodeGentle Intro to Drupal Code
Gentle Intro to Drupal CodeAddison Berry
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGArun Gupta
 
Java Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsJava Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsIMC Institute
 

What's hot (10)

ActiveMQ Configuration
ActiveMQ ConfigurationActiveMQ Configuration
ActiveMQ Configuration
 
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
스프링 코어 강의 2부 - Java 구성을 활용한 스프링 코어 사용
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
JavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI MigratJavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI Migrat
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009
Wakanda: a new end-to-end JavaScript platform - JSConf Berlin 2009
 
Gentle Intro to Drupal Code
Gentle Intro to Drupal CodeGentle Intro to Drupal Code
Gentle Intro to Drupal Code
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
Java Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsJava Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 Basics
 

Viewers also liked

Android workshop
Android workshopAndroid workshop
Android workshopArjan
 
El Pueblo Gallego 1948
El Pueblo Gallego 1948El Pueblo Gallego 1948
El Pueblo Gallego 1948GZ-Israel
 
O Meu Pequeno Pais
O Meu Pequeno PaisO Meu Pequeno Pais
O Meu Pequeno PaisGZ-Israel
 
Seica o basilisco é animal de compaña
Seica o basilisco é animal de compañaSeica o basilisco é animal de compaña
Seica o basilisco é animal de compañaGZ-Israel
 
Arava Sites By Guy
Arava Sites By GuyArava Sites By Guy
Arava Sites By GuyGZ-Israel
 
Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8GZ-Israel
 
Israel 1214781329718633 9
Israel 1214781329718633 9Israel 1214781329718633 9
Israel 1214781329718633 9GZ-Israel
 
Tel Aviv 1920 1940
Tel Aviv 1920 1940Tel Aviv 1920 1940
Tel Aviv 1920 1940GZ-Israel
 
Tweets polls surveys
Tweets polls surveysTweets polls surveys
Tweets polls surveysSandra Hines
 
Mark Chagall
Mark ChagallMark Chagall
Mark ChagallGZ-Israel
 
Hello, world
Hello, worldHello, world
Hello, worldArjan
 
Alice Quick Guide
Alice Quick GuideAlice Quick Guide
Alice Quick GuideKJSROSE
 
Mediamatic Night Lab #2
Mediamatic Night Lab #2Mediamatic Night Lab #2
Mediamatic Night Lab #2Arjan
 
O mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaO mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaGZ-Israel
 
Duo Disco - doing the Erlang dance
Duo Disco - doing the Erlang danceDuo Disco - doing the Erlang dance
Duo Disco - doing the Erlang danceArjan
 
The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166GZ-Israel
 

Viewers also liked (20)

Android workshop
Android workshopAndroid workshop
Android workshop
 
El Pueblo Gallego 1948
El Pueblo Gallego 1948El Pueblo Gallego 1948
El Pueblo Gallego 1948
 
O Meu Pequeno Pais
O Meu Pequeno PaisO Meu Pequeno Pais
O Meu Pequeno Pais
 
Seica o basilisco é animal de compaña
Seica o basilisco é animal de compañaSeica o basilisco é animal de compaña
Seica o basilisco é animal de compaña
 
Arava Sites By Guy
Arava Sites By GuyArava Sites By Guy
Arava Sites By Guy
 
Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8
 
IPsec
IPsecIPsec
IPsec
 
Israel 1214781329718633 9
Israel 1214781329718633 9Israel 1214781329718633 9
Israel 1214781329718633 9
 
Tel Aviv 1920 1940
Tel Aviv 1920 1940Tel Aviv 1920 1940
Tel Aviv 1920 1940
 
Tweets polls surveys
Tweets polls surveysTweets polls surveys
Tweets polls surveys
 
Mark Chagall
Mark ChagallMark Chagall
Mark Chagall
 
Hello, world
Hello, worldHello, world
Hello, world
 
Alice Quick Guide
Alice Quick GuideAlice Quick Guide
Alice Quick Guide
 
Mediamatic Night Lab #2
Mediamatic Night Lab #2Mediamatic Night Lab #2
Mediamatic Night Lab #2
 
Road
RoadRoad
Road
 
O mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaO mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos Penela
 
Duo Disco - doing the Erlang dance
Duo Disco - doing the Erlang danceDuo Disco - doing the Erlang dance
Duo Disco - doing the Erlang dance
 
The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166
 
Rami Meiri
Rami MeiriRami Meiri
Rami Meiri
 
Maketechwork4u
Maketechwork4uMaketechwork4u
Maketechwork4u
 

Similar to Zotonic presentation Erlang Camp Boston, august 2011

Comet with node.js and V8
Comet with node.js and V8Comet with node.js and V8
Comet with node.js and V8amix3k
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbonezonathen
 
Node.js for enterprise - JS Conference
Node.js for enterprise - JS ConferenceNode.js for enterprise - JS Conference
Node.js for enterprise - JS ConferenceTimur Shemsedinov
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?João Pedro Martins
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlightsdswork
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best PracticesEric Bottard
 
Architecting non-trivial browser applications (Jazoon 2012)
Architecting non-trivial browser applications (Jazoon 2012)Architecting non-trivial browser applications (Jazoon 2012)
Architecting non-trivial browser applications (Jazoon 2012)Marc Bächinger
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsSolution4Future
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App EssentialsSergey Bolshchikov
 
Gordon Semantic Web 2008
Gordon Semantic Web 2008Gordon Semantic Web 2008
Gordon Semantic Web 2008bosc_2008
 
Java Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringJava Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringBeat Signer
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Matthew McCullough
 
Reversing & malware analysis training part 2 introduction to windows internals
Reversing & malware analysis training part 2   introduction to windows internalsReversing & malware analysis training part 2   introduction to windows internals
Reversing & malware analysis training part 2 introduction to windows internalssecurityxploded
 

Similar to Zotonic presentation Erlang Camp Boston, august 2011 (20)

Comet with node.js and V8
Comet with node.js and V8Comet with node.js and V8
Comet with node.js and V8
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
Node.js for enterprise - JS Conference
Node.js for enterprise - JS ConferenceNode.js for enterprise - JS Conference
Node.js for enterprise - JS Conference
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlights
 
Virtual Classroom
Virtual ClassroomVirtual Classroom
Virtual Classroom
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best Practices
 
Architecting non-trivial browser applications (Jazoon 2012)
Architecting non-trivial browser applications (Jazoon 2012)Architecting non-trivial browser applications (Jazoon 2012)
Architecting non-trivial browser applications (Jazoon 2012)
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App Essentials
 
Gordon Semantic Web 2008
Gordon Semantic Web 2008Gordon Semantic Web 2008
Gordon Semantic Web 2008
 
Java Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringJava Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web Engineering
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Vue.js basics
Vue.js basicsVue.js basics
Vue.js basics
 
Reversing & malware analysis training part 2 introduction to windows internals
Reversing & malware analysis training part 2   introduction to windows internalsReversing & malware analysis training part 2   introduction to windows internals
Reversing & malware analysis training part 2 introduction to windows internals
 

More from Arjan

De Naakte Noorderlingen
De Naakte NoorderlingenDe Naakte Noorderlingen
De Naakte NoorderlingenArjan
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceArjan
 
Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Arjan
 
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldErlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldArjan
 
Physical Computing with Android and IOIO
Physical Computing with Android and IOIOPhysical Computing with Android and IOIO
Physical Computing with Android and IOIOArjan
 
Open-CI for beginners
Open-CI for beginnersOpen-CI for beginners
Open-CI for beginnersArjan
 
OBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonOBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonArjan
 

More from Arjan (7)

De Naakte Noorderlingen
De Naakte NoorderlingenDe Naakte Noorderlingen
De Naakte Noorderlingen
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & Performance
 
Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013
 
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldErlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
 
Physical Computing with Android and IOIO
Physical Computing with Android and IOIOPhysical Computing with Android and IOIO
Physical Computing with Android and IOIO
 
Open-CI for beginners
Open-CI for beginnersOpen-CI for beginners
Open-CI for beginners
 
OBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonOBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic Salon
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Zotonic presentation Erlang Camp Boston, august 2011

  • 1. Zotonic A modern web framework and CMS Arjan Scherpenisse MiracleThings arjan@miraclethings.nl
  • 2. Overview  Yet another CMS?  Why Erlang?  Inside Zotonic  The future
  • 3. Websites: a history  First generation  static text, images  Second generation  Database driven, templates, CMS.  Now:  Highly interactive, realtime, data exchange, personalization
  • 4. Our wish list  CMS  Framework  Connectivity  Frontender friendly  Efficient use of hardware
  • 5. Now: <?php ?>  Slow  More code => slower  Shared nothing  Amnesia doesn't make it faster  Big non threaded web server  Forget long living connections...
  • 6. Now: Python, Ruby...  One process per core  Multithreading? Better not  No sharing of state and data  Memcache is common state  On failure your server crashes
  • 7. Erlang?  Website is communication hub  Many kinds of data streams  Many Parallel connections  Lots of short requests  Long living connections  …this looks like a phone switch!
  • 8. Why not Erlang?  Esoteric language  Greate error/failure handling  Very compact  Mature  String processing?  Data preprocessing, iolist()s
  • 10. So, what's in the box?  Multiple sites  Integrated e-mail  Admin interface sending + receiving (!)  Member administration  API OAuth  Page management  i18n  Menu creator  Atom feeds  Commenting  Import CSV / Wordpress  Image scaling / preview  Mailinglist  Video embedding
  • 11. Getting technical  Where we started  Our data model  Open source puzzle  OTP hierarchy  Modules  URL dispatching  The building blocks
  • 12. Data model: everything is a thing Article Article author depiction Person Person Image Image
  • 13. Full data model identity identity medium medium config config rsc rsc category category persistent persistent predicate protect protect module subject object module predicate_category predicate_category edge edge
  • 14. Open source puzzle  Webmachine  Forked to webzmachine  Nitrogen  ErlyDTL  Mochiweb, erlang-gettext, erlang-oauth, gen_smtp  PostgreSQL driver: epgsql  Imagemagick (cli)
  • 15. Diagram Modules Modules Zotonic core Zotonic core Sites Sites Webmachine Webmachine epgsql epgsql Webmachine Webmachine
  • 16. OTP hierarchy zotonic.app zotonic_sup z_email_receive z_sites_sup wm_mochiweb_* dispatcher z_config z_ids z_email_server z_media_preview z_sites_sup z_sites_sup z_sites_sup z_pivot_rsc z_dropbox z_installer z_depcache z_module_manager z_site_startup z_session z_template z_trans_server z_dispatcher z_module_indexer z_sites_sup z_sites_sup Module processes z_session_page z_session_page z_session_page z_notifier
  • 17. Modules  Modules are self-contained:  Dispatch rules, resources, templates, css, javascript, images, translations, template filters, actions, validators, API services, models, …  Prioritized list  File lookup mechanism  Every module can be a gen_server
  • 18. Notification system  Is how modules extend and offer functionality  gen_event-like  Listen to notifications  Send notifications:  notify, notify1, fold, map, first  Both sync and async % @doc Check if the recipient is a known user, if so redirect the received e- mail observe_email_received(#email_received{localpart=Recipient} = Received, Context) -> case m_identity:lookup_by_username(Recipient, Context) of undefined -> undefined; Props -> case proplists:get_value(is_verified, Props) of true ->
  • 19. URL dispatching  Dispatch rules per site  (and per module)  Dispatch rules have names {contact, [“contact”], resource_template, [ {template, "contact.tpl"} ]},
  • 20. The page controller  Webmachine entrypoint for pages  404 check  Authorization check + logon redirect  Template selection
  • 21. Template system  Extended ErlyDTL  Expressions: {% if a + b > c %}  Tuple and list data types  Data access through models: {{ m.rsc[id].title }}  Templates can be made more specific by category and/or unique page name  Templates with the same name override each other  Uses module priority
  • 22. Template ex.: page.page_projects.tpl {% extends "page.tpl" %} {% block content_body %} {% cache 7200 %} {% for r in m.search[{archive_year cat='project'}] %} <div class="grid_9 alpha omega"> <h2 class="year">{{ r.year }}</h2> </div> {% for group in m.search[{query publication_year=r.year|append:"" cat='project' sort="-publication_start"}]|chunk:3 %} <div class="grid_9 alpha omega"> {% for id in group %} {% catinclude "inc/listitem.tpl" id alpha=forloop.first omega=forloop.last%} {% endfor %} </div> {% endfor %} {% endfor %} {% endcache %} {% endblock %}
  • 23. Scomps — screen components  For when you need more logic than a template can handle  Erlang module  Cacheable  Example: {% menu id=id %}
  • 24. Javascript — Event handling  Ajax postbacks  Form submits  Calls event/2 function  Communicates back to browser by sending javascript  Inspired by Nitrogen {% button postback={click foo=”bar”} text=”click me” %} event({postback, {click, Args}, _Trigger, _Target}, Context) -> z_render:wire({alert, [{text,”hello”}]}, Context).
  • 25. Javascript — Push connections  Uses either Comet or WebSockets  Attaches to the page process  Transports Javascript to the UA
  • 26. API services  API method is an Erlang module  /api/mymodule/mymethod  In /services module directory  JSON input / output  Process GET and POST
  • 27. Performance optimizations  Caching (don't hit the database)  Prevent data copying  Memo-caching in process dict  Pre-computed HTML  Share computations between requests
  • 28. Compute less  Parallel requests have similar computations  Only one time calculated  Lightweight and simple optimization against /. effect  Uses memo functionality of depcache  Kind of caching, with 0 expire.
  • 29. Future directions  Information exchange hub  PubSub (XMPP, pubsubhubub)  Push & pull (feeds, atom, email)  Scaling up.... Elastic Zotonic  Distributed  Fault tolerant  Buzzword compliancy :-)
  • 30. Elastic Zotonic goals  Scalable  Robust  Fault tolerant  Low maintainance  Easy to setup  KISS  Time scale: first release Q4 2011
  • 31. The community  www.zotonic.com — always improving with latest documentation  Great mailing list with helpful people  zotonic-users@groups.google.com  XMPP chat room  zotonic@conference.zotonic.com
  • 32. Thank you!  Online resources:  MiracleThings website http://miraclethings.nl/media/attachment/2011/8/13/arjan_miraclethings_789d763.zip Presentation slides http://miraclethings.nl/media/attachment/2011/8/13/20110813_erlangcamp.pdf  … any questions?