A series of Datomic introduction articles, using SQL to explain certain abstract ideas
Once, I came across a story shared by a teacher who taught DDD (domain-driven design). He mentioned that after conducting a course on event sourcing, some participants told him, “Teacher, this event sourcing thing... it seems hard to apply in practice.”
There are other similar stories. During my time at a particular organization, I asked some colleagues if they had ever implemented event sourcing. One colleague replied, “Yes, but that project ended in disaster. Someone even got so frustrated that he quitted.”
Strangely enough, when I use event sourcing, it works perfectly fine—no difficulties at all.
You might think I’m about to tell you that I’m some kind of 10x engineer. That’s not the case. What I’m really here to share is my secret: I use a database with built-in event sourcing—Datomic.
The completion of this article series is largely inspired by my work at Gaiwan and LambdaIsland. Additionally, while attending Heart of Clojure, I learned that non-Chinese readers were also interested, so I translated the original Traditional Chinese version into English.
If you have any thoughts after reading this series, feel free to reach out to me.
- Preface: My Clients Call Me a Heretic
- Event Sourcing
- OLTP
- Event Sourcing
- Advantages
- Implementation Challenges
- Common Flaws in SQL Databases
- Inability to Rewind Database State
- String-Based Query Languages
- Common Flaws of SQL Databases - Continued
- Locking and Isolation Issues
- Schemas Are Hard to Query
- Rigid and Fixed Schemas
- Impedance Mismatch
- The Database Category of Datomic
- The Clojure Language
- Starting with Datalog — Part 1
- Learn Datalog Today
- Starting with Datalog - Part 2
- Datomic's Information Model
- Basic Datalog Queries
- Starting with Datalog - Part 3
- Multiple Data Patterns Sharing a Variable
- Multiple Data Patterns with Multiple Variables
- Starting with Datalog - Part 4
- Parameterized Queries in Datalog
- Starting with Datalog - Part 5
- Binding Forms in Datalog
- Starting with Datalog - Part 6 (More Queries)
- Querying Attributes
- Querying Transactions
- Starting with Datalog -- Part 7 (More Joins)
- Using Datalog to Perform Various SQL Joins
- Starting with Datalog -- Part 8 (Predicates and Transformation Functions)
- Five Types of Clauses
- Predicate Expressions
- Function Expressions
- Runtime Environment
- Starting with Datalog -- Part 9 (Aggregates and the With Clause)
- Built-in Aggregate Functions in Datalog
- The With Clause
- Starting with Datalog -- Part 10 (Find Specifications)
- The Four Common Find Specifications in Datalog
- Starting with Datalog - Part 11 (Rules)
- Using Datalog Rules
- Characteristics of Rules
- Starting with Datalog -- part 12 (Cross-Database Join)
- Cross-Database Queries in Datalog
- Starting with Datalog -- part 13 (SQL Window Function)
- Top N per Group
- Starting with Datalog -- part 14 (Subqueries)
- Pull API
- Recursive Queries
- All Attributes
- Reverse Queries
- Impedance Mismatch and Datomic's Solution
- Common Solutions
- Analyzing the Impedance
- Datomic's Solution
- as-of Query
- Code and Data Examples
- Database Filters
- Column Schema
- No Need for NULL Values
- Shared Column Schema
- No Need for Bridge Tables
- Writing to Datomic
- Defining a Schema
- Data Types for
- Writing Actual Data
- Format of Transaction Data ()
- Unique Transaction Semantics in Datomic
- Primary Key and Entity ID
- Datomic Makes the Primary Key Decision for You
- Enum Types and
- Constraints
- Common Applications
- Advanced Applications
- Indexes and Performance
- Internal Structure of Indexes
- Performance Optimization -- part 1
- Guidelines
- Measurement Tools
- Performance Optimization -- Part 2
- Direct Access to Datomic's Indexes
- For OLAP Queries, Use Change Data Capture (CDC)
- The Business Value of Datomic: A New Database Paradigm
- Event Sourcing
- Highly Expressive Query Language
- Unique Distributed Architecture
- Conclusion
Copyright @ Laurence Chen
Licensed under the term of the Creative Commons Attribution 4.0 International License.