Nyonura

Nyonura Blog


Setting up elastic search in Rails using Docker

Setting up elastic search in Rails using Docker

I recently worked at moving our application search solution from using sphinx to elastic search. Our Sphinx setup was not optimal (and maybe we did not set it up correctly). In production with sphinx, we had to maintain a separate dummy app on our sphinx server just to run maintenance on our sphinx instance. We had long decided to separate our sphinx server from our application servers. I have become an avid fan of Docker and containerization especially in a micro-service architecurre like ours. Basically my opinion is ‘if you are not using Docker, you should at least look into it’. Setting up Docker in development involved the following process. [read more]

Creating a Testing PostgreSQL Server

Creating a Testing PostgreSQL Server

AWS RDS is really cool but… $$$ We are huge fans of AWS at [Kopo Kopo][4]. We therefore use RDS to run our databases that ship with our Rails application(s). RDS offers us a couple of advantages listed below. However, when it comes to testing and staging environments, is RDS overkill ? I have come to think so. [read more]

Partial Indexes with PostgreSQL and Rails

Partial Indexes with PostgreSQL and Rails

So what happens when you run into a situation that you really need to be paranoid about making duplicate records into the db? When dealing with financial systems, this is more often the case (You never want to have a scenario that you end up double spending). Rails model validations more often takes care of this, but it is technically possible that something slips through and God forbid it i s that one million dollar transaction. [read more]

Uninstalling Ubuntu from a Mac Book Pro

Uninstalling Ubuntu from a Mac Book Pro

I am not an apple fan-boy, but I admit that I like apple hardware – specifically the Mac Book Pro. For this reason, I usually run Ubuntu on my Mac Book Pro. If it was not for iTunes, I probably would not even dual-boot. I can never get over the awesomeness of ‘sudo apt-get install xxxxx’ in comparison to the apple ‘walled garden’. Recently, I wanted to sell one of the Mac Book Pro’s I had so that I could up-grade to a later model. (Apparently Mac Book Pro’s never grow old!). The person I was selling the laptop to did not want Ubuntu in it so I had the odious task of un-installing Ubuntu (12.04). Therein lies the problem. There is a lot of literature on the web about how to install Ubuntu on Mac Books since the advent of Mac Books using Intel chips, but there are not a lot of folks talking about how to remove Ubuntu. After Googling around, here are the steps that worked for me: [read more]

Single table inheritance and updating in Rails 3

Single table inheritance and updating in Rails 3

For my first blog post, I may as well start by talking about a recent oddity that I encountered working on our rails application (at Kopo Kopo, Inc). It probably may not be an oddity for some rails aficionados but well, it was a head scratcher so I decided to share. So basically here is the setup. Say you have a model called Person and two other models that inherit from Person called Student and Teacher respectively [read more]