Monday, November 08, 2010

Summary on MongoDB, CouchDB and Redis

A few days ago I've read up on MongoDB, CouchDB and Redis just to get the idea and understand the difference between them. Here is my summary:

MongoDB – a great, very fast and scalable document-oriented storage written in C++. Queries are similar to SQL queries, grouping and aggregation are supported by MapReduce functions written in JavaScript. It supports atomic in-place updates, which means that revisions of documents are not stored. MongoDB provides native drivers for different languages that use a special protocol over TCP/IP. MongoDB uses BSON (binary JSON) to store the data. It doesn't support transactions and it's recommended to have at least two servers to unsure durability (however, the v1.8 release will have single server durability.) MongoDB handles horizontal scalability via auto-sharding across multiple nodes. The only thing is that it's recommended to have a replica of each node for failover. In my opinion, MongoDB is a great replacement for relational databases, except for the cases where transactions are essential.

CouchDB – a similar to MongoDB document-oriented storage written in Erlang, but according to some tests is a bit slower, probably due to using JSON to store the data (MongoDB uses BSON), and because all requests go throw HTTP. CouchDB works according to the non-in-place updates model – it always stores all revisions of documents. CouchDB doesn't support traditional dynamic queries, all queries must be prepared as views using MapReduce in JavaScript. The good thing about this is that the results of all views are precomputed and are automatically updated in case of any changes in the data with logarithmic complexity. CouchDB can store JavaScript functions, which can be called in queries. All this makes it possible to work with the database directly from a frontend (for example web interface) using HTTP without implementing a backend, which is probably a very nice feature for some use cases. It supports horizontal scaling using the Master-Master model and doesn't require a double-server setup for durability.

Redis – an in-memory key-value storage (the values can be lists, sets, sorted sets and hashes) written in ANSI C. Redis supports the ability to save the data to a disk from time to time. A good easily scalable replacement for memcached with comparable performance and advanced features. Interesting, that some tests showed that MongoDB can even beat Redis in terms of performance. And the authors of MongoDB say that normally you wouldn't need an additional in-memory cache when using MongoDB :)

I'm looking forward to trying MongoDB in some application :)

Read more →

Solutions to the first 5 Project Euler problems in Clojure

Recently, I've started learning the Clojure programming language. After reading a great book, Programming Clojure by Stuart Halloway, I decided to get my hands dirty and try something real :) There is a nice site http://projecteuler.net that does precisely what you need in such cases: gives you tasks to solve. In this post I just want to list my solutions to the first five problems written in Clojure and probably make somebody interested in this amazing language.

Let's get started! :)

Read more →

Sunday, September 19, 2010

Первые дни стажировки в IBM Research India (Bangalore)

Примерно полгода назад у нас по универу сделали рассылку о том, что открыт приём заявок на трёхмесячную стажировку в IBM Research India. До этого я уже пробовал подавать на стажировку в американский офис Google, но к сожалению даже не получил никакого ответа. Возможно потому, что они предпочитали брать людей из самих Штатов, да и желающих было наверняка много. Раз не получилось там, я решил попытать счастье здесь. CV у меня уже было готово, заполнил форму, отправил и стал ждать. Буквально через несколько дней я получил письмо о том, что они рассматривают меня как возможную кандидатуру на проект Simulation of Service Delivery Systems. Меня это немного удивило, так как моя основная тема PhD - энерго-эффективность в дата центрах, причём там был такой вариант. Тем не менее, тема о моделировании тоже вполне логичный вариант, так как я участвую в разработке CloudSim. Поэтому я, конечно, согласился на интервью, которое было телефону и заняло всего где-то полчаса. Через некоторое время я получил ответ о том, что меня берут и я еду в Бангалор :) Впоследствии об этом даже появилась небольшая статья в газете, так как это первые взаимоотношения IBM и Melbourne University (он-лайн версия). Поговорив с моим руководителем, решили, что я поеду в сентябре, чтобы закончить кое-какую работу, которую я делал в то время.

Read more →

Впечатления и мысли о Мельбурне

Решил наконец собраться и написать о своих мыслях по поводу различных аспектов жизни в Мельбурне. На данный момент мы прожили в нём уже полтора года, так что кое-какой опыт накопился. Я пишу только о моих личных впечатлениях и на объективность не претендую :) Также не буду сильно вдаваться в детали, зато постараюсь охватить многие темы. Кстати, если у кого-то появятся вопросы, на которые я не ответил, пишите в комментариях, буду рад дополнить пост. В основном я всё сравниваю с Новосибирском, так как до приезда в Мельбурн всю жизнь прожил там.

Read more →

Sunday, October 04, 2009

Zotero plugin: auto-fetching number of citations from Google Scholar

Due to my study I have to read a lot of papers and, therefore, organize the bibliography in some way. The first software that I found for this purpose was EndNote. However, I don't like the idea of storing all data on a local drive, especially when you need to access the information for several computers. I started to look for something else and found a very nice and convenient tool called Zotero (http://www.zotero.org/). All data are stored on their server and you only need to install Zotero's extension for Firefox that will automatically synchronize with the server.


Everything is fine except absence of data about number of citations. Usually, you need to choose the most recent or the most cited papers. The first solution was just to find the number of citations in Google Scholar and enter it manually for each paper. Unsurprisingly, after a hundred of papers I found this solution inefficient. So I decided to develop a simple plugin for Zotero that will do all work for me :)

Read more →

Плагин для Zotero: выборка числа цитирований из Google Scholar

В настоящее время мне приходится читать много научных статей и, соответственно, нужно их как-то организовывать. Первая программа для управления библиографией, о которой я узнал была EndNote. Она довольно известная и популярная, но мне в ней сразу не понравилось, что все данные хрянятся локально. Получается, если мне нужно воспользоваться ей с другого компьютера, базу придётся копировать вручную. Ну и, естесственно, за бэкапами тоже нужно следить самостоятельно. Поэтому я решил поискать альтернативу и после недолгого поиска наткнулся на сервис Zotero (http://www.zotero.org/). Здесь подход более современный, данные хрянятся на сервере, а на локальный компьютер нужно только установить расширение к Firefox, которое будет автоматически синхронизироваться с сервером.



Всё бы замечательно, но мне очень не хватало информации о количестве цитирований статей. Чаще всего нужно одно из двух: или выбрать самые новые статьи, или самые цитируемые. Сначала я пошёл простым путём, выбрал незанятое (и вообще непонятное мне) поле Call Number и стал вручную вбивать туда число цитирований из Google Scholar. После первых ста статей мне почему-то показалось, что будет проблематично делать это на протяжении следующих трёх лёт. Поэтому я решил сделать простенький плагин для Zotero, который будет делать это за меня :)

Read more →

Saturday, September 05, 2009

Batch upload documents to Google Docs

Recently, I started to use Google Docs service quite often to work with documents and store full texts of papers in PDF. Unfortunately, it's not possible to upload multiple files at once using the web-interface. It might appear to be pretty tedious to upload a hundred documents in this way. But several days ago the ability to upload PDFs has been added to Google Data API. So I decided to make a simple Java tool to utilize this feature.

Read more →