Building Web Applications with

Crystal and Kemal

@sdogruyol

vienna.rb 

09.03.2016

Serdar Doğruyol

Lead Developer - Protel Turkey

@sdogruyol

  • Rubyist, Crystal enthusiast
  • Ruby Turkey, Crystal Turkey Organizer
  • Open source developer
  • Literally Polyglot

Why Crystal?

The expressiveness of Ruby 

The superb performance of C 

Actually it's over 90000!

Framework Requests Per Sec Avg. Resp. Time
Kemal(Production) 100238 395.44μs
Sinatra(Puma) 2274 43.82ms

Enter Kemal!

Kemal

http://kemalcr.com

  • Super Easy
  • Super Fast
  • Fully featured :)
  • RESTful
  • Built-in WebSocket
  • JSON
  • Static File Serving
  • Pluggable Middlewares
  • View templating
require "kemal"

get "/" do
  "Hello World!"
end

ws "/socket" do |socket|
  socket.send "Hello from Kemal!"
end
Framework CPU (%) Memory (MB)
Crystal(Kemal) 1.85 11.2
ws (Node) 38.95 906.3

Built-in WebSocket

Did i mention that it's super fast and efficient :)

ws "/socket" do |socket|
  socket.send "Hello from Kemal!"
end

Demo

Who uses Kemal

Crystal for Rubyists

http://www.crystalforrubyists.com

Questions?

Thanks!

@sdogruyol

https://slides.com/sdogruyol/building-web-apps-with-kemal

Building Web Applications with Crystal and Kemal

By Serdar Dogruyol

Building Web Applications with Crystal and Kemal

  • 2,185