MongoDB vs MySQL using golang

MongoDB vs MySQL using golang

I’m the guy who like to test. Benchmark is my… middle name. You can find dozens articles about speed one or other solution. I mean MongoDB and MySQL . I tried MongoDB couple times, and each time I wasn’t  moved by it speed. Got project coming in, when I have to deal with large amount of concurrent connection. It’s not very big, but bigger then casual MySQL load.

So… how did I test – very dump way. Got 2 tables, one around 11k records, second one close to 200k record. Not much. Fields were indexed in both MySQL and MongoDB. And then i run benchmarks. First one had string fields, second one numeric.

How to manage logs

How to manage logs

Capturing and storing longs it’s bit painful task. It’s not so bad if you are running one application on one server, but if you go with multiple servers, or just don’t want to “login” to check logs – you have to go with remote logging tools. I know only 2 and didn’t look for more. First of them is tool called Sentry  second one is LogEntries .

Sending emails from commandline

Sending emails from commandline

Pretty easy but annoying task. Especially when you want to send email using specific SMTP server, or from GMAIL using SSL or add some attachment, or send RAW emails. Solution is there – mailsend . Extremely simple command line tool for Linux, Mac OS X and even Windows ;). Compile / download binary and you can enjoy freedom of sending emails from command line.

PHP, work queues

PHP, work queues

Biggest pain point in PHP is lack of asynchronous calls. The only reasonable way is to use some kind of “backend” processing and task list to execute. Some people use cron to run given script each n-minutes and execute tasks. But there is a little bit more “professional” approach.  Beanstalk is a simple, fast work queue. Idea is pretty simple – you can just throw tasks into queue and then have background worker which is pulling data from pipe and executes task.

Couple ideas: sending emails, processing images, making heavy queries into database. But the best part of it – you don’t have to use PHP for back processing. It could be anything, because protocol us universal and worker and client doesn’t have to be in the same language. So you can schedule task in PHP, and run it in Go. I’m not going too much into details. Just run some examples.