How to get rid of configuration and deployment headaches; How to ease A-B testing, load balancing and testing new versions before rolling out to the public using a simple technique.
Linked Data in Production: Moving Beyond Ontologies
Self hosted server applications - Adam Horvath
1. Self hosted server applications
Why and how to pack the kitchen sink into your server
Presenter:
Adam Horvath
(adam@teamleadnet.com)
21 Mar 2013, DevOps Sydney Adam Horvath 1
2. Who had any problems with…
• Differences in
– Runtime/library environment in dev and prod
– Configuration settings in dev and prod
• Setting up A-B testing
• Setting up load balancing
• Rolling out a new version to a subset of users
• Rolling back a malfunctioning version
21 Mar 2013, DevOps Sydney Adam Horvath 2
3. Data, Binary, Runtime, Config
• Data is anything that the user creates
– Files
– Database entries
• Binary is anything that works or supports work
– Compiled binaries
– Script files
– Images, styles
• Runtime is anything that Binary requires
– Framework
– Application server
• Config is anything that advises binary how to behave
– Config file
– Command line parameter
21 Mar 2013, DevOps Sydney Adam Horvath 3
4. Binary (Code)
HTTP Configuration files Database
Server
User data (Images, files)
Runtime libraries
21 Mar 2013, DevOps Sydney Adam Horvath 4
5. Pack in everything you’d need
• Storage is cheap
– Store as many binary packages as you want
• The binary package is a ‘throwaway’ container
– Adding/removing does not affect the system
• All Binary is internal
• Most runtime is internal
• Some configuration is external
• All data is external
21 Mar 2013, DevOps Sydney Adam Horvath 5
6. Self hosting
• Think in small services
• Reduce external dependencies
– Ship the application servers with the app
– HTTP server
– Static content server
– Health monitor server
• Run as a simple console application
• Embed most of the configuration
– Required config in command line - fail early
• Make directory, port, environment irrelevant
• Collect health information centrally
21 Mar 2013, DevOps Sydney Adam Horvath 6
7. Forwarding requests
• Treat the external webserver as a forwarder
• Use a lightweight HTTP server like nginx
• What belongs here is
– Rollout plan to internal users first
– Rollout plan to small percentage of live users
– A-B testing
– Dynamic load balancing
• Tip – set up your own DNS
21 Mar 2013, DevOps Sydney Adam Horvath 7
8. HTTP Server
User data
Binary (Code) (Images, files)
HTTP Runtime libraries
Server
Database
21 Mar 2013, DevOps Sydney Adam Horvath 8
9. URLs
• This presentation
http://bit.ly/devops-selfhosted
• nginx
http://nginx.org/
• dnsmasq
http://www.thekelleys.org.uk/dnsmasq
21 Mar 2013, DevOps Sydney Adam Horvath 9
10. Questions
Adam Horvath
(adam@teamleadnet.com)
21 Mar 2013, DevOps Sydney Adam Horvath 10