Simple Test : MongoDB vs MySQL

It’s just come up in my mind that I want to prove the performance difference between MySQL and MongoDB, so I started this research. It took almost 2 days (I waste a lot of my time in importing a lot of data) and the conclusion is MongoDB is faster than MySQL and it’s about 50% faster. Okay, let’s say ‘wow’ together, “woooooow!”. It might be some of you already known about this fact, but this is my first time in proving the performance between to technologies and I felt so ecstatic!

Now let me tell you the environment that I use for this test. I use Ruby on Rails 3.2.8MySQL 5.1.44, mysql2 gem (0.3.11), mongoid gem (3.0.14), and MongoDB (2.2.0). My plan is to see which one has the better performance in solving the N + 1 Query Problem, so I prepared 2 tables of data which are containing a quite lot amount of data. Table hotels (the main table) has 4,450 rows of data and Table hotel_reviews (the child table) has 75,650 rows of data.

The tools are prepared and let’s start our test, first from MySQL then we continue to MongoDB. Continue reading “Simple Test : MongoDB vs MySQL”

A Safe Multiple Transaction with Multiple Table

I have these 2 kinds of experience :

  1. I was employed by a hospitality-purpose software developer company, based on Pulau Pinang, Malaysia. But, I worked at their branch office in Medan, Indonesia. The case was, they had one feature, which was called Rate Code Program, that was used to manage hotel’s daily room rate. It was quite complex process, but the most problem that I faced was every time I tested the feature to save the rate codes and I found a problem, I needed to clear some data in database before I tested it again.
  2. Later than, I move to another company and I was assigned to develop a daily planning for fuel distribution system. Everything was going fine until the test phase came. It was not a really problem actually, but it was really annoying. Every time the system saved their daily plan, this mean that the system will send a lot of row of data, and the error occurred, I need to clean the database again before I tested it for next time.

Continue reading “A Safe Multiple Transaction with Multiple Table”