SlideShare une entreprise Scribd logo
1  sur  28
In the Brain of Franz Bettag
      Director of R&D and Network Operations at




             SkillsMatter, London, 2012




Liftweb and Netty for Web Development
Franz Bettag
27 years old
Nuremberg, Germany
Liftweb Committer
Director of R&D and Network Operations at wasted.io Ltd.



                 Who am I?
Code Scala projects for Customers (Liftweb and Netty)
Network Administration (UNIX/BSD, BGP/OSPF Routing, ...)
Research new products for wasted.io Ltd. based on Scala




                 What I do?
BSD over everything (i mean it)
JVM over Erlang for concurrency (the syntax, yikes!)
PostgreSQL, Cassandra and Redis fan (awesome stuff)
PHP and MySQL will die! (I am the Exterminator)




                   My bias?
15 years of coding (9 years commercial)
14 years on FreeBSD and NetBSD (i acquired my taste early)
7 years on PostgreSQL (my taste got even better)
4 years on Scala, Liftweb and Akka (excellent!)
1 year on Netty (now it’s on!)



             My experience?
Liftweb
                Templates
                Comet
                Menu




Liftweb Framework
Netty
                 Long-Polling
                 WebSockets
                 paired with Akka




Netty IO Framework
Aren’t they just easy to read?




Liftweb Templates
Liftweb Templates
Drop dead easy!




Liftweb Comet
Liftweb Comet
Liftweb Comet
Liftweb Comet
You don’t believe me?

 Allright, i’ll show you then!
One of my worst nightmares!




   Liftweb Menu
Liftweb Menu
I’m singing in the rain!




Netty Long-Polling
Fast (1k connects per core per second without issues)
Efficient (10k concurrent connections easily)
Fun (extending ChannelGroups made our heads spin)




           Netty Long-Polling
Netty Long-Polling
Uh ah, it’s that easy?




Netty WebSockets
Netty WebSockets
Netty WebSockets
Not the other way around!




Netty with Akka
Channels provide
   The current state (open, closed, ...)
   Configuration parameters (e.g. receive-buffer-size)
   ChannelPipeline of that particular Channel
   I/O operations (read, write, connect and bind)
   User-defined Attributes (Netty4 is extra nice!)


             Netty with Akka
ctx.channel (or .getChannel on Netty3)
ctx.attr(OurNettyAttrs.connected).set(new Date)
OurSingleton.ourAkkaActor ! ctx.channel
that’s it!




                Netty with Akka
Sounds too good to be
        true?

   Fine, i’ll code again!
Follow us: @wastedio on Twitter!


 Are you wasting IO?
@fbettag on Twitter

code at http://github.com/fbettag

  blogging at http://uberblo.gs

        Get home safely



Thanks for listening!

Contenu connexe

Similaire à Liftweb and netty for web development.key

Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
Zaiyang Li
 

Similaire à Liftweb and netty for web development.key (20)

Cytoscape and the Web
Cytoscape and the WebCytoscape and the Web
Cytoscape and the Web
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
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
 
Practical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobus
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Practicing at the Cutting Edge
Practicing at the Cutting EdgePracticing at the Cutting Edge
Practicing at the Cutting Edge
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
How to win skeptics to aggregated logging using Vagrant and ELK
How to win skeptics to aggregated logging using Vagrant and ELKHow to win skeptics to aggregated logging using Vagrant and ELK
How to win skeptics to aggregated logging using Vagrant and ELK
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Integrating Applications: the Reactive Way
Integrating Applications: the Reactive WayIntegrating Applications: the Reactive Way
Integrating Applications: the Reactive Way
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008
 
API Design and WebSocket
API Design and WebSocketAPI Design and WebSocket
API Design and WebSocket
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
 
Twilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC Reborn
 
Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)
 
Practicing at the Cutting Edge: Learning and Unlearning about Java Performance
Practicing at the Cutting Edge: Learning and Unlearning about Java PerformancePracticing at the Cutting Edge: Learning and Unlearning about Java Performance
Practicing at the Cutting Edge: Learning and Unlearning about Java Performance
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Liftweb and netty for web development.key

Notes de l'éditeur

  1. \n
  2. Since i am, what they call a “devop”, my skills reach far beyond coding, but we’ll get to that on the next slide.\n
  3. CFEngine, Anycast routing\n\n
  4. BSD since i was 13\n\nI really like the reliable stuff\n
  5. \n
  6. \n
  7. \n
  8. \n
  9. The class attribute tells Lift that the actual template starts with the element with the id “main”.\n\nA class attribute with the prefix “lift:” invokes a snippet that surrounds this<div> with the default chrome for the site and inserts the <div> at the "content" marker in the template.\n\nInvoke the ShowCode snippet which shows the source for the designated page and generates a link to the GitHub repository for this project.\n\n\n
  10. \n
  11. lift has the listener/manager pattern as traits for comet builtin\n
  12. \n
  13. updateListeners will update all listeners with the content of createUpdate() -> msgs vector\n
  14. That’s allright, you don’t have to believe me, i’ll show you.\n
  15. Now to one of the downsides of Liftweb, the Menu\n
  16. Ugly problems\n
  17. Even when it’s under heavy load, netty keeps it cool!\n
  18. Ugly problems if you use Linux (epoll bug), but everybody who uses Linux might have bigger issues than that anyways, so *smirk*\n
  19. explain options\nexplain \nat the end: AkkaServerHandler\n
  20. \n
  21. And that’s the easiest it gets compared to Liftweb\n\ni know, it’s java, just imagine less braces and semicolons ;)\n
  22. this is the hard approach, if you really want to unify HTTP and WebSockets, then you need to handshake yourself.\n\nfirst, you dispatch the request in the messageReceived, then in the handleHttpRequest method you handshake if needed. (it will reconnect as websocket)\n\n
  23. Since Netty is part of Akka, it made sense to me to try to combine them vice versa.\n
  24. Netty3 only allows one user-defined Attr, case-class.\nNetty4 is dynamic, Perfect if you want to store information on them and stack them on a Vector\n
  25. since channels are thread-safe\n
  26. That’s allright, you don’t have to believe me, i’ll show you.\n
  27. \n
  28. \n