惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
宝玉的分享
宝玉的分享
腾讯CDC
博客园_首页
T
Tailwind CSS Blog
月光博客
月光博客
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
SecWiki News
SecWiki News
美团技术团队
P
Privacy International News Feed
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
Y
Y Combinator Blog
D
DataBreaches.Net
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
S
Schneier on Security
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
Forbes - Security
Forbes - Security
D
Docker
T
Tenable Blog
S
Secure Thoughts
雷峰网
雷峰网
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
The Cloudflare Blog
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志

Hacker News

Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line Building a Z-Machine in the worst possible language High-Level Rust: Getting 80% of the Benefits with 20% of the Pain GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The air throughout our homes is infused with microplastics. But there are things you can do to breathe less of them The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong Artemis II crew splashes down near San Diego after historic moon mission We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Cooperative Vectors Introduction | Evolve Keeping a Postgres queue healthy — PlanetScale Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? The Zettelkasten Method in Obsidian: A Practical Setup Guide Artemis II Is Competency Porn and We Are Starving For It WeakC4 Flight Viz — Cockpit View A Mexican surveillance giant you’ve never heard of is now watching the U.S. border Surelock: Deadlock-Free Mutexes for Rust RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu The Problem That Built an Industry How Much Linear Memory Access Is Enough? | Solidean Investigating Split Locks on x86-64 Simplest hash functions Sybilproof reputation mechanisms (2005) [pdf] What is a property? How Complex is my Code? Static code analysis in Kotlin — tools overview Toffoli gates are all you need PGLite evangelism dcmake: a new CMake debugger UI Clojure on Fennel part one: Persistent Data Structures Fragments: April 2 Python Release Python install manager 26.1 The Life and Death of the Book Review - Liberties Introducing Database Traffic Control — PlanetScale Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Building slogbox Apple Silicon and Virtual Machines: Beating the 2 VM Limit Who was “Not Even Wrong” first? Pokemon Evolution Vs Darwinian Evolution The APL Programming Language Source Code
EventQL: A SQL-Inspired Query Language Designed for Event Sourcing
2026-05-14 · via Hacker News

The Normandy's Code

My personal blog


Project maintained by YoEight Hosted on GitHub Pages — Theme by mattgraham

Event sourcing has become an increasingly popular architectural pattern, but querying event streams efficiently has remained a challenge. While events are append-only and immutable, finding specific events or analyzing patterns across thousands or millions of events requires thoughtful query design. This is where EventQL shines.

The Problem with Querying Events

When working with event-sourced systems, you’re dealing with fundamentally different data structures than traditional databases:

  • Events have rich metadata: type, subject, timestamp, data payload
  • Events are organized hierarchically through subjects (e.g., /books/42, /users/123/orders/456)
  • You need to filter, aggregate, and transform streams of events
  • Performance depends heavily on leveraging the right indexes

Traditional NoSQL query interfaces often fall short because they weren’t designed with these event-specific characteristics in mind.

Enter EventQL

EventQL is a query language originally designed for EventSourcingDB by The Native Web. What makes it special is how well it captures the essence of event querying while maintaining SQL’s familiar expressiveness.

Here’s a simple example:

FROM e IN events
WHERE e.type == "io.eventsourcingdb.library.book-acquired"
  AND e.data.price > 20
PROJECT INTO {
  id: e.id,
  title: e.data.title,
  price: e.data.price
}

If you’ve written SQL, this feels immediately familiar. But notice how it’s tailored for events: we’re filtering by event type, accessing nested data payloads, and reshaping the output.

Why EventQL’s Design Matters

1. First-Class Event Properties

EventQL treats event metadata as first-class citizens in the query language:

  • e.type - Filter by event type
  • e.subject - Query by subject hierarchy
  • e.id - Reference specific events
  • e.time - Time-based sorting and filtering
  • e.data.* - Deep access into event payloads

Each of these properties represents an indexing opportunity. A well-designed event store can create indexes on types, subjects, and timestamps, making these queries blazingly fast.

2. Subject Hierarchies Enable Smart Scoping

One of EventQL’s most powerful features is subject pattern matching:

FROM e IN events
WHERE e.subject == "/books/42"
ORDER BY e.time DESC
TOP 100
PROJECT INTO e

Subject hierarchies like /books/42 or /users/123/orders/456 are natural in event sourcing. They represent aggregate boundaries and allow you to:

  • Scope queries to specific aggregates
  • Create subject-based indexes for rapid lookups
  • Build hierarchy-aware queries (though not shown in basic examples)

