This was originally posted on my blog.
Yesterday night, I deployed my first Amber app to production. It’s a JSON hosting service for your mobile and web apps. I call it JSON Keeper.
The app is very simple and straightforward right now. It only has one screen with no user accounts. You simply go to the site, paste your JSON and receive a URL where it’ll be hosted.
Building the app was very similar to Rails experience. Amber has the good old MVC structure, and regularly spits out response in microseconds.
It took me some time to internalize that it is reporting things in microseconds. I kept comparing the response time of Amber app to a Rails app. This was a bit disappointing as I saw 300ms for Rails and 300 µs for Amber app.
Later when I looked closely at the unit of time did it all make sense.
Developing this app was a refreshing experience. I was concerned that strong typing will get in the way of productivity but it rarely happened. Although I did run into a weird bug which produced itself only on production, but that’s a story for another time.
Speed
Yes, any post from a Rubyist trying out new frameworks and languages will invite speed comparison, but it’s true. Crystal is a blanzingly fast language and when deployed by creating an optimized binary, the response time is mind blowing.
As I had said a few paragraphs ago, Amber is generating a response in less than 1 millisecond. Think about that! A similar Rails app deployed with MRI and passenger takes 200 milliseconds or so to generate a response.
Needless to say, Crystal (and Amber) is really giving us great speed with a pleasure to work with language.
“Fast as C, Slick as Ruby” is true!
Deployment
Deployment experience very nice with Amber. You can build a binary to copy paste (or scp
) to your server and it have all required files, and code to run the server. No need to install and maintain dependencies on your servers any more. This also helps us while sharing our app with others.
This is pretty similar to how Go lang does it deployment.
On top of manually building and deploying, Amber gives you some deploy recipes out of the box. Currently it supports Digital Ocean and Heroku, with support for AWS, Azure, GCP coming soon.
This is kind of like Capistrano integrated in framework itself with native support and the ability to spin up servers. Although, I didn’t use this feature as I wanted to experience the native way of deploying Amber/Crystal apps.
Stability
Stability can be measured on two different parameters – How stable is the server once deployed, and how stable is the framework/language in terms of incorporating breaking changes with new releases.
The servers seems to be very stable. I did some load testing on it and while Ruby/Node servers start responding slowly, I saw no such issue with Amber.
The framework and its APIs though are largely work in progress. I myself contributed a couple of commits to the framework and reading through the code and discussions shows you that the framework, and possible even the language, will have breaking changes in next releases.
To be fair I’ve used Amber v0.8.0 and Crystal v0.25.0 so these kinds of things are expected.
Conclusion
I am super excited about future of these two little technologies. Writing Crystal is a pleasure and it provides a lot of things which Ruby by its nature cannot. All Crystal (and Amber) now need is a serious corporate backing and they’ll explode in popularity.