Puma – An Open Source Ruby Web Server Built for Speed & Concurrency
Puma is simple, fast, unique, and highly concurrent HTTP 1.1 server for Ruby web applications, available for free on GitHub under a BSD License. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for Rubinius, but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.
Under the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!
With Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.
On MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like Rubinius or JRuby.
Like what we post? Share your thoughts on the comments below. If you wish to get regular updates on what we post, do subscribe to our RSS Feed
Liquid - Safe User Generated Template for .Net & Ruby
Unlike other templating engines that focus on given as much power as possible to the user, Liquid is designed to restrict what the user can do. The goal is to allow end-users to create their own templates without jeopardizing the security of the server.
Liquid was originally created for the eCommerce platform Shopify and has been in production use since 2006. Tim Jones ported the engine to .NET under the name DotLiquid. Both versions get their safety by not allowing templates to access the underlying platform. Instead they use a highly restricted instruction set that is primarily limited to simple functions, called “filters”, and conditional statements. The Liquid markup syntax is the same for both versions.
Rendering templates involves two steps. First the source code is parsed into a reusable Template object. Then when needed the template’s render method is called. Since templates have no access to Ruby/.NET variables, these have to be passed in using a dictionary of key-value pairs.
Developers can create their own filters to be leveraged by their users. New filters can be exposed to a specific template or registered globally. Either way, they are essentially a function that accepts and returns a string. New tag blocks are somewhat more complicated, requiring both an initialization and a rendering phase. Fortunately most of the messiness is handled by calls to the base class.
Like what we post? share your thoughts on the comments below. If you wish to get regular updates on what we post, do subscribe to our RSS Feed
Tags
- Open Source (60)
- JavaScript (57)
- Mobile Web (43)
- HTML 5 (22)
- NoSQL (22)
- jQuery (21)
- Database (19)
- Node.js (17)
- Android (15)
- Conference (14)
- View all 76 tags »
- Presentation Slides (14)
- .Net Framework (12)
- PHP (9)
- CMS (7)
- Presentation Videos (7)
- HeathCare IT (6)
- AMT (6)
- Amazon web services (6)
- MYSQL (6)
- Programming Languages (6)
- Agile (5)
- HTML (5)
- Mobile App Development (5)
- Tutorials (5)
- CSS (4)
- Programming (4)
- UX (4)
- Security (3)
- AMT Quiz (3)
- CSS3 (3)
- GitHub (3)
- Greetings (3)
- HIPAA (3)
- Tools (3)
- iPad Apps (3)
- Ace (2)
- Facebook App Development (2)
- Linux (2)
- Microsoft Silverlight (2)
- Mono (2)
- OSX Development (2)
- PHP Framework (2)
- Python (2)
- Ruby (2)
- Ruby on Rails (2)
- Scrum (2)
- WebRTC (2)
- Windows 7 (2)
- WordPress Framework (2)
- e-Learning (2)
- iOS 5 (2)
- Adobe AIR (1)
- Apache (1)
- BT Summit 2010 (1)
- C++ (1)
- Corporate Storytelling (1)
- Django (1)
- Dojo (1)
- EHR (1)
- EPR (1)
- Electronic Patient Record (1)
- FaceTime (1)
- Flash (1)
- Game Developement (1)
- Lean (1)
- Marketing (1)
- Microsoft (1)
- Mozilla (1)
- Perl (1)
- Product Development (1)
- SCM (1)
- SDT Table Dynamic MySQL PHP (1)
- SEO (1)
- Web Development Framework (1)
- Windows 8 (1)
- iOS Software Development (1)
Get Updates
Get the latest updates in your email box automatically.