Verbs with Daniel Coulbourne

Verbs with Daniel Coulbourne

Aug 05, 2025

In this episode, we talk with Daniel Coulbourne about the Verb library for Laravel, which provides an opinionated, user-friendly introduction to event sourcing. Links: Verbs Library - https://verbs.thunk.dev/ HoneyBadger.io - https://HoneyBadger.io Our Discord - https://discord.gg/aMTxunVx Daniel's Social Media: Bluesky - https://bsky.app/profile/coulb.com Simon's Social Media: Twitter - https://x.com/simonhamp Scott's Social Media: Website - https://scott.keck-warren.com/ Bluesky - https://bsky.app/profile/scottkeckwarren.bsky.social LinkedIn - https://www.linkedin.com/in/scott-keck-warren-91689810/ Mastodon - https://phpc.social/@scottkeckwarren

Transcript

Scott Keck-Warren Scott Keck-Warren 0:01
Hello developers, and welcome to the PHP Architect Community Corner, where we have conversations with members of the web development community. I'm your host, Scott Keck Warren, and today we're talking to Daniel Colbourne about the Verbs library for Laravel. Daniel Colbourne runs a small software development shop called thunk.dev with some of his closest friends. He lives in Philly, grew up in Japan, and was raised by hip-hop and the internet. Thank you, Daniel, for finding some time to talk to us today.
B
Speaker B 0:29
Of course. Thanks for having me.
Scott Keck-Warren Scott Keck-Warren 0:31
Yeah, absolutely. So you're one of the maintainers of the Verb package. Can you talk to us a little bit about what it is that Verb does and the problem that it's trying to solve?
B
Speaker B 0:40
Yeah, totally. So Verb is an event sourcing package for Laravel. So at its base, it's just trying to bring the magic of event sourcing kind of easily to the average Laravel developer, I would say. So We found, you know, I had done a bunch of event sourcing stuff over the years, and I had found that, you know, rolling your own event sourcing system is actually not terribly complicated. Like, it's a relatively straightforward pattern to implement. But, and there were also a few other packages out there. A lot of the other packages out there, we found, you know, event sourcing kind of came out of the like DDD, Domain-Driven Design, world. And that world tends to use some words and some jargon that are a little bit confusing to new folks. And so we built Verbs to kind of offer event sourcing as a unit that didn't require a full buy-in to a full DDD-architected application, just to kind of— you know, give you a taste. So that was our initial goal with Burp, was to sort of build something very simple, very idiomatically Laravel, and very accessible to folks who maybe didn't have all the context of like Blue Book DDD.
Scott Keck-Warren Scott Keck-Warren 2:05
Okay. And can you just for like a quick like step backwards, maybe can you explain what event sourcing is as opposed to like what it's replacing?
B
Speaker B 2:13
Yeah. So event sourcing is a pattern where Rather than just, you know, I think as object-oriented programmers, we're kind of used to storing nouns in our database, right? So we store objects and those objects have properties. And over time, as things happen in your application, those objects and properties change. We add new objects, we update properties on existing objects, et cetera. And that's well and good and often represents the world very accurately. But Event sourcing is an attempt to, rather than storing the nouns, the results of the actions that happened, we store the actions themselves, and we generally try to derive the state of the world from the stored actions. And so the events, the things that happened, are the things that we store, and we can sort of, by knowing what happened, derive the state of the world. And so for example, say a user subscribed to a plan and then upgraded their subscription and then downgraded their subscription and then canceled, right? We need to know how much to invoice that user for at the end of the year, right? And so we can sort of using those events figure out, okay, well, they were this, they were no subscription for the first 2 months, they were high-level subscription for the next 2 months, they were low-level subscription for the 2 months after that, and then they were then they canceled, right? And so intuitively, whenever we run into a data issue as developers, we try and go back and figure out what happened, right? We're like, okay, well, the data is weird. Now let's go back and figure out what happened from like clues that are hidden in these objects and their properties, right? We see, oh, the updatedAt timestamp here matches this. So we can probably guess that that's when they updated. So we do that in event sourcing. It's just we're explicit about storing what happened.
Scott Keck-Warren Scott Keck-Warren 4:09
Yeah. And so I use event sourcing. So I don't use verbs. We built our solution before verbs I think even existed. But it's really helpful for us because we have long-lived things within our system. I can't really get into details, but we have long-lived things and they might change state every week. And so like we have people that come back and they say, well, how come this didn't happen in like February? And we'll be like, well, let's look at all the events that occurred between February and now and go, okay, well, this is why, right? Like we, this person wasn't in this subscription plan or whatever. So it's like a really powerful like tool for that, like going back for us at least is like going back in time and looking at like things as they adjust.
B
Speaker B 4:48
Yeah. Um, the first place I did event sourcing was when I worked at InterNACHI, which is, uh, where my Co-author of Verbs, Chris Morell, is the— he runs InterNACHI, which is the International Association of Certified Home Inspectors. And it's basically an entire organization about answering the question, was this person a licensed home inspector in this state at this moment in time? Right? And there's a million ingredients that go into answering that question, right? Depending on what state they're in and what licensure they have and what blah, blah, blah, blah, blah. And so we— event sourcing was like really useful for us in sort of answering those sorts of questions, right? Like, did all of the right things happen in the right order that lead to this person actually being a licensed home inspector?
Scott Keck-Warren Scott Keck-Warren 5:34
All
B
Speaker B 5:35
right. And one of the most powerful things about it is if the criteria change, you can update your business logic. But what actually happened didn't change, right? So what happens doesn't change, but the meaning of what happened can change over time.
Scott Keck-Warren Scott Keck-Warren 5:49
Right. And I was, and the thing I always find interesting, it's like, so essentially like you're taking like this stream of events and like doing stuff with it, right? Like it's kind of like a log of like everything that happened to that person. And so we, we've like, the thing I really love about it is like, we might need like the state of the person and also like a report that says, well, what, what people are in what state at one, you know, at some time, right? Like you might have like, how many inspectors do we have? Well, that might take a couple seconds to run in the database, or you could have like— A projection of it or something like that. So it is really like a powerful, like, tool essentially.
B
Speaker B 6:19
So totally.
Scott Keck-Warren Scott Keck-Warren 6:20
Yeah. And we'll be back after this word from our sponsors. Let me tell you a quick story about our partner honeybadger.io. One time a customer of theirs had a background job run overnight that caused hundreds of thousands of errors to be reported to Honeybadger by mistake. Like many other error tracking and performance monitoring tools, Honeybadger bills for monthly usage. So this customer's mistake was going to cost them a lot of extra money that month. If you've ever used a monitoring service, you might have experienced something like this. Well, fortunately for this customer, they emailed Honeybadger support and received the most amazing reply. Honeybadger was resetting their monthly quota and canceling their bill. This is just one example of how the small team at Honeybadger cares about their users. Ask anyone you know and you'll hear similar stories. Go check them out at honeybadger.io. It's free to get started, setup takes less than 5 minutes, and don't forget to bookmark it. That's honeybadger.io. And we're back talking with Daniel about the Verbs Pack. Um, so, and I did notice that like one of the cool things that you have on your website is like you have a combating jargon page and like you kind of talked about how like, um, because like in the event sourcing library that we're using right now, like there's, there's an event and then there's like projectors and reactors and you kind of have just kind of like, and I hate to say this word, but like smooshed them together, right? Like all of those things kind of—
B
Speaker B 7:27
It's the word we say. We smoosh them. Oh, okay.
Scott Keck-Warren Scott Keck-Warren 7:29
Okay. Because all those things kind of like exist within, as opposed to having multiple classes to handle all those different pieces, you kind of have just like combined them into one, which, which Which is like, it's kind of neat because like you don't have to worry about like looking— like that's one of the issues that we have is like, well, this thing happens and then there might be 4 things that like we have to then update. Instead, it's in one spot.
B
Speaker B 7:50
Or if like, if you have some bug that's happening around a certain event, you might have to go digging in a million different files to figure out where that bug exists, right? It's like, oh, is it in this projector? Oh, maybe it's in one of the reactors. I don't know. You know?
Scott Keck-Warren Scott Keck-Warren 8:06
Yeah. So, so do you ever run into like, so like one of the things that we tend to do is like, sometimes we might never not need an event anymore, right? Like it kind of like outlives its usefulness or like the column that we were updating, but like in, in, in your like model, like how, so like, let's say like we have an event and it just updates like one column, like then do you keep that around? Um, like obviously you need to keep the event around, but like, do you keep the logic that does the projection around? Or is that, do you kind of like let that disappear as well? Yeah.
B
Speaker B 8:33
Generally, we'll keep it around unless we have a, you know, a good reason to kill it. We've been talking a lot about event versioning recently, you know, and we haven't like built first-class support for event versioning into Verbs yet. We have a plan for it, right? Okay. We know how we want to architect it, and we've talked about it pretty extensively at this point, but I think long-term, that's probably like something that we'll publish with event versioning is maybe like event archiving or something where we basically say like, this is an event, like you shouldn't use this event anymore. Right. And so like it can still replay. The thing with like the, the handler logic is that like in theory you want to keep it because if you ever want to replay these events, you want to be able to— you know, respond to them accurately, right? So yeah, I think archiving would theoretically be a good approach because we could basically prevent you from firing new copies of that event, but not prevent it from replaying or whatever.
Scott Keck-Warren Scott Keck-Warren 9:41
Okay. Yeah, that sounds excellent. I'm really looking forward to that because that would be very helpful for some of the stuff we do because we just like kind of, we have some logic in there right now that says like, you know, we deprecate the event, we like mark it as deprecated and then like hope that like somebody realizes that it's deprecated, because there's really not a good way to like archive it, like, like you're saying. So, um, so, so like, and one of the things that I also like about your website is like a lot of times, like when you look at one of these, they, they talk about that when a lot of times when you talk about like an event sourcing library, they, their example is a, uh, like a banking application, which is like, I don't know, like the best example, but you guys will, you guys have used like a board game example, right? Yep. Because it's like, it's the same kind of thing where you have a lot of events occurring and like, there's like a current state and past state, which is always kind of interesting. Um, So what other like interesting problems have you seen that event sourcing can solve?
B
Speaker B 10:32
Yeah. So we try not to use the banking example on purpose because I think enough people have heard the banking example and then decided that event sourcing wasn't for them because they don't work in finance that we, we just decided like, I'm not— I'm never going to like in a talk or in the docs or whatever, come out and say like, this is event sourcing. Imagine a bank account, you know, just it seems a little off-putting. The board game we use because we build games all the time with event sourcing. So we build games internally. We build— we built a conference game for Laracon last year. We're building another one this year that's very fun. We actually just built a whole like engine for like in-person conference games and stuff. It's very cool. But also I think it's like in like real-world business applications, I think it's very good for billing subscriptions, plans, anything around like You care a lot about what happened around your billing, right? And a bug there is, especially one that happened 6 months ago that messed everything up from now till then, is a big problem. And you can use event sourcing to extract data that you don't know that you want yet, which is, I think, one of the most valuable things about it. One of the things we suggest is just like in your billing code, just start firing some events. Like when you get like the Stripe success webhook back, just fire off an event that says like user subscribed, here's all the information about that, right? Even if you don't listen to those events, even if you don't do anything with them, you have the event now. And then in the future, if you want to use like your user subscribed and user unsubscribed events to generate like a rolling churn number or something over time, Mm-hmm. you can do that, right? Um, and so if you want to say like, hey, what was our churn between August and October of 2023? Well, I know that because I was, I happened to be just firing off these random events every time someone subscribed and unsubscribed. So now I can generate a churn report or something.
Scott Keck-Warren Scott Keck-Warren 12:37
Yeah. And like, and I've, I've had to go back in time before, like we haven't, when we didn't use it, I've had to go back in time before and like figure that out. And it is a nightmare. Like I just, like, it's such a nightmare.
B
Speaker B 12:46
You're writing now, you're writing like a command that parses a CSV output from whatever your billing provider is or whatever, you know, it's
Scott Keck-Warren Scott Keck-Warren 12:54
Right.
B
Speaker B 12:54
You're borrowing someone else's events.
Scott Keck-Warren Scott Keck-Warren 12:55
Yeah, no, it's a total nightmare of epic proportions. So, um, so it does look like there's, there's like good testing. You guys have like some amazing like testing documentation, which I always appreciate. Um, so like, is there, um, like, and like, how does it like, so you have this event stream and you have to store that. And so right now, does it just work with like your existing database or do you have the ability to do like other, like, could we put it in Kafka or could we put it in some other, other event or other storage area? Or is it just kind of like database only right now?
B
Speaker B 13:26
We haven't written Kafka support, but there's nothing stopping you from writing Kafka support. So everything's very modular. And so you can— so we have a class called the event store. The event store class, the default event store class that Verve ships with just uses like your default database, but it's Laravel. You can just write your own event store and bind it to the container and we'll just use your event store. Okay. instead. So if you want to write an event store that uses Kafka or RabbitMQ or some other like, or you want to store all of your events in, you know, there's, there are these new like event databases that exist, right? So if you want to store all of your events in some special event database, you can do that as well. So the event store is there for you to rewrite as you, as you desire and hopefully open source what you write.
Scott Keck-Warren Scott Keck-Warren 14:15
Yeah. Okay. Well, that's, that sounds great. I definitely like, I haven't yet been able to use Verbs for like an example, but I'm gonna like try and sit down and build something with it. Like before I publish this interview, essentially. But is there anything else that you'd like to direct our listeners to before we say goodbye for today?
B
Speaker B 14:30
Definitely go play with Verbs. It's verbs.thunk.dev. If you're looking for help with writing some code, or we also do a lot of sort of like product and strategy consulting. We have— my business partner, John, is a product manager by trade, and now he's become a programmer slowly over time. So we do a lot of helping people figure out what they need to build, helping them fix process problems that they might be having. And then we actually do a lot of building ourselves. So check us out, thunk.dev. We're like a small consulting company.
Scott Keck-Warren Scott Keck-Warren 15:03
Yeah, I think— I don't think it's like enough people understand how many times like not having a process can be like as detrimental as having a process that you follow. And so like, you know, like I haven't worked with you all, but like there's definitely like most teams need someone to sit down and say, here's the processes that you need at the very least, right?
B
Speaker B 15:20
Yeah. Well, this is something John talks about a lot, but just like not having a process is a It's just the worst one.
Scott Keck-Warren Scott Keck-Warren 15:27
Right. It's the worst. Yeah, it's definitely the worst possible one. So yeah. Um, well, awesome. Thank you for, uh, for talking with us today.
B
Speaker B 15:33
Awesome. Thanks, y'all.
Scott Keck-Warren Scott Keck-Warren 15:35
I have to say another heartfelt thank you to Daniel for all of his time and also for you for listening. If you're not already a subscriber, make sure you subscribe with whatever your preferred method is so you can get episodes as soon as they're released and maybe share this post with a coworker so they can learn about verbs as well. This podcast is available both in an audio version on the PHP Architect website, as well as a video version on our YouTube channel. This is Scott Cack Warren for the PHP Architect Community Corner, signing off and reminding you to keep listening, keep coding, and keep reading.