Why Do Apple, GitHub and the BBC all use Sinatra?

Mick Gibson

Jump Start Sinatra

It’s a new year, and what better way to kick off a year of learning than with the release of the third ebook in our Jump Start Series? In the digital edition of Jump Start Sinatra you can learn how to use Sinatra’s lightning speed and flexibility to make your Ruby projects sing!

Apple, GitHub and the BBC all use Sinatra, and the reason it’s become a natural choice for large companies like these is its ability to build fast and efficient web applications … without necessarily carrying the weight of Rails. The entire Sinatra codebase weighs in at less than 2,000 lines—-around 1% the size of Rails! This means that, as a developer, you get great performance and speed, the flexibility to work the way you want to and also easy to maintain code.

Now, let’s hear from author Darren Jones, as he explains Sinatra and his new book in more detail. Over to you Darren!

I started using Sinatra about three years ago, but found it quite hard at the time to find decent tutorials that explained how it worked. As I learned Sinatra, I made notes and wrote tutes. At the back of my mind, I wanted to collect all my Sinatra knowledge in one place and explain it from start to finish. Jump Start Sinatra is the result.

The book is small, which is fitting because Sinatra is small though perfectly formed. It is a Ruby DSL (domain-specific language) that is used for building websites, applications, or services. Sinatra allows you to develop applications rapidly with minimal fuss and setup using an expressive syntax that’s simple to follow. It’s fast and stable, without tying your hands with enforced conventions.

Jump Start Sinatra dives straight into using Sinatra in Chapter One with some basic examples, and then goes on to build a modular, database-driven website from start to finish. There are no barriers to entry; all you need is a text editor. Some experience of Ruby would help, but as long as you’re familiar with a bit of programming and HTML, you should be able to advance through it.

In the book, I cover using ERB and Slim to create views, using CSS preprocessors such as Sass, connecting to a database using DataMapper, using Sinatra’s configuration options and helper methods, using CoffeeScript to take the pain out of JavaScript, as well as deploying applications to the Heroku service. It also covers developing your own Sinatra extensions and middleware, as well as making modular applications that can be used as Rack middleware.

What excites me about this book is that it provides everything you need to know to go on and build a fully functioning web application. Sinatra gives you the tools to put your Ruby code onto the Web, then jumps out of the way to let you get on with developing your application your way. Whether you want to build a small and simple website, massive database-driven application, or the next big social media sensation, this book will give you the tools you need to get started.”

Thanks, Darren, for sharing your thoughts.

We look forward to hearing your comments and feedback …

  • Have you ever tried Sinatra (or Ruby)?
  • What other questions do you have?