Basically it’s where you deploy your code to. Using a PaaS has several benefits over Infrastructure-as-a-Service (IaaS) or setting your own physical servers:
- Pay as you go, there’s no upfront investment on hardware.
- Scaling the cluster is usually effortless, given your code is properly implemented.
- Automatic system updates so your backend can stay on the latest patch.
- PaaS usually has a deployment tool for every is up and run in no time.
There are plenty of PaaS’s out there, some popular ones include Heroku, Engine Yard, Google App Engine, Elastic Beanstalk… Choose wisely based on your specific needs.
Some PaaS’s are lock-in free, you can switch to another one if needed. I had migrated from Heroku to EngineYard almost painlessly.
Minimal devops skill is required for using a PaaS. Deployment is easy, you can get things up and run in minutes.
Depends on your infrastructure needs, but for most cases the pricing is affordable, heroku for example even has a free web node for you to start with.
2. Performance monitoring
While the system is serving users, you probably want to know how healthy it is. Some metrics you want to have insights:
- How fast does it load for end users?
- Are the DB queries fast enough?
- Is the code optimized to execute with speed?
This can help you track down slow parts of the system and improve it over time. This is essential as your goal should be to make customers happy, and nobody is happy waiting for a slow web application.
We are using NewRelic for performance monitoring. It is a cool tool that provides you all of the insights listed above, and many more:
- Detailed breakdown of an http request so you can know how much time spent on DB, code execution, external services…
- Can help you trace down slow requests.
- Can help you trace down slow query, it even points you to the line of code that’s causing troubles.
- It has the concept of APPINDEX score, basically it’s how good the system is from user perspective. High score means happy customers.
- You can setup NewRelic agents for your server instances and have them monitor their resources.
- It can send you alert when something is wrong: CPU usage is too high, RAM is eaten up, storage shortage…
You can hook NewRelic with an Incident Management tool to prevent something really bad from happening. Make sure the developers smell bad stuff before hand, at any time, even 4am when they are sleeping.
System and application logging are important for several reasons:
- It helps detect suspicious requests
- It helps detect what goes wrong with your system: too many warnings, too many suspicious user activities
- It helps analyze user activities and extract useful BI insights
Logging is meaningful when it is real-time because we can know what’s going on at the moment.
A logging aggregation tool needs to provide archiving, searching and grouping.
We like Papertrail because it’s easy to setup, the dashboard is simple yet convenient. We can filter the log text and setup triggers to email or one of the chat services like Slack or Hipchat. One of the use case we have is to send trigger when one of the background app workers is killed
4. Error tracking
Bugs and features coexist in your app. Tests minimize bugs but they are still there even on production. When something wrong happens you, like when the app crashes, you want to get it reported. This way you can improve the code over time and be confident nothing is missed out.
For this, we are using Airbrake, it can:
- Integrate with project tracking like Jira so we can associate an error with a ticket. Errors can be marked as resolved if they are fixed.
5. Continuous Integration
You need to setup a CI server to improve your workflow. You just need to implement and push code, a CI server will handle the rest:
- Run the test suite.
- Analyze and report test coverage.
- Audit code quality.
- Deploy code to specific environments.
There are several CI services: CircleCI, Travis, Codeship. You can even setup one your own with Jenkins.
6. Data warehouse
Basically you can use a data warehouse to store a lot of data: log info, a copy version of your DB, extracted information… From this you can learn how customers are using your app and respond accordingly.
Google Bigquery is a good candidate, it is robust and fully scalable. Its syntax is similar to SQL so running queries on it should be easy.
BigQuery can be connected with a BI tool for data visualization.
Integration for Bigquery may require a certain amount of work, I will cover this in another post.