This makes browsing event data intuitive: “Show me all events for this book” or “What happened to this user’s orders?”

3. SQL-Like Expressiveness

EventQL borrows SQL’s proven patterns:

  • WHERE clauses with full boolean logic (AND, OR, NOT)
  • ORDER BY for sorting with ASC/DESC
  • GROUP BY for aggregations
  • TOP/SKIP for pagination
  • Nested subqueries for complex transformations

This means you can express intricate queries precisely:

FROM e IN (
  FROM e IN events
  WHERE e.type == "order-placed"
  PROJECT INTO {
    orderId: e.id,
    total: e.data.total
  }
)
WHERE e.total > 100
ORDER BY e.total DESC
PROJECT INTO e

4. Projection as a First-Class Concept

Unlike SQL’s optional SELECT, EventQL requires explicit projection with PROJECT INTO. This design choice makes sense for event queries where you often want to:

  • Reshape nested event data
  • Extract specific fields from payloads
  • Build aggregates or computed values
FROM e IN events
WHERE e.type == "book-acquired"
PROJECT INTO {
  year: YEAR(e.time),
  revenue: SUM(e.data.price)
}

The projection syntax supports arbitrary object construction, making it easy to build exactly the output shape you need.

Index-Friendly by Design

What I particularly appreciate about EventQL is how naturally it guides you toward indexable queries. Consider the common properties used in WHERE clauses:

  • Event type - Almost always indexed
  • Subject - Natural partition key
  • Timestamp - Essential for time-range queries
  • Data fields - Can be indexed selectively

A query like this:

FROM e IN events
WHERE e.type == "user-registered"
  AND e.time > "2025-01-01"
  AND e.subject == "/users"
ORDER BY e.time DESC
TOP 1000
PROJECT INTO e

Maps beautifully to a composite index on (type, time, subject). The language’s structure makes it obvious where indexes will help.

Making the Parser Production-Ready

I originally wrote a parser for EventQL while working on my GethDB database project. It worked, but it was tightly coupled to that specific use case. Recently, I decided to make it production-ready as a standalone library.

The result is a robust Rust parser that:

  • Provides detailed error messages with line and column numbers
  • Builds a strongly-typed AST suitable for query optimization
  • Supports the full EventQL grammar
  • Includes comprehensive test coverage
  • Can be embedded in any Rust-based event store

Type Inference: Coming Soon

The GethDB version included a type inference system that I plan to port to this library as well. The type inferencer collects as much type information as possible from the query and catches inconsistencies early.

For example, it would reject queries like this:

FROM e IN events
WHERE e.data.price == "expensive"  -- price treated as string
  AND e.data.price > 100           -- price treated as number
PROJECT INTO e

By tracking how fields are used throughout the query, the type inferencer can rule out nonsensical queries before they ever reach the database. This provides better error messages and prevents runtime failures from type mismatches.

You can find the parser on GitHub: eventql-parser

Why This Matters

Event sourcing is powerful, but it needs good tooling. A well-designed query language makes the difference between an event store that’s painful to use and one that’s a joy to work with.

EventQL gets the fundamentals right:

  • It’s familiar (SQL-like syntax)
  • It’s expressive (complex queries are possible)
  • It’s event-aware (designed around event properties)
  • It’s index-friendly (natural optimization opportunities)

If you’re building an event-sourced system, you need a way to query your events effectively. EventQL shows how to do it right.

Try It Yourself

The parser is available as a Rust crate. Here’s how to get started:

use event_query_lang::parse_query;

let query = r#"
    FROM e IN events
    WHERE e.type == "order-placed"
    ORDER BY e.time DESC
    TOP 100
    PROJECT INTO e
"#;

match parse_query(query) {
    Ok(ast) => {
        // Use the AST to execute the query
        println!("Parsed successfully!");
    }
    Err(e) => {
        eprintln!("Parse error: {}", e);
    }
}

Conclusion

Good language design is about understanding the domain deeply and creating abstractions that feel natural. EventQL does this beautifully for event sourcing.

It proves that you don’t need to reinvent the wheel - SQL’s proven patterns work wonderfully when adapted thoughtfully to event streams. The result is a query language that’s both powerful and pleasant to use.

If you’re working with event sourcing, give EventQL a look. And if you need a production-ready parser, the Rust implementation is ready to use.


This parser was built to support my work on GethDB and other event-sourced systems. If you have feedback or want to contribute, issues and PRs are welcome on GitHub.