events, rest

What is REST? An introduction

We are very proud of our REST API at teowaki. But what does REST mean anyway? Why did we choose to adopt that architecture for our API? Why did REST win the battle against SOAP?

When I first learned about REST, back in 2006, I had lots of questions and not many answers. I didn’t understand the basic concepts or why it was a good idea to design your applications following REST guidelines. And it took me a while to find my way around the obscure documentation before I could start getting the most from REST.

That’s why I decided to prepare a talk about REST for beginners, so I could save them some trouble and put them on a good starting point for learning REST. A few weeks ago I had the opportunity to present this talk at the beginners’s track of RailsConf Chicago. Please find below the video and the slides.

 

 

If you want to learn more about REST, you can follow my related links at teowaki.

 

Advertisements
Standard
devops, postgresql, redis, ruby

Keeping our servers up to date

I try to keep our infrastructure fairly up to date. I like using devops best practices, so I’m using Ansible for server provisioning and upgrade. I used Chef and I played around with Puppet, but I found both too complicated for our current infrastructure. Ansible has been a pleasure to use so far.

Just this week I have updated a few of our servers. All of them feature Ubuntu Precise.

Redis

Ubuntu Precise ships with Redis version 2.2. That version is over two years old, so I can’t just rely on Precise packages. Besides, since we are using a bit of Lua scripting we need at least version 2.6 or higher. This means either compiling or getting an alternative PPA. I always prefer to avoid manual package compilation. But, luckily, Rowan’s keeps a very well maintained  PPA.

The playbook —that’s how you call recipes in Ansible— is as simple as

# Add redis repo
- apt_repository: repo='ppa:rwky/redis'
- apt: pkg=redis-server update_cache=yes state=latest

If you are using redis, don’t forget to set overcommit memory setting to 1, as stated in the documentation

- name: Set overcommit_memory to 1
sysctl: name=vm.overcommit_memory value=1 state=present

Postgres

I also updated to PostgreSQL 9.3.3, released a few weeks ago with security fixes. I had the same problem as with redis, Ubuntu ships with version 9.1. In this case there is an official postgres repository with the latest version

Here you are the Ansible playbook.

# Add postgres repo
- apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' state=present
- apt_key: url=https://www.postgresql.org/media/keys/ACCC4CF8.asc state=present
- apt: pkg=postgresql-9.3,postgresql-contrib-9.3 update_cache=yes state=latest

Ruby

To complete the week, after a few days testing ruby 2.1.1 in our local and staging environments —and being sure the ruby 2.1.1 regression is not affecting us— I have upgraded the production servers.

To simplify installation, I am using ruby-install. I am not attaching the Ansible playbook because it is a bit long, but you can find several examples for ruby installation in Ansible Galaxy.

And that’s all. My ops tasks are done for the week and I can get back to coding.

If you have any questions about this post, just leave us a comment. In case you prefer to get in touch privately, contact us at engineering@teowaki.com

Standard