I usually don’t trust cutting edge datastore. They promise a lot of stunning features (and use a lot of superlatives to describe them) but almost every time they are too young and have so much problems to run in production to be useless. I thought the same also about Crate Data.
“Massively scalable data store. It requires zero administration”
First time I read these words (take from the home page of Crate Data) I wasn’t impressed. I simply didn’t think was true. Some months later I read some articles and the overview of the project and I found something more interesting:
It includes solid established open source components (Presto, Elasticsearch, Lucene, Netty)
I used both Lucene and Elasticsearch in production for several years and I really like Presto. Combine some production-ready components can definitely be a smart way to create something great. I decided to give it a try.
They offer a quick way to test it:
bash -c "$(curl -L try.crate.io)"
But I don’t like self install scripts so I decided to download it a run from
bin. It simply require JVM. I unpacked it on my desktop on OS X and I launched
./bin/crate. The process bind the port 4200 (or first available between 4200 and 4300) and if you go to http://127.0.0.1:4200/admin you found the admin interface (there is no authentication). You also had a command line interface:
./bin/crash. Is similar to MySQL client and you are familiar with any other SQL client you will be familiar with
I created a simple table with semi-standard SQL code (data types are a bit different)
create table items (id integer, title string)
Then I search for a Ruby client and I found crate_ruby, the official Ruby client. I started to fill the table using a Ruby script and a million record CSV as input. Inserts go by 5K per second and the meantime I did some aggregation query on database using standard SQL (GROUP BY, ORDER BY and so on) to test performances and response was quite fast.
CSV.foreach("data.csv", col_sep: ";").each do |row| client.execute("INSERT INTO items (id, title) VALUES (\, \)", [row, row]) end
Finally I decided to inspect cluster features by running another process on the same machine. After a couple of seconds the admin interface shows a new node and after a dozen informs me data was fully replicated. I also tried to shut down both process to see what happen and data seems ok. I was impressed.
I still have many doubts about Crate. I don’t know how to manage users and privileges, I don’t know how to create a custom topology for a cluster and I don’t know how difficult is to use advanced features (like full text search or blob upload). But at the moment I’m impressed because administration seems really easy and scalability seems easy too.
Next step will be test it in production under a Rails application (I found an interesting activerecord-crate-adapter) and test advanced features to implement a real time search. I don’t know if I’ll use it but beginning looks very good.
Next week O’Reilly will host a webcast about Crate. I’m really looking forward to discover more about the project.