Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Erlang White Label

Geoff Cant Whitelabel Erlang covers the trials, tribulations and technologies used in building a whitelabel ejabberd hosting service.

The talk explains the rationale behind the choices of web server, templating system, email module, page optimizers and other web framework components. The talk also covers the documented and undocumented DNS query and caching modules in OTP and introduces 'dns' - a convenient new API for using them. Finally, the talk describes some tips and tricks useful for whitelabel hosting solutions that require customer DNS updates.

  • Login to see the comments

Erlang White Label

  1. 1. WhiteLabel Erlang Adventures in the undocumented wilds of inet_dns
  2. 2. Who is this guy? Geoff Cant <> Current (xmpp|mailto): Previously archaelus on http:// github, irc:freenode/ #erlang
  3. 3. What have I been up to? ejabberd debugging virtual hosting debugging large clusters porting patches debugging patches
  4. 4. What have I been up to? Whitelabel ejabberd hosting
  5. 5. A rant in four parts Web Frameworks (why Mochiweb) Other libraries (ejango, esmtp, erlydtl) DNS (OTP Undocumented) Tricks and Lessons
  6. 6. Web Frameworks Erlyweb YAWS inets The Erlang Web Nitrogen
  7. 7. Mochiweb. (No logo, ‘cause they’re too busy coding)
  8. 8. Other pieces Templating URL Routing Form validation Email
  9. 9. Templating erlydtl Templates compile to modules Well known template syntax (Django-ish) Template
  10. 10. URL Routing Must work with RESTful URLs Must be reversible - able to generate URLs too ejango.url_routes
  11. 11. Form Validation Generate forms and validate form posts Couldn’t find anything available already Declarative DSL for form specification ejango.form, ejango.form_validator
  12. 12. Sending Email smtp_fsm Erlware smtp No attachments? This should be much easier. esmtp
  13. 13. Mail Sending API
  14. 14. Mime Attachment API
  15. 15. DNS Need to verify ownership of domain Need to add XMPP SRV records inet:gethostbyname ... To the githubs!
  16. 16. DNS Undocumented inet_res:getbyname/2 inet_res:nnslookup/5 inet_db - caching inet_dns - packet encoding/decoding, bugs ‘dns’ -- the way forward.
  17. 17. Here be Dragons. Sometimes it’s undocumented for a reason The TXT RR is subtle. I reimplemented the same bug.
  18. 18. My DNS decoder TXT RRs are <<Len:8, Data:Len/binary>>* Binary pattern matching rocks
  19. 19. Whitelabel Tricks Check SOA to test if domain exists Bypass DNS caching
  20. 20. YSlow Optimisations Initially got a D on my YSlow report Decided to gzip and minify content, move js blocks around ejango.static:compress_docroot/1, ejango.static:serve_compressed/3
  21. 21. Minifying...
  22. 22. Lessons Hierarchal modules are a world of hurt. Metaprogramming in Erlang is still too hard. Never trust ADSL routers. ...
  23. 23. Use Github.
  24. 24. A small plea for help I have way too many github projects Adopt my code? Interested in collaborating?
  25. 25. Fin.