Is it? Is it not? “ORM is an anti-pattern” | Seldo.Com Blog

If you are into whether you’re going to use ORM in your next project or not, you’ll appreciate the thoughts about why and when ORM can be bad for the application. First its design flaws are shown and then alternatives are given. Too many queries, the need to break the abstraction by using raw queries, how bad it can be in the long term when it’s too late and many more:

ORM is an anti-pattern | Seldo.Com Blog.

I personally like ORM, defining the relations properly and then having the powerful code coming from this abstraction. I am on my way to use ORM in a big project too. I also know and use SQL a lot for example in data mappers. I think sometimes it may be better to create a custom in-house ORM for a project though this may require constant changes to it when adding new features. I also think that every query produced by the ORM should be checked before going in production and also using a monitoring tool for your application in prod and testing your application by overloading it in a dev environment is good.

Percona Cloud Tools for MySQL

Update: Check the documentation on this link for an easy install of the agent. Make sure the toolkit is installed too. Then go to the cloud dashboard and enable the metrics. You may also need to add your MySQL server on that page before activating the stats.

Here’s an article from the great Percona guys about using their new cloud tool to easy log and monitor your mysql database instances: http://www.mysqlperformanceblog.com/2014/02/03/quick-installation-guide-for-percona-cloud-tools-for-mysql/

You should definitely try and use it as it provides some data you may never thought about and will help you see the big picture about your servers.

If the link to percona-toolkit deb is not working for you and you’re using Ubintu like me you can use the percona Ubuntu repos and install the toolkit that way:

apt-get install percona-toolkit

Installing the pt agent is nothing but:

pt-agent --install --user={mysql username} --password={password} --api-key={API Key copied from web site}

And then going to the Percona’s site and setting: Agents -> Services -> Query Analytics -> On

The pt-agent install command will show you if something’s missing and will tell you how to install it. This time I needed:

apt-get install libjson-perl libwww-perl

If you’re installing it inside a docker container you’ll need cron installed and running with:

apt-get install cron
cron -f