Extralite 3.1.0 发布了
Extralite(Ruby 的 SQLite 封装库)发布 3.1.0 版本:新增参数量查询的自动缓存(自动缓存底层 sqlite3_stmt 对象,避免重复创建),并将内置 SQLite 升级到 3.53.4。 Extralite 支持多线程/多纤程 Ruby 应用中使用 SQLite 数据库,提供多种数据检索方式和数据库管理工具。
超越 ORM:我为什么转向直接用 SQL 操作数据库
<p>我一直对ORM的设计很感兴趣——我想知道它们是如何工作的,不同的方法是什么,以及它们的使用方式。我尝试了很多不同的,甚至自己创造了.但在过去几年里,我慢慢转向更直接地与数据库打交道——用纯SQL发出查询,处理来自数据库的原始数据,或者为关系型数据库构建自定义的低层抽象。<br><br>我代码与数据库交互方式的演变,正是我创建这些内容的原因, 一个用于处理 SQLite 数据库的 Ruby 宝石。</p><p>为什么我更喜欢直接与数据库交互,而不是使用ORM?对于熟悉SQL的开发者来说,ORM的局限性应该很明显——它不支持窗口函数、常用表表达式(CTE),甚至不支持<code>RETURNING</code>子句;ORM层本身是一个重要的依赖(ActiveRecord代码库约为~43KLoC),它在内存和CPU时间方面带来了性能成本;其定义性特征是将行映射到对象,是一种反模式,被描述为””.</p><p>我很清楚,ActiveRecord 是 Ruby/Rails 社区中与数据库通信最流行的方式,并且对许多 Ruby 及其他语言的 ORM 产生了巨大影响。但对我来说,ActiveRecord 一直感觉不对劲。<br><br>我越是构建网页应用和平台,越觉得这一点清晰。ActiveRecord 为关系数据提供了错误的抽象。ActiveRecord 专注于单一记录,即每条记录本身就是一个实体。<br><br>然而,实际上,规范化数据库会包含许多带有附加数据的表,比如…</p>
Extralite 3.0.0 发布:引入对象图转换与现代化默认设置
Extralite 3.0.0 发布,新增对象图转换功能,可将 SQL 查询结果自动映射为嵌套的对象关系结构,支持一对多和多对多关系。 同时默认开启 WAL 模式和外键约束,并限制了扩展加载方式以提升安全性。
重新思考 Ruby 应用中的模块化
I wrote recently (/articles/2026-06-13-syntropy) about Syntropy, a new Ruby web framework I’m working on (it runs this site ). Syntropy’s design is based around the idea of file-based routing, which m...
软件即手艺:初探自研Web框架Syntropy
作者反思软件开发的工匠精神,批评过度依赖框架和AI自动化。介绍其自研Ruby Web框架Syntropy,采用基于文件的动态路由和模块加载机制。 对比Rails等主流框架,强调低层级控制与代码组织的灵活性。详细解析了路由树构建、中间件组合及控制器设计模式。
探索 io_uring 的自动缓冲管理方案
作者分享在 Ruby gem UringMachine 中实现 io_uring 自动缓冲管理的工程实践。通过内核提供的缓冲环机制,结合自动补充和复用策略, 显著减少了数据拷贝与内存分配。 文章详细解释了如何处理多路复用下的分段缓冲区,以及如何构建类似 HTTP 和 Redis 协议的上层解析器。这种将底层高性能 I/O 与 Ruby Fiber 调度器无缝结合的设计,为高并发网络编程提供了新的思路。
Threads vs Fibers - Can't We Be Friends?
In the last few weeks I’ve been writing here about my work on UringMachine, a Ruby gem for doing I/O with io_uring. Before I talk about my work this week, I’d like to address something that is importa...
OSS Friday Update – Fibers Are the Future of Ruby
In the last few days I’ve managed to finalize work on the UringMachine fiber scheduler. Beyond making sure the fiber scheduler is feature complete, that is, it implements all the different Fiber Sched...
OSS Friday Update – The Shape of Ruby I/O to Come
I’m currently doing grant work for the Japanese Ruby Association on UringMachine, a new Ruby gem that provides a low-level API for working with io_uring. As part of my work I’ll be providing weekly up...
OSS Friday Update – The Fiber Scheduler Is Taking Shape
This week I made substantial progress on the UringMachine fiber scheduler implementation, and also learned quite a bit about the inner workings of the Ruby I/O layer. Following is my weekly report: I ...
OSS Friday Update
Note: while my schedule is quite hectic these last few weeks, I’ve taken the decision to dedicate at least one day per week for developing open-source tools, and henceforth I plan to post an update on...
You Win Some, You Lose Some: On Papercraft and More
In the last few weeks I’ve been busy with a few different projects, and I guess I’m not the only freelancer who has trouble finding their work-life balance. That is, in the last few weeks life has bee...
Papercraft 3.0 Released
I have just released Papercraft version 3.0. This release includes a new API for rendering templates, improved XML support and an improved API for the Papercraft::Template wrapper class. Below is a di...
Papercraft update: IRB Support, Bug Fixes, More Speed
This week I was away on a little trip to Paris to attend a Paris.rb meetup and meet some friends, so I was less productive, but still got some stuff done, and still managed to do some work on Papercra...
Hanami on Papercraft
Lately I’ve been really excited about Papercraft and the possibilities it brings to developing web apps with Ruby. Frankly, the more I use it, the more I see how simple and joyful it can be to write b...
Papercraft Update: New Version, New Website
I’ve been working quite a bit on Papercraft these last few weeks. Yesterday I released Papercraft version 2.16, and here are some of the notable changes introduced since the last update: • Emit DOCTY...
Words Can Hurt: A Plea to the Ruby Community
I’ve been watching the recent drama within the Ruby community slowly devolve in the last few days into name-calling and virtue-signalling, and frankly just plain silliness. I won’t repeat here the det...
My Thoughts on Euruko
I’ve just got back home from Euruko last night. The conference ended on Friday, but I decided to stay two more nights in Portugal and visit Porto. In between walking all over the city, eating great fo...
P2 Is the New Papercraft
In the last few months I’ve been busy working on a few different open-source projects. Some of those projects are still at a preliminary stage, and I’m taking my time in continuing to develop them, us...
How I Made Ruby Faster Than Ruby
Note: P2 is now folded back into Papercraft. The P2 repository will eventually be archived. If you’re a Ruby programmer, you most probably will be familiar ERB templates and the distinctive syntax wh...
P2 – A Functional HTML Templating Engine for Ruby
Note: P2 is now folded back into Papercraft. The P2 repository will eventually be archived. I’ve just released P2, a new HTML templating engine for Ruby. P2 builds on the work I did in Papercraft, but...