I've written server-side applications for a decade now, and monitoring the components of your application is critical but painful. What monitors the CPU and RAM usage of your custom daemons? What monitors Redis, MySQL, memcached and the other parts of your system to ensure they are all behaving normally? What if I told you you could do all that and set it up in less than 5 minutes?
I do a lot of work on open source, but my most valuable contributions haven't been code. Writing a patch is the easiest part of open source. The truly hard stuff is all of the rest: bug trackers, mailing lists, documentation, and other management tasks. Here's some things I've learned along the way...
In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service. The twelve-factor app is a methodology for building software-as-a-service apps that:
- Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;
- Have a clean contract with the underlying operating system, offering maximum portability between execution environments;
- Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration;
- Minimize divergence between development and production, enabling continuous deployment for maximum agility;
- And can scale up without significant changes to tooling, architecture, or development practices.
The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of backing services (database, queue, memory cache, etc).
Emulate mobile devices directly through DevTools, simulating touch events, mimicking screen size, and spoofing user agent.
Plug in a mobile device over USB and use Chrome DevTools on the actual mobile browser. Push your local site to the mobile device with port forwarding.
I'm not going to be talking about the third step of the TDD cycle. Refactoring code that's in development and not currently running on production is something you must absolutely do. Work clean, and write clean code.
What we're talking about is changes to existing, running code.
The state_machine gem is a great tool for putting business rules into your Ruby applications. But sometimes rules have exceptions.
In this post, I'll show you how my team has used state_machine together with Authority to allow certain people to make exceptions to the rules.