Bootstrapping an email service provider (with Jesse Hanley)
In this interview, I talk with Jesse Hanley, founder of Bento, about running a lean email service from Japan. We chat about the challenges of scaling infrastructure, managing databases, and maintaining a calm business while serving a global customer base.
Everything we said
Aaron Francis
Okay, welcome back, uh, to Database School. I'm your host, Aaron Francis, and I'm here today, uh, with my friend, Jesse Hanley. Um, Jesse runs a, a, an email service that I actually use, and I pay full freight for. So even though we're friends, you gotta-
Jesse Hanley
Thank you
Aaron Francis
... you gotta, you gotta pay your friends. And so- ... I use Bento, uh, love it. We use it for all of our courses, we use it for aaronfrancis.com, we use it for everything. So Jesse's running a pretty, uh, a pretty big operation over there, and he does it very, in a very lean way. So I'm excited to talk to him today. Jesse, do you want to introduce yourself?
Jesse Hanley
Yeah, sure. I'm Jesse. Uh, Aaron is a customer of mine, which I appreciate very much. Um, but yeah, I run Bento, which is an email service provider. We predominantly send marketing email, but recently have got more into transactional email, password resets, and all that kind of jazz. Um, and I kind of run it out of my home in Japan, uh, and have for the past four years in Japan.
So yeah, yeah, it's, and it's a fun, very calm business to run. So, um, I very much kind of-
Aaron Francis
See-
Jesse Hanley
... enjoy running it, yeah
Aaron Francis
... this blows my mind that you say that email and being an ESP is a calm business to run. How, first of all, how many... Is it, it's just you and you have some customer support, is that right, to cover some other-
Jesse Hanley
Yeah
Aaron Francis
... time zones or?
Jesse Hanley
It's, yeah, so I'm, I'm the primary developer, and then I've got, uh, Anya in support. She covers kind of the Eastern and the US-
Aaron Francis
Mm-hmm
Jesse Hanley
... time zones when I'm sleeping. Um, and so if something goes down, then I get a call, wake up, and I'm on call and all that kind of jazz. We also have, uh, contractors for various different parts of the operation. So for example, at the moment I've got Fast, the FastRuby team, they're working on upgrading our-
Aaron Francis
Cool
Jesse Hanley
... you know, main monolith, uh, app-
Aaron Francis
Yeah
Jesse Hanley
... and all that kind of stuff. Get... And we'll kind of go into why they're working on that at the moment, 'cause that kind of ties into some of the other stuff, uh, database-related stuff.
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, I've got, like, deliverability consultants that I work with. I just kind of bring in experts, and so the way that I've tried-
Aaron Francis
Right
Jesse Hanley
... to build the team is less kind of full-time on the payroll staff, and more kind of experts, contractors that kind of-
Aaron Francis
Mm
Jesse Hanley
... either work consistently or they kind of come in for very specific jobs. Come in and then bounce out. Um, and I've, I've always liked working that way. It's kind of really fun.
Aaron Francis
Yeah. And it's, it's shocking to me because, you know, you run, you run support out of a Discord that is very active. And, um-
Jesse Hanley
Yeah
Aaron Francis
... you are very active in there. And I'm like, "When does Jesse, one-"
Jesse Hanley
But it's not odd.
Aaron Francis
"When does he sleep? And two, when does he develop?" Because I know he lives in Japan. He's in there talking to customers like me, who can't, who can't figure out how to do something, and you're like, "Hey, use the button that's right in front of your face." And I'm like, "Oh, yeah, you should put a button there." So how do you, how do you, like, manage your time that you're always in this Discord or responding to my DMs?
Jesse Hanley
Um, uh, well, so, so, like, Discord, Discord is... Like, this is a little bit of a tangent. Discord's really nice for support 'cause I, I, I've got it on my phone.
Aaron Francis
Mm-hmm.
Jesse Hanley
I can quickly message people, respond really fast. Um, luckily, like, the software's not that buggy, touch wood. So, like- ... often it's, it's a user thing, like they've accidentally deleted their DNS records in a migration, so they've just gotta add them back again.
Aaron Francis
Right.
Jesse Hanley
And boom, their open rate's back up. Um, so 90% of the tickets are, like, by the user errors or they're a little bit confused or they just need to, like, learn something. And so Discord's a nice medium. And also, people are, like, less... I'm trying to work out, like, the PC way to say this. People are, like- ... way nicer on Discord than they are on email.
Aaron Francis
Interesting.
Jesse Hanley
On email, people are, like, awful. They're, like, super rude, super blunt.
Aaron Francis
Huh.
Jesse Hanley
"Dear sir, dear ma'am, who- whom this concerns, F you, I've got an issue."
Aaron Francis
Mm-hmm.
Jesse Hanley
Whereas on Discord, because there's hundreds of people observing them, they're super chill, right? And-
Aaron Francis
Oh, that's interesting
Jesse Hanley
... I, I like, I like that, I like that dynamic of it. So from, like, a support perspective, it's very weird for customers to come into Discord, but when they see, like, a founder reply, they're like, "Well, this is awesome. I'm getting, like-
Aaron Francis
Mm-hmm
Jesse Hanley
... a founder response." They get a response very, very fast, which is great. Um, but also the exchange is a lot friendlier than elsewhere. So I, I kind of estimate that if I had to do email support, like, I only get, like, six emails a day, eight emails a day, like, on-
Aaron Francis
That's awesome
Jesse Hanley
... on email support, which is really, really low. Um, but that's actually been consistent for the last year despite growing almost double in the last 12 months.
Aaron Francis
Wow.
Jesse Hanley
So that's been interesting to me. And I think, like, if I didn't have Discord, maybe two to three full-time support people probably responding to tickets, and they'd have to be more skilled and all that kind of stuff. I also think people are a lot, um, more chill in terms of response times on Discord. Like, they're-
Aaron Francis
Mm-hmm
Jesse Hanley
... okay waiting a little bit if I'm sleeping, um, because Anya responds straight away, says, "Jesse will get back to you."
Aaron Francis
Right.
Jesse Hanley
And, like, just that quick response is, that, that's totally cool. So yeah, it's a different way of running the business, but I actually think it, it's calmer. It's weird at the start, but it's, it's a calm way to do it.
Aaron Francis
Yeah. It is, it is weird at the start. And as a customer coming into a Discord and seeing all the activity made me feel like, "Whoa, there's a lot going on here." So to hear you say it is calmer, I guess the activity was gonna happen either way. Like, you were either gonna get emails or people were gonna ask in Discord. Um, but the-
Jesse Hanley
Yeah
Aaron Francis
... the observation effect is very interesting, that people are better behaved when they're being observed. That is very-
Jesse Hanley
And I-
Aaron Francis
... clever. Hey, we'll get back to the interview in just one second, but since you're here, you like databases, you probably like Postgres. Let me tell you about Mastering Postgres. This is a course that I am teaching, coming out October 15th. This is a way that you can master the most important part of your stack, your database. So go to masteringpostgres.com and sign up to hear when we release it.
Okay, back to the interview.
Jesse Hanley
Yeah. And, uh, we've had instances in the past, this hasn't happened, like, in a while, where, um, European customers tend to be a little bit more, like, blunt, especially, like, Dutch-
Aaron Francis
Mm-hmm
Jesse Hanley
... customers. They tend to be very-
Aaron Francis
Mm
Jesse Hanley
... blunt with their feedback. And we've had instances-
Aaron Francis
Mm
Jesse Hanley
... where people have been a little bit too blunt with their feedback, and then almost, like, I don't know, blood cells on, like, a virus or something, they all just, like, come in- ... kind of defend. Um, and that's really nice because sometimes if you get an email that's, like, super blunt-
Aaron Francis
Sure
Jesse Hanley
Oh, I'm a ba- I'm a bad software maker. I'm gonna shut this business down
Aaron Francis
Uh-uh
Jesse Hanley
But in the community thing, it's, it's just a little bit more chill. Um, and I think in addition, Discord has been like a... Another benefit because, like, if there is an issue, like I, I accidentally shipped like a bad conditional and a button that wasn't supposed to be hidden was hidden. This happened yesterday.
Aaron Francis
Mm-hmm.
Jesse Hanley
I, like, pushed up some UI changes, right? And people come to the Discord so fast with, "Where's that button?" And I can quickly respond, "All right. It's shipped. 15 minutes, it's fixed." So anytime that there's an issue, it's like, such like a... Yeah, I just get this, like, live pulse through the Discord that-
Aaron Francis
Mm-hmm
Jesse Hanley
... maybe QA or, you know, a test can't really pick up. Um, and that's been really good. Or maybe, like, a button's missing. People are happy to come in and be like, "Where's this thing?" Um, in Discord, but they're never gonna email me that 'cause that's so much effort. But on Discord, they're happy to do it.
Aaron Francis
Right.
Jesse Hanley
So there's, there's a whole bunch of weird kind of benefits to running a business like that.
Aaron Francis
Yeah. Okay. That's interesting. 'Cause I, I had kinda always wondered why Discord, but this is all, this is all making sense now. And so tell us a little more. You are, uh, fully bootstrapped and-
Jesse Hanley
Yep. Self-funded
Aaron Francis
... uh, if you have the FastRuby team, it's all Ruby on Rails. Is that right?
Jesse Hanley
Mm-hmm. Yep. So, uh-
Aaron Francis
And how long, how long have you been doing this?
Jesse Hanley
Uh, I've been doing Bento like six years. The first-
Aaron Francis
Wow
Jesse Hanley
... like, four years I was running, uh, my agency full time, and then I exited that in COVID, and then I went full time onto Bento. And then kinda, like, really found my footing. For the most part, I was, like, running an agency, a marketing agency, and learning to code on the side.
Aaron Francis
Mm-hmm.
Jesse Hanley
And the way that I kind of improved my skills was I brought on really smart people like Andrew Culver.
Aaron Francis
Mm-hmm.
Jesse Hanley
I brought them in. I learned from them and then would take over more of the code base as I kind of got them to build stuff almost for me.
Aaron Francis
Mm-hmm.
Jesse Hanley
And then I would go, "Okay, cool. Like, that's how you're supposed to do it properly. Like, that's how a pro does it."
Aaron Francis
Mm-hmm.
Jesse Hanley
And, and every kind of core feature that I've built, I've done it that way. I've found an expert, built with them, learned from them, taken over the code base, and kind of that's been the process with Bento. So yeah, and the first four years was really just trying to, like, find my foot and it took a really long time. Like, those, lots of features that we launched that no one used. Those, lots of-
Aaron Francis
Hmm
Jesse Hanley
... products I was trying to, like, push on people that they never used. Um, and then after I went full time, I kind of really narrowed in on the email marketing side of thing. I was like, well, like, everyone, like, uses these features and they like using-
Aaron Francis
Mm-hmm
Jesse Hanley
... these features. I'm just gonna keep pulling on that thread. And after I kept pulling on that thread, like, we actually started to get some traction, and then the last two years has just been, no, we only send emails.
Aaron Francis
Yeah.
Jesse Hanley
And the more we, we, we, we, we leaned into that, um, the more people signed up, and the more people were like, "I need to send emails. I'm gonna try Bento." And, um, yeah. Yeah.
Aaron Francis
Amazing. And so where did you find... As, as you're, like, honing in your message, where are you finding that people are hearing about you? Like, how... It is a very, uh, it is a very crowded marketplace in terms of email-
Jesse Hanley
Mm-hmm
Aaron Francis
... which is a great thing 'cause everybody needs to send emails. So it seems like-
Jesse Hanley
Mm-hmm
Aaron Francis
... you know, Justin Jackson always talks about catching a wave, and email's still a wave, but where are you, like, carving out your niche amongst, uh, the other competitors?
Jesse Hanley
Yeah. The way that I kind of like to explain it is Bento for the most part is kinda like a local coffee shop of email marketing providers, right? So where, yeah, you're right. You've got, like, MailChimp, ActiveCampaign, they're like the Starbucks or like-
Aaron Francis
Mm-hmm
Jesse Hanley
... the Tully's Coffee of, of chains. Um, but just like a local coffee shop, people do tell others. We get customers from Twitter or referral or YouSayIt or, like, someone tweets about it, or some indie hacker in Bali mentions it, or someone searches for like a learn dash email marketing solution and come across that we integrate with them.
Aaron Francis
Hmm.
Jesse Hanley
Um, there's a lot of stuff like that, which it's just kind of breadcrumbs that have been left on the web.
Aaron Francis
Mm-hmm.
Jesse Hanley
And people discover these breadcrumbs, stumble, and then we become a category decision. So we become a decision out of many of the providers. Um, and then our job from then is to be, like, persistent. So we've got retargeting ads so people keep seeing us.
Aaron Francis
Hmm.
Jesse Hanley
Um, and so that when they do make the decision to switch, they do decide to choose us. Um, and then often it's because they've done a demo and they're like, "Okay, cool. I've got big company, big company, local coffee shop. And I can actually speak to Jesse. I've done a demo with him. He's active in the Discord. Uh, I can see that if someone has a very specific email not being delivered, he's given the exact reason why.
He's not gaslighting me. I'm gonna go with that dude." Um, and that's how we win business. And then from, like, the bootstrap perspective, it's like, well, email is profitable. This, like, you know... Our, our customers we price, we don't have free plans. We charge for everything. I charge you. We charge everyone.
Aaron Francis
Mm-hmm.
Jesse Hanley
And, and because of that, it's like a healthy, profitable business. Um, and so I'm not too concerned in growing a lot faster. Um, and we've got, you know, this morning I, like, banned five or six signups in the past couple of days. I'm just not interested in serving them.
Aaron Francis
Mm-hmm.
Jesse Hanley
And so we don't have massive amount of signups and so we can kind of keep afloat that way, if that makes sense, so.
Aaron Francis
Yeah. No, I think that makes-
Jesse Hanley
Yeah. YouTube videos, mentions-
Aaron Francis
... perfect sense
Jesse Hanley
... it's just all over the place.
Aaron Francis
Yeah. And then having been around for six years with a good track record of supporting your people, I imagine the word of mouth starts to compound a lot more, um, a lot later in the game now. So you've been, you know-
Jesse Hanley
Mm-hmm
Aaron Francis
... rolling this snowball for six years and now people are like, "Hey, let's talk about Jesse 'cause I've been, I've been here for a long time."
Jesse Hanley
Yeah. There was this, um... I won't mention his name, but there was this email copywriter I think I, like, sent you in, in DMs, like, "Oh, go, go check him out."
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, and I followed him from like 2010 to 2015, like, reading all of his stuff, right? And then he heard through, I think Brennan Dunn-
Aaron Francis
Mm-hmm
Jesse Hanley
... like, referred him somehow. And it's just like everything's connected in this weird sphere where it's like-
Aaron Francis
Mm-hmm
Jesse Hanley
... this guy that I followed over a decade ago spoke to one of my friends, and then now this guy that I super respected is considering moving to us next month. And it's like, whoa, how, like, how'd that happen?
Aaron Francis
Amazing.
Jesse Hanley
But you just, you just don't know. And I think the, the takeaway for me is always like, you just gotta stay in the game a really long time and, like, the key-
Aaron Francis
Yeah
Jesse Hanley
... is just surviving. And if you survive, stuff works out. Like-
Aaron Francis
Mm-hmm
Jesse Hanley
... and as long as, yeah, your North Star is survival, I, I, I think it all kind of pans out okay.
Aaron Francis
Yeah, and it sounds like you've optimized for survival with the no free tier, everybody gets charged a fair amount, but everybody gets charged, and you're gonna ban signups that would, I assume, end up being super problematic for your reputation-
Jesse Hanley
Yeah
Aaron Francis
... like your sending reputation or your other customers or something like that. And so you've put in some guardrails, uh, with an eye towards survival, it sounds like.
Jesse Hanley
Yeah. Yeah. Last night, I banned someone in Austria, uh, 'cause they kind of hurt our IP reputation, uh, on-
Aaron Francis
Mm
Jesse Hanley
... one mail stream, and it turned out it was, uh, one of my friend's girlfriends that signed up for a free trial, and so I had a-
Aaron Francis
Whoops
Jesse Hanley
... a lively debate with him last night- ... about that approval. I- ... I just thought she was some, some Austrian customer, and I was like, "All right. Bye," during her free trial. And it, it, it, it was not happy. But yeah, we've got a very strict bar, and once she cleans up her list, she'll be back in. Um, but yeah.
Aaron Francis
Perfect. Well, good luck to her. And good luck to you-
Jesse Hanley
Good luck to her
Aaron Francis
... and your friend's relationship.
Jesse Hanley
She's a good customer.
Aaron Francis
Um, okay. So I wanna talk tech choices a little bit. Um-
Jesse Hanley
Yeah
Aaron Francis
... so we've talked about Rails. You had Andrew Culver, so I assume this is, uh, either originally or, or still a Bullet Train application, which is An-
Jesse Hanley
Number one
Aaron Francis
... Andrew Culver built-
Jesse Hanley
Bullet Train install number one.
Aaron Francis
You're the first Bullet Train-
Jesse Hanley
Origin
Aaron Francis
... Joe-
Jesse Hanley
Origin, Origin, Origin customer number one. Origin customer number one. So, um, we-
Aaron Francis
I-
Jesse Hanley
... we, like-
Aaron Francis
... did not know that
Jesse Hanley
... s- so, so Bullet Train was built with Bento at the same time. So they, like-
Aaron Francis
Really?
Jesse Hanley
... that, that's kinda how it started, right? So the, the, the origin of Bullet Train, Bento was kind of the base project, um, that was being dogfooded, uh, for the whole start. So that, that's, that's how that worked, and me and Andrew caught up in, yeah, in Japan to initiate that, so yeah. So
Aaron Francis
Okay. I did not, I did not know that. That is pretty, that's good lore right there.
Jesse Hanley
There's some lore.
Aaron Francis
So Bullet Train, for the, for the people that don't know, is like a, it's more than an application starter kit. It's, it's in the, it's in the Rails space. Uh, its closest, uh, analogy would be an application starter kit, but it's more, it's more like a framework on top of a framework because there's lots of-
Jesse Hanley
Yeah, generators and stuff
Aaron Francis
... on, yeah. There's lots of ongoing code generation and stuff like that, um, versus just, like, you get a starter kit and you eject and you keep going. Um, so is it still... Like, have you outgrown it? Is it still Bullet Train-
Jesse Hanley
Yeah, yeah, yeah
Aaron Francis
... down there?
Jesse Hanley
Yeah. We, we, we pretty severely forked. We, like, I kind of went off-
Aaron Francis
I don't think so
Jesse Hanley
... off, off the rails. I went off the rails-
Aaron Francis
Yeah
Jesse Hanley
... uh, a while, a while ago. Um, and so yeah, no. But also, like, different direction. Andrew stayed, I think, from... I gotta go check out the repo, but I'm pretty sure he stayed, like, relatively, uh, close to core, like Stimulus and used all that kind of-
Aaron Francis
Mm
Jesse Hanley
... JavaScript stuff. I wasn't so interested in that. I, I like React. Um, I was, I was React curious, and then I started really liking it after I started playing with it a lot more. Um, and so a lot of, like, front end stuff in Bento is, like, React sprinkles on top. I use React components, and then-
Aaron Francis
Mm-hmm
Jesse Hanley
... you know, like our flows automated, you know, the diagram automation builder-
Aaron Francis
Yeah
Jesse Hanley
... that's all just in React. So, um-
Aaron Francis
Yeah, there's no way-
Jesse Hanley
... you can't do that in Stimulus
Aaron Francis
... you're doing that in Stimulus. Yeah.
Jesse Hanley
No.
Aaron Francis
Yeah. So the, uh, what he's talking about is there's a, like, automation engine kinda thing, and it's, like, on a-
Jesse Hanley
Drag and drop
Aaron Francis
... canvas, and you can drag nodes in and connect them, and it's, it's extremely powerful and also extremely impossible to do with HTML alone. So that makes-
Jesse Hanley
Yeah. Yeah. Yeah
Aaron Francis
... that makes sense to me. Um, okay. So let's talk Postgres. So you're Rails, I gather you're still hosted on Heroku?
Jesse Hanley
Yep. Yeah, yep. So we've got, um-
Aaron Francis
Okay
Jesse Hanley
... so we've got, uh, two, uh, apps on Heroku. We've got our kind of monolith app, and then we've got our chat app. Um, chat's like two-way conversations. Um-
Aaron Francis
Okay
Jesse Hanley
... they're both live on Heroku. Uh, and then we also have our own sending servers. So we use a couple of third-party API providers, but we also have our own, uh, MTA network, and that is actually physically what delivers the emails to inboxes. So when-
Aaron Francis
Wow
Jesse Hanley
... aaronfrancis.com sends an email, it goes to our MTA, and we deliver it, not SendGrid, Postmark, all that kind of stuff. So-
Aaron Francis
Really?
Jesse Hanley
Um, yeah. For, like, for the last year, all of your personal emails have gone through, like, Bento's network, not through any third-party, uh, provider. Um, and that's-
Aaron Francis
I didn't know that
Jesse Hanley
... on Postgres too.
Aaron Francis
Let's, let's take a little, yeah, let's take a little pause from Postgres. You're running your own mail servers? Isn't that, like, hard mode?
Jesse Hanley
Yeah.
Aaron Francis
Yeah.
Jesse Hanley
It's extreme, dude.
Aaron Francis
Yeah. So why are you running your own mail servers?
Jesse Hanley
I don't know, because, um... I don't know. I thought it was a good idea.
Aaron Francis
That's fantastic.
Jesse Hanley
Uh, it's been, it's been very traumatic. Um, it's been-
Aaron Francis
Okay.
Jesse Hanley
... it's been, it's been quite a traumatic experience, but, um, it's been quite enlightening. Um, let me, let me-- I just laughed so hard I almost cried. Uh, so- ... uh, yeah. So it's been, it's been, it's been an experience. So I decided to do it because obviously as we scale, um, sending more emails costs more money, right?
Aaron Francis
Yeah.
Jesse Hanley
Um, and also what happens if, like, one of the providers I use go down?
Aaron Francis
Sure.
Jesse Hanley
I, I need, I need redundancy in the system, or let's say, like, an automated system, this probably won't happen because, like, I've got enterprise accounts everywhere, but let's say, like, an automated system, uh, bans my account, I need to send.
Aaron Francis
Mm-hmm.
Jesse Hanley
I, I can't not send. Um, so I wanted to have-
Aaron Francis
Yeah, that's not, that's not my problem. That's your problem. So I-
Jesse Hanley
That's my problem, right?
Aaron Francis
I agree. Yeah, which sounds terrifying.
Jesse Hanley
So I need, I needed a way to have, like, resilience, resiliency in the, in the network. Um, and so having my own servers was an exploratory project for me.
Aaron Francis
Mm.
Jesse Hanley
Um, and so I did explore that. I won't go into too much detail on, like, how I do it, um, but the end result is we've got servers up, we have multiple IP addresses, uh, we send on them, and it's, it's very, very different. It's more like, you know, like last night I have, like, an open ticket with Hotmail asking them to, like, mitigate-
Aaron Francis
Hotmail
Jesse Hanley
... some of my new IPs and stuff because, you know, you do-- you gotta do that or you gotta do, what is it, preemptive mitigation and all this. That, it's just, it's just very, very different. Um, and so yeah. Yeah, it's, uh, yeah, so we've got our own email service . I don't know what more to say about it.
Aaron Francis
So, I, first of all, I envy you-
Jesse Hanley
You can ask me questions about it
Aaron Francis
... 0%. No part of me envies what you do. Second of all, um, besides economics, has it been better for any other reason? Better deliverability, better control, fewer issues, or is it just, like, redundancy and economics?
Jesse Hanley
Uh, it's redundancy and economics, which i- honestly, frankly, like, two very big parts.
Aaron Francis
Those are big parts.
Jesse Hanley
Um, like, the, it's, it's a peace of mind thing, right, which we'll probably go into when we talk about Postgres. It's like, everything that I'm trying to do is for peace of mind. Um, and so yeah. I, I like that aspect of it. Um, just feels nice to have my own stuff. I don't know.
Aaron Francis
Mm-hmm.
Jesse Hanley
It's just cool to have, like, my own sending service, you know, that I control-
Aaron Francis
Mm-hmm
Jesse Hanley
... and I own. That's all on Hetzner, you know, which is the, the current trend. Um-
Aaron Francis
That's what everybody's talking about, yeah.
Jesse Hanley
And they're great, and it's, like, quite empowering having my own box on Hetzner that sends emails-
Aaron Francis
Mm-hmm
Jesse Hanley
... and, um, all that kind of stuff. And Hetzner, honestly, have been a pretty good provider. They opened up the ports, which is something that you need to do, um-
Aaron Francis
Mm
Jesse Hanley
... to allow us to actually, like, send out. And, like, they're pretty good when they deal with, um, like, uh, they get abuse requests and stuff. Like, at one point, a whole bunch of, like, Brazilian ISPs were spamming them with abuse things that they've, like, just, I don't know, just weird stuff, right? But Hetzner was pretty good at actually, like, talking through support not to shut down our box and all that. So they're, they're a great provider.
I, I, I really, I like them. I like them a lot, actually. Um, but yeah, it's quite empowering once you get that box up and you're sending zero cost emails. You're like-
Aaron Francis
Hmm
Jesse Hanley
... "Whoa, that's different," you know?
Aaron Francis
Yeah. Got a little, a little taste of free emails. I'm sure that was exciting. This is very-
Jesse Hanley
It is
Aaron Francis
... I, I mean, this is very on brand for the current Rails trend. It's more fun to be-
Jesse Hanley
It is
Aaron Francis
... competent, host your own stuff, and use Hetzner. That's like, that's big Rails right now. So you're right in line.
Jesse Hanley
The big stack, yeah.
Aaron Francis
Yeah, exactly. Okay.
Jesse Hanley
Yeah.
Aaron Francis
So that stuff is living over on Hetzner. Wild decision-
Jesse Hanley
Yeah
Aaron Francis
... to roll your own mail servers, but mad respect.
Jesse Hanley
Mm-hmm. Thank you.
Aaron Francis
Um, talk to me about, uh, Heroku.
Jesse Hanley
Mm-hmm. Yeah. So on, on Heroku we have a, like, monolith app, which is, like, a Rails app. Um, we're on, we're working towards Rail 7 point something.
Aaron Francis
Okay.
Jesse Hanley
Um, and that is primarily a big Postgres instance, just, like, a single node instance.
Aaron Francis
Mm-hmm.
Jesse Hanley
Uh, then we have multiple elastic instances supporting that, and I'll go into, like, the reasons why we have-
Aaron Francis
Okay
Jesse Hanley
... lots and lots of elastic instances. Um-
Aaron Francis
Okay
Jesse Hanley
... and then I have, like, three Redis instances on there for a whole bunch of different things, just separating concerns, background jobs-
Aaron Francis
Mm-hmm
Jesse Hanley
... uh, caching layer, and et cetera. So yeah, WebSockets, all that kind of stuff. And Bento Chat is very, very similar to, like, that stack as well.
Aaron Francis
And, but it's its own stack. It's got its own database-
Jesse Hanley
Mm-hmm
Aaron Francis
... and then Redis-
Jesse Hanley
Own separate
Aaron Francis
... and everything.
Jesse Hanley
Yep.
Aaron Francis
Okay.
Jesse Hanley
Yep, yep, yep, yep. Yeah.
Aaron Francis
Okay, cool. Um, I assume you've been on Heroku since the very beginning, and then just have continued-
Jesse Hanley
Mm-hmm
Aaron Francis
... to turn the dials as you've grown. Is that right?
Jesse Hanley
Yeah. Yeah. Yep. And I've liked them for a few reasons, like, a kind of meta reason that I've liked it is with Heroku, once you start spending a lot of money, and you will spend a lot of money, and you're gonna-
Aaron Francis
Yeah.
Jesse Hanley
Like, um, w- y- you can sign enterprise contracts. Now, why that's-
Aaron Francis
Okay
Jesse Hanley
... beneficial to me is if there is an issue, let's say someone's account gets hacked, or let's say-
Aaron Francis
Mm
Jesse Hanley
... someone does, uh, let's say our spam API doesn't catch something, and we start sending out a whole bunch of emails that shouldn't be sent out. That, that is a risk, right?
Aaron Francis
Yeah.
Jesse Hanley
And I spend so much time on this, it's not funny, to make sure that this doesn't happen. But on the case that it does, and a ticket gets raised f- to Heroku, if I am on their general population, they will shut me down most likely.
Aaron Francis
Oof.
Jesse Hanley
Right? Until I respond to a ticket. They'll just-
Aaron Francis
Right
Jesse Hanley
... they'll shut traffic off or they'll, they'll do something. 'Cause I've got the is enterprise flag-
Aaron Francis
Mm, mm
Jesse Hanley
... that is much less likely to happen. And so what I, what the advice that I've gotten s- speaking to a lot of insiders there, and actually just in general across any part of my stack is, like, you wanna get to enterprise as quickly as possible, just so you have that-
Aaron Francis
Interesting
Jesse Hanley
... is enterprise flag. Um, yeah. Sa- same with, like, Cloudflare. Once, um, I had, like, a URL redirect abuse thing going on. Someone, someone-
Aaron Francis
Oh
Jesse Hanley
... managed to find, find that they could, uh, shove us in between their redirect chain and-
Aaron Francis
Yep
Jesse Hanley
... use us. That got to Cloudflare, and Cloudflare was great about it. They like, it was a ticket. They're like, "Sort this out," and I did, and it was all good. But I, I, I'm on an expensive plan there, so I think they were less likely to shut my traffic down straight away, so.
Aaron Francis
Mm-hmm.
Jesse Hanley
That, that, that, that's why I've stayed predominantly with Heroku for the last, um, yeah, since the beginning.
Aaron Francis
Do you also get, and if you're not allowed to talk about it, that's fine. Do you also get cost savings? Like, do you pay a bunch up front to reserve some stuff, or you're laughing.
Jesse Hanley
Yeah.
Aaron Francis
I don't know if that's good or bad.
Jesse Hanley
Yeah. They, they changed the, they changed, like, the pricing dynamics a little bit. Um-
Aaron Francis
Mm
Jesse Hanley
... and you now get to talk to a sales rep, which you can discuss things with, and you can potentially get discounts.
Aaron Francis
Oh, that's exciting.
Jesse Hanley
Um, I don't mind that. I don't mind, I don't mind the negotiation thing. Um, what I don't like is, uh, did you see that tweet that I posted about, it was like, uh, um, you can put, like, a Redis production instance on a little USB drive, whatever. It was, it was that thing.
Aaron Francis
Mm-hmm.
Jesse Hanley
And then the, I posted that, and then I was like, "I wonder if Heroku have, like, changed their pricing at all in a decade." And I went to Web Archive. It's the same. Their Redis instances-
Aaron Francis
Wow
Jesse Hanley
... are the same in a decade. In a decade. So in 2015, like, one of their instances, 200 bucks a month, right? One gig of, um, uh, RAM. It's the same today, um, which is crazy to me. And on their Postgres instances, a decade, I think, like, all instances are maybe, like, beefed up 50% or something, a little bit more IOPS.
Aaron Francis
Mm-hmm.
Jesse Hanley
But they haven't updated their pricing sheet in 10 years, uh, which I'll-
Aaron Francis
Incredible
Jesse Hanley
... I'll, I'll tell you how that makes me feel a little bit later. But, um- Yeah, it's-- it was quite eye-opening. I, I did that last week, and I, I kept p- like writing a tweet and then deleting it. I was like so upset, and I was like, "Ah, I'm, I'm just gonna-- I'm just gonna like let this one slide, and I'll think about it-
Aaron Francis
Yeah
Jesse Hanley
... for a little bit." But yeah, 10 years. 10 years of-
Aaron Francis
Well, keep thinking about it-
Jesse Hanley
... of Heroku database
Aaron Francis
... 'cause that's a good tweet, yeah. You know, maybe take a little bit of the edge off, a little bit of the- ... the frustration, but that's a good tweet. You gotta tweet that.
Jesse Hanley
Yeah.
Aaron Francis
That's good.
Jesse Hanley
Yeah. I was-
Aaron Francis
Um, okay
Jesse Hanley
... I was pretty mind-blown.
Aaron Francis
You are-
Jesse Hanley
But they've been great, they've been great provide- I just wanna say something. They've been great, great pro- uh, vendors, and their, their uptime and reliability since booting off all their free users is very good. So I think after-
Aaron Francis
Oh, you actually saw, you saw a difference there?
Jesse Hanley
Yeah, yeah. Uh, since, um, I think it's Bob Wiers, since Bob Wiers took over, um, I think from like the infrastructure and like reliability perspective, Heroku has been like phenomenal and great. From the pricing and, uh, product side, very slow. But I think that's like the Benioff-
Aaron Francis
Yeah
Jesse Hanley
... grasp on that, on that horse and carriage.
Aaron Francis
They're inside the Borg now. Yeah, that makes sense.
Jesse Hanley
In the box.
Aaron Francis
Um, okay, so you're over on Heroku. You must be storing unbelievable amounts of data because anytime someone clicks on anything in any email that I ever send, you, you write it down. You're very diligent. You write it down, you put it in the database. And I-
Jesse Hanley
Yeah
Aaron Francis
... I'm a little guy, so I imagine you've got people sending out hundreds of thousands of emails a month, and every single click is coming through you, to say nothing of all like the actual emails that you're sending. So what, what in the world-- how are you storing all of this stuff in one massive database?
Jesse Hanley
Um, most of them are just in like basic, basic tables, an events table. We've got like an emails table. Um, so very, very simple kind of setups. All the main pieces of data are stored in there. We've got like some JSONB columns-
Aaron Francis
Mm-hmm
Jesse Hanley
... um, to store kind of the more blobs, which then gets pushed to Toast, I would assume for the most part.
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, which hasn't, uh, to date hasn't really been like-- I've seen-- I've read a lot of articles about like issues storing a lot of stuff to Toast, but we don't query a lot of that, which is where Elastic-
Aaron Francis
Mm-hmm
Jesse Hanley
... kinda comes in. Um, so I haven't-
Aaron Francis
Oh, yeah.
Jesse Hanley
W-we use, we use Postgres kind of like as our, our primary data store more so than anything else.
Aaron Francis
Mm-hmm.
Jesse Hanley
But not as our query store. Um, and so yeah.
Aaron Francis
Interesting.
Jesse Hanley
And some columns as well, like our emails one, they're very, very tiny. Like it's, it's, it's not that much data because I store the HTML in S3. Um, and so I don't actually-
Aaron Francis
Got it
Jesse Hanley
... store that, right? So I, I send the email, store in S3, and then it's kinda like done, right? So there's not really, um, too much storage issues there. Um, so yeah. Th-that's-- they, they, they're very, they're very lean rows. They're, they're, they're not too complex. Um, so it's, it's hasn't really been too much of an issue.
Aaron Francis
So this-- yeah, so this is interesting. So you're storing potentially billions of, of rows in here, but you said you're piping a lot of it out to Elastic to do-
Jesse Hanley
Yes
Aaron Francis
... the actual querying. So walk me-
Jesse Hanley
Yeah
Aaron Francis
... through that, because that seems very clever.
Jesse Hanley
So the way that I've kind of thought about Bento is 'cause I've, I've-- there's a couple things that I've always wanted be true of Bento. I've always wanted it to be lightning fast-
Aaron Francis
Mm-hmm
Jesse Hanley
... and I've always wanted it to be calm for me personally to run. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and so a lot of the way that I've like architectured Bento is I'm doing a lot of like just select ID queries. So I'm like selecting the exact records.
Aaron Francis
Okay.
Jesse Hanley
I'm doing an association. There's indexes on that. User.emails, user.events, right?
Aaron Francis
Right.
Jesse Hanley
So that's al- that's always very, very lightning fast. When I'm doing more broader stuff, like a query over the whole tenant, so over the site, so Aaron Francis, I wanna find Aaron, all of your users.
Aaron Francis
Mm-hmm.
Jesse Hanley
Querying that in Postgres, which like I'm sure is, is quite possible, um, it's hard to get right at all scales just because-
Aaron Francis
Yeah
Jesse Hanley
... like people have so many different types of, uh, pieces of data. They've got different custom fields, they've got... Just it's, it's very hard to understand and map to everyone's world and create indexes for everything.
Aaron Francis
Yeah.
Jesse Hanley
So it's-
Aaron Francis
So give me, I'll, I'll give you an example 'cause like when I send out an email to, uh... When I send out, I sent out an email maybe yesterday or the day before, and I sent it to everyone that was on my list, so that's already narrowing it down from many, you know, hundreds of thou- millions of subscribers to my little, you know, my little adorable list. But my list where people have this tag, list:sqlite, they don't have opt-out:sqlite, and we didn't wanna spam people or rather send too many emails, so we also
left out list:postgres. So it's my users with these two tags, but not with this tag, and that's a hard, like, that's a hard query, that's a hard query to optimize. So how are you like-- how are you thinking about that?
Jesse Hanley
So that's a hard query to optimize for for Postgres, but that's not a hard-
Aaron Francis
Right
Jesse Hanley
... query to optimize for for Elastic. That, that is like, like-
Aaron Francis
Bread and butter
Jesse Hanley
... chips. Yeah. It's, it's bread and butter for Elastic, right? Um, and so the, the, the pipeline is, is like new data comes into our system, the user gets updated, we push that off to Elasticsearch.
Aaron Francis
Mm-hmm.
Jesse Hanley
It gets indexed, and then it's, it's instantly queryable more or less, right? Um, and the reason I wanted to do that is 'cause I just didn't wanna run migrations. Or like let's say I had like, um, a new user request. A user goes, "Hey, I wanna just find engaged, uh, people who engaged with my last broadcast."
Aaron Francis
Mm-hmm.
Jesse Hanley
Like that, that's something that someone want. If I wanted to like-- I w- would potentially have to write like a, an extra query for it in Postgres. It may not be optimized. I'd have to write some more indexes.
Aaron Francis
Right.
Jesse Hanley
And that's not-- to me, to me, that's not running a calm like company like or a dev cycle for me. So I, I kinda... Elastic is very good just throwing whatever you want at it. It indexes it instantly. I just have to reindex all my users, and then now that's there to be, uh, you know, uh, queried whenever. Um, and so I've just liked that pattern personally.
And it also takes so much load off the database. So-
Aaron Francis
Yeah
Jesse Hanley
... like our database runs very, very calmly. It's never querying too many users, uh, and it's just a calm way to run it for me. Um, the, the downside is it's expensive to run a lot of, uh, Elastic nodes. Um, which you solve by just charging properly, um-
Aaron Francis
Right
Jesse Hanley
... and being a- being able to pay for them. That's, like how I kinda see it. So with more money allows me to buy more hardware and, um, hopefully push some more responsibility onto that hardware. And I, I love that Postgres Elastic kind of pairing. Um, it just-
Aaron Francis
Mm-hmm
Jesse Hanley
... kind of, it works very well for, for how I, I run Bento at least.
Aaron Francis
So all these, all these Elastic nodes, did you say three? You have three of them?
Jesse Hanley
Four.
Aaron Francis
Four. Okay. So these four Elastic nodes, are they, um, like are they serving different parts of the app? Are they all, um-
Jesse Hanley
Mm-hmm.
Aaron Francis
So they're serving different functional roles in the application, and you're pushing-
Jesse Hanley
Yeah
Aaron Francis
... different sets of data-
Jesse Hanley
So there's like, uh-
Aaron Francis
... to each one?
Jesse Hanley
Yeah. So let's say there's like an Elastic users, um, uh, cluster, and then that has all the indexes for all my users, and all-
Aaron Francis
Mm-hmm
Jesse Hanley
... of them have different mappings and all that kind of stuff. Um, and so that one's lightning fast. I've got like an email one, which I'm currently like restructuring and rebuilding now. Um, I've got like an events one, et cetera, et cetera. So like that's kinda like how I, I split 'em out. I, I, I have, you know, each cluster has its own responsibility, and I, I host that-
Aaron Francis
Mm
Jesse Hanley
... on, um, Elastic, Elastic's managed, um, cloud. And-
Aaron Francis
Okay
Jesse Hanley
... and, and they're, they're great. They're great. It's a little bit expensive, but like I think I, I mentioned, uh, on, on Twitter last week, it's like a node went down, an Elastic engineer's paged, he's on it, all fixed. I, I go off to get my kid. You know, very, very s- very nice kinda like setup there, and-
Aaron Francis
Yeah
Jesse Hanley
... their support tickets are so fast, and, and that's, that's quite nice.
Aaron Francis
And have you done the enterprise thing over there too so that somebody, somebody's keeping an eye on all your stuff all the time?
Jesse Hanley
Not, not, not, not so much. It seems like, you know, there's like some platinum support package that I have, and it seems-
Aaron Francis
Mm
Jesse Hanley
... like I, I get that with that, so more or less.
Aaron Francis
Nice.
Jesse Hanley
Yeah. Um-
Aaron Francis
Okay
Jesse Hanley
... but yeah, ba- back to like the, the Postgres stuff, it's just very s- lots of selects. Lots, lots of single selects, very lean insert, and then I'm just directly selecting most of the time.
Aaron Francis
Okay. Yeah. I've, I've wondered, um, 'cause you and I talked a long time ago about, uh, storing JSON in, you know, relational database, and like how to, how to query it in any which way that you want, and the answer is just like, "It's hard, man." Like, especially when you get to, you know, s- the scale that you're at. It's just, it's just hard.
Like it's doable, um, but at some point it starts to fall over, and so that's where Elastic really shines for you. And so how do you get it out of, how do you get it out of Postgres and into Elastic? Like what's the actual tool or mechanism that you're using there?
Jesse Hanley
Yeah. So we use a gem called, um, searchkick, which I've kind of like hard forked.
Aaron Francis
Mm.
Jesse Hanley
It's like a, a, a Rails gem. Um, uh, Andrew Kane built it. He's like a, a wizard. I love like all of his-
Aaron Francis
Mm-hmm
Jesse Hanley
... gems. And, um, yeah, that handles most of the indexing. I forked it and modified it so it handles multi-tenant. So I can put tenants-
Aaron Francis
Cool
Jesse Hanley
... in their own bu- bucketed clus- like bucketed indexes essentially. So 100 customers here, 100 customers there, et cetera. Um, and gives me a lot more kinda control over that. Um, which was like a very big learning for me on like the Elastic side. Um, but again, the whole, the whole pipeline is like user gets updated or an event comes in, push that to Sidekiq, which is a background job queue.
Aaron Francis
Mm.
Jesse Hanley
Sidekiq then indexes it, and it's good to go. It's good to query from there. Um, yeah. And then on the reverse-
Aaron Francis
Interesting
Jesse Hanley
... it's like I, I build a segment, I grab the IDs, I grab all those IDs, and then I start emailing them and send them off to Sidekiq to send all those emails, uh, on the reverse side.
Aaron Francis
Okay. So when you come in-- when you're coming out of Elastic, what you're pulling out of Elastic is primary keys, and then you're going back to Postgres, and Postgres is like, "Yeah, dude, I can handle that." And then you just pull all those-
Jesse Hanley
I can do that. I'm great at this. Yeah. So, so Postgres goes, "I know what to do, baby. Give me those IDs."
Aaron Francis
Yeah.
Jesse Hanley
It grabs those IDs-
Aaron Francis
I need one. I could do-
Jesse Hanley
And then just goes, sends those emails out, right? Um-
Aaron Francis
Uh-huh.
Jesse Hanley
But, but, but that, that's reduced so much anxiety for me, right? So, so-
Aaron Francis
Yeah
Jesse Hanley
... and, and I, I love Postgres for that. It's great at looking up IDs, and I'm sure I could obviously use like anything. I could probably use SQLite if I wanted to, but, um-
Aaron Francis
If you're just looking up IDs, my friend, I think you probably could.
Jesse Hanley
Yeah, yeah, yeah. In like other areas of the app, I'm sure there's like slightly more complex, um-
Aaron Francis
Sure
Jesse Hanley
... joins and stuff, but for the bulk of our querying, no, it's very, very light. It's, you know, lots of, lots of, uh, yeah, lots of lookups, but very, very, very simple lookups. And I just love that pattern of push stuff to Elastic, grab it from Elastic-
Aaron Francis
Mm-hmm
Jesse Hanley
... do stuff with it. It's just very, very clean. Um, and I love the flexibility that when a user throws something at me in Discord and says, "Hey, I need this new query," and I go, "That's actually not a bad idea."
Aaron Francis
Mm-hmm.
Jesse Hanley
I quickly add, uh, it to like the indexing, so I can just say, "Hey, in the index, add this to the mapping," and then I just re-index all that user's data, and then now they can query it freely, and I don't have to worry about like a, a, a big, uh, migration or any of that kind of stuff. So that, that works perfectly for me.
Aaron Francis
Yeah, those, those, those big migrations are not, uh, congruent with a calm business. They're just, they're just not. Um-
Jesse Hanley
No
Aaron Francis
... when you're gonna migrate over, you know, billions and billions of rows in a relational database, that's kinda terrifying no matter how much tooling you have set up around it.
Jesse Hanley
Yeah. Yeah. The, the, the down- the downside like w- with this approach, which has been kinda nice because Postgres is now like, like its main responsibility is just to hold the data and store the data and do lookups on the data. I'm not like giving it too many fancy responsibilities.
Aaron Francis
Mm-hmm.
Jesse Hanley
It means now like I've begun the process of going, "Okay. Well, we're obviously gonna continue sel- you know, getting more data, and, uh-
Aaron Francis
Yeah
Jesse Hanley
... eventually I am going to cap out at my Heroku plan limit." Right? And so before that happens, I need to work out, all right, well, like, what's the plan? What's the strategy here? And then that's now where I'm kind of in this process of investigating, all right. And I've been investigating for a while, but now I'm starting to get a, a little bit more serious 'cause I have a Heroku-
Aaron Francis
Yeah
Jesse Hanley
... Heroku renewal coming up. And so-
Aaron Francis
Yeah
Jesse Hanley
... um, I'm exploring a lot more options a little bit more intimately about, all right, how do I split this database? Like I have with Elastic, right?
Aaron Francis
Yep.
Jesse Hanley
With Elastic, I've got my users, my events, my emails. I want my Postgres to be the same. I want everything, email responsibility here, event responsibility here, et cetera, et cetera, just to remove some more anxiety and more stress from my life. Um-
Aaron Francis
Mm
Jesse Hanley
... and so that's currently my, like, big project at the moment.
Aaron Francis
So tell us, uh, so we get a sense of scale. You said you're gonna top out of Heroku. What is the top tier of Heroku Postgres, and how much ti- how much headroom do you think you have until it's, like, game over, man?
Jesse Hanley
Uh, sometimes next year. Uh, probably-
Aaron Francis
Damn. That's-
Jesse Hanley
... probably, like, mid... Yeah. Probably, like, mid next year.
Aaron Francis
That's not very far.
Jesse Hanley
No, it's fine. I, I... It's fine. It's fine.
Aaron Francis
No, that's plenty-
Jesse Hanley
I can-
Aaron Francis
... it's plenty of time, but it's, it's not s- it's not terrible.
Jesse Hanley
Her- Heroku caps, Heroku caps out, but competitors don't cap out at, at that. So that, that's a-
Aaron Francis
True
Jesse Hanley
... as a, as an aside.
Aaron Francis
True.
Jesse Hanley
Um, and it looks like Heroku's actually added a couple more plans. I think, um, the standard plan, $12,000 a month.
Aaron Francis
Ugh.
Jesse Hanley
Um, what are they doing over there? Um, and it looks like the pricing table-
Aaron Francis
Is that plan, is that called the Jesse plan?
Jesse Hanley
That's, that's, that's eight, eight terabytes. So, so that, that's-
Aaron Francis
Eight terabytes
Jesse Hanley
... that's, that's... Yeah, yeah, yeah. So, you know, um, yeah. So that, that's-
Aaron Francis
Okay. So-
Jesse Hanley
... that's their maximum. But, but regardless, I, I, I wanna, I wanna split out from that. Um, and the, the solutions that I'm, I'm looking at is either I go to Crunchy. Crunchy is great because I can potentially have these multiple databases, and they allow-
Aaron Francis
Mm-hmm
Jesse Hanley
... me to scale, as it should be, RAM and storage. And because I'm not-
Aaron Francis
Hmm
Jesse Hanley
... doing such expensive querying, that works so much better for me. Whereas Heroku, they're like, "No-
Aaron Francis
Oh, yeah
Jesse Hanley
... you need the big boy everything," right? Um-
Aaron Francis
Right
Jesse Hanley
... and I don't need the big boy everything. Um, and so Crunchy l- gives me that flexibility. The other option is I've also got Citus, which is the Postgres extension. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and I, I've looked at going to MySQL and stuff. I'm not t- totally keen on that after, like, a little bit more research. I, I wanna stay in the Postgres, uh, world. Um, and-
Aaron Francis
Y- really? You looked, you looked at moving to different-
Jesse Hanley
Spent a lot of time
Aaron Francis
... really? Tell me why did, why did you... That even cross your mind? Because you wanted-
Jesse Hanley
Um-
Aaron Francis
... to use something like Vitess?
Jesse Hanley
Yeah. So I, I looked at Vitess a little bit, um, and, like, ev- everything kind of looks nice. I think now it supports foreign key constraints, I think. Um-
Aaron Francis
It does, yeah
Jesse Hanley
... last time. It do- it does now. At the time of doing the main provider's dinner, so I, I wasn't-
Aaron Francis
Mm
Jesse Hanley
... totally interested in, like, dropping all my F keys.
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, but also I'm not, like, totally sure I really need to... I, I just don't wanna learn MySQL, and, like, I've-
Aaron Francis
Yeah. I, I don't blame you
Jesse Hanley
... developed such, like, an affinity... Yeah, I've devel- developed such an affinity for Postgres, and I don't like seeing... The, the vibes are important to me. This is gonna be, like, a weird tangent, but the vibes are important to me. And when I look at MySQL, I see things like people complaining about performance issues on, like, social and everywhere-
Aaron Francis
Yeah
Jesse Hanley
... and, like, you know-
Aaron Francis
Yeah. Yeah
Jesse Hanley
... more upgrades come out, and there's more degradation-
Aaron Francis
It gets worse
Jesse Hanley
... in. It gets worse, and it's kinda like, I don't know. Uh, the... Whereas Postgres, it's like everything's faster . Everything gets really-
Aaron Francis
Everything's getting better
Jesse Hanley
... everything's faster, and the numbers are so much bigger. And I'm like, "I love big numbers. Give me those big numbers."
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, and I also find that, um, a lot of the contractors and people that I speak to in the Postgres world are a lot more approachable to me. Um, and there's a lot of Rails Postgres people, uh, that I've been able to talk to, and they've been fantastic and helpful. That... And, and that's my general approach. If I run into a problem, I try and find experts to talk to.
Aaron Francis
Right.
Jesse Hanley
And if I find a lot of experts that are very approachable, I'm obviously gonna be a little bit more pulled into, like, that direction, you know? So-
Aaron Francis
Yeah
Jesse Hanley
... um, yeah.
Aaron Francis
Yeah. Y'all's, y'all's ecosystem, uh, the Rails ecosystem is very heavily Postgres. And you make an interesting point about the, like, the experts being approachable. I could name 10 or 15 Postgres experts on Twitter that I could DM right now, but there are very few MySQL experts that I am aware of.
Um, many of them work at, at a company I used to work at, but there are a few that are independent. But it does seem like, it does seem like there are a lot of Postgres people out there, uh, willing and able to help pretty quickly.
Jesse Hanley
Yeah. Even, like, the Crunchy Data team, like, I've messaged Craig a bazillion times. I've jumped on calls-
Aaron Francis
Mm-hmm
Jesse Hanley
... with them and stuff, and they're very, very... They just help you. And I think they're a little bit more long-term. So yeah, I don't know. The, the energy feels a little bit better in, in the Postgres space, so I'd rather stay there. The Citus stuff is really interesting to me. Um, have you done much research, uh, into Citus and played, played with it a bit?
Aaron Francis
I've done, I've done a little bit, but ex- yeah, explain. And I actually had Craig on the last one, and we talked a little bit about Citus, but explain for the, the listener what Citus is and maybe what it compares to.
Jesse Hanley
Yeah, sure. So it allows you... It's a Postgres extension. It allows you to basically have a whole bunch of Postgres nodes that all work together, and then you can have what's called, I'm pretty sure it's called a distributed table, uh, if I recall correctly. And then that allows you to give it a shard key. So let's say for me, it's like a tenant ID or a site ID.
Aaron Francis
Mm-hmm.
Jesse Hanley
Uh, and then your data kinda gets spread across them. Um, and then you can auto-balance and all that kind of stuff. You can spin up new nodes, and it just allows you to scale a little bit more easier. And it means if a node goes down, then you can bring that one back up. It's not, like, the end of the world. So it, it allows you to have distributed tables, which Vitess and all that, uh, allow as well.
Aaron Francis
Mm-hmm.
Jesse Hanley
But it remains a Postgres extension, and, um, you can get a cloud solution with Microsoft, uh, with the Azure stuff. Yeah.
Aaron Francis
Oh, really? Oh, with Azure. Interesting.
Jesse Hanley
It's super affordable. Yeah, with Azure. They call it ... some horrific name. It's, uh-
Aaron Francis
Something, yeah
Jesse Hanley
... what is it?
Aaron Francis
Totally esoteric.
Jesse Hanley
Azure Citus, they call it HyperCloud or something like that. Um-
Aaron Francis
HyperCloud.
Jesse Hanley
Yeah. I don't know. It's, it's something... Hyperscale. Hyperscale, that's it. Hyperscale Citus is now Azure Cosmos DB for Postgres.
Aaron Francis
Oh, so it was, it was Hyperscale, and now it's Azure Cosmos, of course.
Jesse Hanley
Yeah.
Aaron Francis
No, that's perfect.
Jesse Hanley
Yeah. Yeah.
Aaron Francis
That's perfect. Yeah. Good a- good idea.
Jesse Hanley
Um, but-
Aaron Francis
Good name, good name
Jesse Hanley
... but, but then the, the, the issue with having a large single node is, uh, you know, even if... Depending on, like, your backup strategy, so our back... We use continuous protection with Heroku, which is just snapshots regularly, and then you've got the WAL. And so bring that node back up, it restores a snapshot, replays the WAL, you're back, and then it runs. Um, it's a lot easier to get multiple nodes up, uh, simultaneously than a single node.
And so-
Aaron Francis
Mm-hmm
Jesse Hanley
... a lot of the Citus benefits is just be- being able to, you know, if, if you go down, raise them back up really, really fast. Um, I kinda, I like, I like, I like that structure a little bit more than having a, a single node. But at least at this scale, I may consider, uh, as a first step just having multiple single, like, single nodes, have their own responsibility, um, and then kind of go from there.
Aaron Francis
So you're considering-
Jesse Hanley
See how it goes later.
Aaron Francis
Yeah. If I'm hearing this correctly, you're considering potentially two different, um, sharding strategies. One would be-
Jesse Hanley
Yep
Aaron Francis
... more traditional where you're sharding on a tenant ID, and so some n number of tenants go per, you know, Postgres, and then, you know, you send your queries to the right tenant based on their tenant ID. The other one would be you're sharding based on, like, not a email domain, but, like, domain in terms of, like, the application term. So, like, emails go here, events go here, users go there.
And so talk me through this, like, this thought process and where you're currently at.
Jesse Hanley
Where, where I'm currently at is I, I like the single node approach because o- once I actually break down my DB, the total DB sizes actually aren't too big. Um, and-
Aaron Francis
Mm-hmm
Jesse Hanley
... some, some of the issue that I have actually with Postgres is there's, there's quite a lot of bloat in there, um, I think from just updating records, right? 'Cause whenever I send-
Aaron Francis
Mm-hmm
Jesse Hanley
... out an email, all those users are getting updated. Anytime an event happens, that user is also getting updated. So-
Aaron Francis
Mm-hmm
Jesse Hanley
... um, I could probably, like, tune vacuum a little bit, but it's never gonna reclaim space until I do a vacuum full, and frankly, I'm not gonna do a vacuum full because that's gonna lock the table.
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, and so a part of this process, I actually just wanna, like, move to another DB so then I could potentially vacuum those ones independently.
Aaron Francis
On the way out. Yeah.
Jesse Hanley
Or, or rebuild... Yeah, on the way out or rebuild them or an approach that I've considered, uh, and I actually got this idea from, uh, when I was exploring, like, the Vitess stuff-
Aaron Francis
Mm-hmm
Jesse Hanley
... um, is potentially using Rails just to double sync. So just write... So, uh, send, and then have, like, a background job just push that to the other separate DB, and then I can run a background job just to fully sync all the backlog over a time period that I'm very comfortable with.
Aaron Francis
Hmm.
Jesse Hanley
Um, and then that other DB is then, you know, it's getting those, uh, inserts fresh. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and so it'll potentially be less bloated and all that kind of stuff. So I've got a couple approaches. Another approach I've got is, like, uh, potentially streaming in an exact replica from, uh, one DB to another DB, uh, and then just changing reads and writes.
Aaron Francis
Mm-hmm.
Jesse Hanley
So let's say I'm, I'm going from, like, a, let's say the emails table. I've got, um... It's all going to the main DB. I can get up a replica, switch that to be able to write to, and then just in Rails, just toggle it over to start writing-
Aaron Francis
Mm-hmm
Jesse Hanley
... to the new one, right? So th- that's also an approach. There's, yeah, there's a, there's a few ways I can do it. They're, they're not... Yeah. They... I'm just trying to pick which one I vibe with the most and is least stressful.
Aaron Francis
And which one do you vibe with the most? Like, right now, which one are you feeling?
Jesse Hanley
I vibe with, um, I actually vibe with having multiple single nodes on Crunchy.
Aaron Francis
Okay.
Jesse Hanley
Um, because I, I like the idea of, on the Rail side, just being able to switch over my reads and writes and coordinate-
Aaron Francis
Mm-hmm
Jesse Hanley
... with the Crunchy team just to get that, um, one straight on, and I can enter a maintenance period-
Aaron Francis
Mm-hmm
Jesse Hanley
... on our app, queue up all those background jobs, switch over the writes, reboot all the instances, and then I'm kind of good to go. And then on that new instance, drop all the other tables 'cause I, I, I don't, I don't need them anymore, right? And then-
Aaron Francis
Oh, I see
Jesse Hanley
... I'm back up and running.
Aaron Francis
Yeah.
Jesse Hanley
You know what I mean? So I, I can have a full replica of both the instances, so I'm running kind of like two core.
Aaron Francis
Mm-hmm.
Jesse Hanley
Switch it only for a couple of tables, drop everything else, and then I'm... I've got, like, a nice clean table or a nice clean-
Aaron Francis
Hmm
Jesse Hanley
... database with just what I need. Uh, that's, like, the least stressful route, I think. Um, yeah. Why are you looking at me like that?
Aaron Francis
I didn't know, I didn't know if you were gonna keep vibing. You, you looked... You stared off into space. You said, "I think that's the least stressful route," and then you said- ... "Yeah." So I didn't know if, if you were second guessing your, uh, your decision there.
Jesse Hanley
No, because c- 'cause, 'cause a lot, a lot of it's you gotta kind... You just gotta explore this stuff, right? Um, and you got, you gotta do it a few times and, and, uh, you know, mess up a few times. 'Cause this has been my experience with trying to get Elastic to work, actually. Like-
Aaron Francis
Mm-hmm
Jesse Hanley
... just any, any database, you just gotta try a whole bunch of stuff, um, see which ends up being the most seamless, and then when you find something that is pretty seamless, then, um, yeah, yeah, then roll it out and commit to it. But I, I try not to, like, give myself any, like, really hardcore deadlines and just take things-
Aaron Francis
Mm-hmm
Jesse Hanley
... nice and slow. Um, but I, I do like-
Aaron Francis
Okay
Jesse Hanley
... having multiple sing- single nodes. Yeah. That, that's what I wanna go with. I'm gonna put that in.
Aaron Francis
Yeah. There. Done. Well, so I... We gotta, we gotta talk about this because you said earlier that, you know, when you were working with Andrew, you were like, "Yeah, I was, you know, I was learning to code kinda on the side." So that was at most six years ago, and now you're- Now you're a one, a one-man show running an ESP with your own mail servers, and you are migrating massive databases.
What-- how are you, like... Talk to me about, like, your, your approach to learning things or, like, how you've gotten to where you are now, because this is a lot of very complicated stuff, and by your own admission, six years ago you were like, "Ah, I'm just trying to learn to code." So how did we get here?
Jesse Hanley
I don't know, man. Um. I don't know, man. There's probably so many, like, easier businesses to run.
Aaron Francis
Yes.
Jesse Hanley
But in saying that-- like, in, in saying that, like... I'm sorry. Let me, let me think about this . Let me think about this. It is, it is, it is complex, but it's also, it's also not, right? Like, at the end of the day, Bento is kind of like a glorified CRUD app.
Aaron Francis
Yeah.
Jesse Hanley
We take in form submissions, we process them, we put them in a database. We have some callbacks that send emails. That's actually not too, too tricky.
Aaron Francis
Okay.
Jesse Hanley
Querying's not too tricky. Um, Elastic is, like, a beautiful-- has a beautiful DSL. Is that what you call it?
Aaron Francis
Mm-hmm.
Jesse Hanley
A beautiful querying language to, um, to, to hit to bring in data. Um, any problem that I've faced, touch wood, I've always been able to overcome, even if it's been horrific and catastrophic. I've always, I've always figured it out eventually. Um, and I think having done enough of those where I, I can figure it out, I have the confidence that I will figure it out.
Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... but I also have a little bit of a, a change in how I used to approach things. So I'm a lot slower in approaching things. I have the budget now to just spin stuff up, um, and so-
Aaron Francis
Mm-hmm
Jesse Hanley
... I'm comfortable just spinning stuff up and trying stuff. Um, and so when I'm working with, like, a lot of data, yeah, there's sometimes no other option than just, like, rebuilding the world, playing with the world a little bit, and, uh, if it doesn't work, just blow it up and try something new, right? And I think that, that, that approach works, works pretty, pretty, pretty, pretty well with me.
Um, but when I'm making all these, like, decisions on where to go, I am very heavily biased of, like, where I can get help. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and so, like, on the-- in terms of my decision for, all right, do I go to Citus or do I go to Crunchy with multiple single nodes? I'm a lot more biased to go to Crunchy because I know that if I run into a scary, hairy problem, I have someone to talk to, and I can jump on a call with them, and I can just, like, riff, and that alleviates so much.
Like, I remember-
Aaron Francis
Mm-hmm
Jesse Hanley
... when I hit, like, one terabyte on Heroku, I was, like, panicked. I was like, "Oh, I got too much data."
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, just 'cause I'd never seen a terabyte database before.
Aaron Francis
Yeah.
Jesse Hanley
Yeah. It's, like, scary. Um-
Aaron Francis
Yeah
Jesse Hanley
... and I'm like, "I don't know what to look out for." Like, what's transaction wraparound? What's, like, all this kind of stuff, right? Uh, and so I jumped on, uh, a guy called Jesse at Heroku, who's now at Crunchy, apparently. Um-
Aaron Francis
Sure
Jesse Hanley
... they've taken everyone. They've gutted that business out.
Aaron Francis
Yeah.
Jesse Hanley
So I, I, I chatted to Jesse, and we went through my instance. He told me everything. We talked through stuff. I learned. Uh, and, like, through that process, I'm now confident in a whole bunch of things, and I'm also not paranoid in a lot of things. I think, like-
Aaron Francis
Mm
Jesse Hanley
... with databases, knowing what not to be scared of is, like-
Aaron Francis
Mm
Jesse Hanley
... one of the largest challenges. Being like, "Hey, I actually don't need to worry about that." Or if I change things, I don't need to worry about that either. Um, and so a lot of my design decisions are going, how do I just not ever worry about this silly thing? And then I'll try-
Aaron Francis
Mm-hmm
Jesse Hanley
... and restructure things so I'm never worrying about that silly thing. Same with, like, whoa, my database is exploding. All right, well, how about I don't store HTML content in the database. Why don't I put that- ... in S3? Like, maybe that's a smart thing to do, right? Um, especially when someone's sending out 100,000 emails. Don't do that. So just, just decisions like that take a lot of the, the weight off.
Um, and I think that's been helpful, being able to run a business, at least of this size and this scale, uh, calmly, if that makes sense. Um.
Aaron Francis
Yeah. It makes a ton of sense. So I'm, I'm hearing a, a few things, um, as it relates to being able to run this what, in my opinion, is a very difficult business to run. Even if it is just CRUD, it still seems very difficult. Uh, one is you've, you've made a lot of decisions optimizing or at least with an eye towards having a calm business/life.
And I think that needs to be stated because a lot of people are like, "Oh, I would love a calm business," and then never make decisions that would make their life calmer or easier. So that seems like number one, uh, at least, like, consider it when you're making a decision. Number two is you now have, um, I think from what you've said, you now have budget, which is margin to, like, try some stuff out.
So you can-
Jesse Hanley
Explore
Aaron Francis
... you know, you can get a whole replica of the world and mess it up and then burn it down, and that's totally okay. And then the thing that you keep talking about, which I think is very important, is, um, your relationships in the industry. Like people-
Jesse Hanley
Yeah. It's huge
Aaron Francis
... that you know, like, and trust that you can reach out to and either just have a call with or explicitly hire to, to help you do stuff. Is there anything else you think-- like, do those feel like the three main things towards... like, that have allowed you to have a calm business at this scale?
Jesse Hanley
Yeah, I think so. One, one-- can I give, like, an example of, like, a product-
Aaron Francis
Please
Jesse Hanley
... decision that, that's helped?
Aaron Francis
Yeah.
Jesse Hanley
So, um, for example, in Bento, there's obviously a lot of data and a lot of pages load a lot of that data. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and sometimes even on, like, a page like the, let's say, the visitor browser, you know, when you go to people and you see all those users-
Aaron Francis
Mm-hmm
Jesse Hanley
... sometimes that page can have a lot of N plus ones, you know-
Aaron Francis
Mm-hmm
Jesse Hanley
... where it got, like, tags loading, fields loading, sales loading. Just a lot, right? Um, and for Postgres, that's not too hard to do, but sometimes that can be slow. Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... and so what I've tried to do is I've tried to remove a lot of the querying out of the web request. So when you load, when you load that page, uh, I actually create a WebSocket connection and a background job in an-
Aaron Francis
Mm
Jesse Hanley
... in a background worker. That builds the world and pumps HTML back into the page. I don't actually ever... That's why Bento is so fast. So when you're, when you're going from page, you probably noticed Bento is very, very fast.
Aaron Francis
It is.
Jesse Hanley
But I'm actually never doing a request other than, like, a tem- you know, site ID, user ID, all that. Like, if I-
Aaron Francis
Uh-huh
Jesse Hanley
... if I, if, if I showed you my querying, every web request is, like, instant because almost none of it's happening in the web request cycle. All of it is happening in background jobs. Most of it is happening in background jobs. Um, and that has allowed N+1s to be-
Aaron Francis
Happening in a background job in response to a request.
Jesse Hanley
Yeah, yeah, yeah. I mean, you can go do it now. If you go to Bento, it'll, it had, like, the spinner.
Aaron Francis
Uh-huh.
Jesse Hanley
That has opened a WebSocket connection, background job gets processed, and then we're pumping HTML back into the view. Um, and that is why everything feels so snappy. Um, because it-
Aaron Francis
So when I, when I come back to Bento after leaving a tab open for a long time, it has this notification that's like, "Websocket thing has been lost," and I'm, you know, this is leaving it open for 24 hours.
Jesse Hanley
That's what that is.
Aaron Francis
I'm like, "What's these, what's it using WebSockets for?" Everything is the answer.
Jesse Hanley
Everything.
Aaron Francis
Everything.
Jesse Hanley
You, you, so, so, and, and, and, and, like, another thing is, like, you know, when you go to Flows, I do think I, I got a Postgres query for this. You know when you go to Flows and every node has stats on it, right?
Aaron Francis
Yes. Yes.
Jesse Hanley
And so I, I obviously have to do a, I obviously have to do a count on that. Now, if I had to do a count on the web request when you loaded that page, it would-
Aaron Francis
Your host
Jesse Hanley
... it would explode
Aaron Francis
... came over.
Jesse Hanley
It-
Aaron Francis
Yeah
Jesse Hanley
... what happens if someone has 2,000 nodes on there, which some people do, right?
Aaron Francis
And users-
Jesse Hanley
It would explode
Aaron Francis
... users will be doing stuff, so you know that somebody has 2,000 nodes.
Jesse Hanley
And that's the, that's the thing. So users will always be doing stuff. And they'll always be breaking things in, like, the weirdest ways.
Aaron Francis
Uh-huh.
Jesse Hanley
And so with that one what I did... Like, let's say, now talking about Flows.
Aaron Francis
Yeah.
Jesse Hanley
With Flows, I have it so we'll, uh, I'm using, like, a React observer, um, uh, library.
Aaron Francis
Okay.
Jesse Hanley
And when the, when the node comes into view, I create a WebSocket connection.
Aaron Francis
There you go.
Jesse Hanley
That then joins a background queue. That does the SQL count, and then it streams it in. Um, and so a lot of the, the product design decisions have actually been arou- around me being mindful that, okay, I wanna be, like, a little bit more generous on my Postgres instance, and I wanna allow-
Aaron Francis
Mm
Jesse Hanley
... it to have time even if a query is not optimized. And so I take that out of the web request, put that in a background job, and then that allows things to be perceived, be lightning fast even if they take a couple of seconds to compute. Because if you click a button and it takes two seconds, that sucks, and that happens in every other email marketing provider-
Aaron Francis
Totally. Totally
Jesse Hanley
... that I've ever personally used.
Aaron Francis
Yeah.
Jesse Hanley
Because they're doing it in the web request. And so it just gives you a lot more grace.
Aaron Francis
Who can blame them? Everyone does that, Jesse. Everyone but you has... Nobody's figured this out. So what do you send me-
Jesse Hanley
Yeah
Aaron Francis
... when I click a button? What do you send me? Just a shell? Just, like, an HTML shell that you then populate?
Jesse Hanley
Depends on the page. So, like-
Aaron Francis
Okay
Jesse Hanley
... um, it depen- it depends on the page. So, like, uh, let's say the tags page. I mean, people only have 100 tags querying. That's very easy.
Aaron Francis
Mm-hmm.
Jesse Hanley
So there's no WebSocket for that. But there-
Aaron Francis
Mm
Jesse Hanley
... there's a, a counter on the right-hand side of the tags. Each individual tag-
Aaron Francis
Mm-hmm
Jesse Hanley
... has a count of how many people-
Aaron Francis
Mm-hmm
Jesse Hanley
... have the tags. That's tag.usertags.count or whatever.
Aaron Francis
Mm-hmm.
Jesse Hanley
That is... Yeah, that's a WebSocket request. I'm always gonna WebSocket request that one 'cause, I don't know, maybe the count's slow or let's say, um, someone's doing a lot of writes. Uh, there, there's so many things that could go wrong, and so-
Aaron Francis
Of course
Jesse Hanley
... I always, I always push that to... Yeah, I always push that to a WebSocket and then stream in the HTML. Um-
Aaron Francis
So have you built, like, a little, kinda like a little homegrown framework to say, like, on the front end, what is being requested, and then on the back end? Like, how, how do you tie all this stuff together in a way that's not bespoke for each t- each time?
Jesse Hanley
Yeah. So it's using Action Cable.
Aaron Francis
Okay.
Jesse Hanley
So it's... And, and it's very lightweight code, so I, like, kinda create a connection to Action Cable, and then I use, like, Sideki- Kick effectively to create, like, a background job.
Aaron Francis
Mm-hmm.
Jesse Hanley
And then I stream a partial or some JSON or whatever, um, and then that actually populates. I don't even know why this, like... I feel like this should catch on 'cause it's very efficient.
Aaron Francis
This should catch on.
Jesse Hanley
It's very-
Aaron Francis
This rules. I love this.
Jesse Hanley
Y- yeah. It's very, very handy. Like, and it, it... Again, it takes... Like, for example, let's say an Elastic Cluster goes down. Like-
Aaron Francis
Mm-hmm
Jesse Hanley
... my whole app doesn't break, and I can actually also stream in an error response to say, "Hey, we're struggling at the moment," and have, like, a spinner there. So there, there's o-
Aaron Francis
Uh
Jesse Hanley
... there's other benefits. But especially for those, like, N+1s, N+1s aren't inherently bad, and you, you sometimes can't optimize them away a lot of the time.
Aaron Francis
Mm-hmm.
Jesse Hanley
Or sometimes there's, like, not even any point to optimize them away.
Aaron Francis
Yes.
Jesse Hanley
So you can just load the content a little bit different or think about loading it a little bit different. And, um, I found that to be another calm way to kind of, uh, on the product side to, to make Postgres a little bit easier to work with by just, yeah, streaming stuff through background workers.
Aaron Francis
Just giving it-
Jesse Hanley
Yeah
Aaron Francis
... a little bit of time. I like that.
Jesse Hanley
Yeah.
Aaron Francis
This is-
Jesse Hanley
Yeah, yeah, yeah
Aaron Francis
... this is exceedingly clever. I wanna steal this and bring it to Laravel in some cleverly named package. Hmm.
Jesse Hanley
Yeah. Stream, Stream, Stream Blade. Stream Blade or something like that.
Aaron Francis
Stream Blade.
Jesse Hanley
When you sh-
Aaron Francis
That's a good... You know, we'll workshop it-
Jesse Hanley
Blade Socket
Aaron Francis
... a little bit, but that is a good first, that's a good first step. I like that. No, that's super clever. I didn't realize, um, I didn't realize that that's how you're doing it. I think the, the combination of a WebSocket and offloading it to a background job is wild to me.
Jesse Hanley
'Cause most, um... 'Cause, like, what, what, what I r- very early on before I started using Elastic, th- this was the issue. This is where I actually started doing it. When I, when I was predominantly on Postgres, stuff w- would be occasionally slow. There'd be querying a custom-
Aaron Francis
Sure
Jesse Hanley
... field, and it would be slow. And I hated the, the page would take 30 seconds to load. And, and-
Aaron Francis
Sh-
Jesse Hanley
... Heroku has a 30-second timeout.
Aaron Francis
Yeah.
Jesse Hanley
Heroku has a 30-second timeout, right?
Aaron Francis
And humans have-
Jesse Hanley
Now-
Aaron Francis
... like a four-second timeout. Nobody's waiting around.
Jesse Hanley
Hu- h- humans have much less than four. So, um, and so by re-architecting, I gave myself some grace-
Aaron Francis
Mm-hmm
Jesse Hanley
... and a, a little bit of breathing room, and then I could obviously work out stuff, um, after that, and I obviously restructured and refactored stuff. Um, but yeah, trying to take stuff and responsibility out of the web request, uh, has been very, very, very, very, very, very helpful. Um, yeah, especially when bringing in a lot of data. Well, like, let's say, uh, like a visitor profile page, doing user.events.
Aaron Francis
Right.
Jesse Hanley
Like, even paginating through some of those, some of them have, like, 10K events, and, like, no matter how much I kind of optimize that pagination, it's too... It can be very, very tricky. Um, and yeah, n- not, not optimizing it, it's, like, sometimes okay if that takes, there's a spinner for three seconds, you know?
Aaron Francis
Mm-hmm.
Jesse Hanley
Like, that, that, that's okay and it's not too much stress on the Postgres instance, but having the page take three seconds, nah.
Aaron Francis
Yeah.
Jesse Hanley
So-
Aaron Francis
No, that's no good.
Jesse Hanley
Yeah. I, I, I think my advice on the product side would just be trying to, like, re-architect your product in a way that, like, you know, give yourself some grace, you know? Maybe push stuff off to background jobs, or push stuff-
Aaron Francis
Uh-huh
Jesse Hanley
... off, or just change how you render stuff, um, so it's, it's not so much an issue.
Aaron Francis
Okay, so final question on this because my mind is blown. The- When you... I don't know much about Rails, but so you have this Active Cable-
Jesse Hanley
Yeah
Aaron Francis
... Action Cable, Active Cable?
Jesse Hanley
Action Cable.
Aaron Francis
Action Cable.
Jesse Hanley
Action Cable.
Aaron Francis
So you have this Action Cable concept. Do you hand off some sort of unique, uh, uh, like, Action-
Jesse Hanley
Job ID?
Aaron Francis
... Cable instance ID to the job? Or how does the job know who to phone home to?
Jesse Hanley
Mm-hmm. So, um, so Action Cable creates a connection. I think they call it, like, rooms. So it k- kind of-
Aaron Francis
Okay
Jesse Hanley
... c- creates a connection. There's now a persistent connection from, like, uh, the client to the Action Cable server. So that's-
Aaron Francis
Mm-hmm
Jesse Hanley
... that's unique, and Action Cable keeps a lot of that... Like, it handles all that kind of stuff.
Aaron Francis
Okay.
Jesse Hanley
Then from, from there, I can then, uh, I kind of create, like, a unique job ID o- on the client-
Aaron Francis
Mm-hmm
Jesse Hanley
... side. Um, so it's just, like, a random hex or whatever.
Aaron Francis
Sure.
Jesse Hanley
Uh, and then that creates the job ID. The job then gets processed, and the, the job has knowledge of, like, the job ID and the Action Cable user, and then I stream it back in, and then the, the user gets it to, to populate. This also works really well with, like, AI type stuff because some of those-
Aaron Francis
Mm-hmm
Jesse Hanley
... take a little while. So if I'm-
Aaron Francis
Mm-hmm
Jesse Hanley
... doing, like, a compliance check on an email, it's okay if that takes 20 seconds to load because it's, um, happening in a background job, not a web request.
Aaron Francis
Mm-hmm.
Jesse Hanley
Um, and so that, that's super useful as well. Yeah, so yeah, Action C- connection gets created, job gets enqueued, then job streams down a partial or some JSON to then render, uh, in the app. So yeah. Again, with this theme of making my Postgres calm -
Aaron Francis
Right, yeah
Jesse Hanley
... um, by taking a- all, all, all, all, all this... Like, it, it's all related. It's, it's, it's all related, um, and just taking a lot of the anxiety off me and being able to build super fast apps where the web requests have very low responsibility on the Postgres side.
Aaron Francis
It's funny because it seems like everything has low responsibility. Like, the Postgres has low responsibility, the web request, the background job's just doing a little count. Elastics just, you know, you've got four different elastics. They're all just doing their own little thing. It's like, who's got the responsibility here? It's all little responsibility-
Jesse Hanley
Not me
Aaron Francis
... all the way around. Not you. It's great. I love it.
Jesse Hanley
Yeah, yeah.
Aaron Francis
This is fascinating.
Jesse Hanley
Yeah, so it's, it's-
Aaron Francis
I mean-
Jesse Hanley
... it's different, right? Um, and, and same-
Aaron Francis
It is different
Jesse Hanley
... same with like Redis.
Aaron Francis
Yeah.
Jesse Hanley
Yeah. It's, it's different.
Aaron Francis
Yeah, what does Redis do?
Jesse Hanley
Same with, like, Re- so, so Redis is, like, Action Cable has its own Redis instance. This...
Aaron Francis
Mm.
Jesse Hanley
Someone's probably gonna call me out on how dumb this is, but Action Cable has its own instance. Rails Cache has its own instance. Sidekiq has its own instance. Our rate limiter has its own instance. Now, is that overkill? Yes. Is Redis cheap?
Aaron Francis
Yes.
Jesse Hanley
Not on Heroku, but yes.
Aaron Francis
It's the same price it was 10 years ago.
Jesse Hanley
Same price it was 10 years ago. But, um, but re- relatively it's cheap, right? You know, I'm talking, uh, you know, a couple of customers per Redis instance, uh, means that I at least have that reliability, and I'm moving in the same direction for Postgres. So this has been my theme. My theme is, is that I end up trying to... I start with one, I started with one Elastic instance.
Aaron Francis
Mm.
Jesse Hanley
I started with one Redis instance, and I start kind of breaking them down into much smaller responsibilities, um, and then that makes the problem set a lot easier to solve. I'll probably go-
Aaron Francis
Mm-hmm
Jesse Hanley
... one of the reasons I'll go to single node, like multiple single node instances on Postgres is that'll be step one, and then maybe the emails one becomes gigantic, and then I just have that emails database to deal with then. I can then go, "Hey, you know what? I'm gonna move that to Citus" or-
Aaron Francis
Mm
Jesse Hanley
... "Hey, I'm gonna move that to, to Vitess," because that's a good next step for me. Um, and it just, it, it just makes things a lot easier to manage, right? Whereas if I just have one big monolith of any of these, it's like, oh, oh boy, this is a little bit stressful. If, like, let's say on the Redis side, if I get DDOSed, right?
Aaron Francis
Mm-hmm.
Jesse Hanley
Well, now my Sidekiq's down. That's not great. Um-
Aaron Francis
That's not great
Jesse Hanley
... hmm, no, that's not great. Or now people can't load... Uh, I, I had, I had this one user who left a book on their re- refresh button on their computer.
Aaron Francis
That is some Silicon Valley stuff right there.
Jesse Hanley
Massive account. Massive account, right? Complex Elastic query on the, on the people users page, just like refreshing, right?
Aaron Francis
Just hammering.
Jesse Hanley
And, um, just j- j- just hammering, right? And, um-
Aaron Francis
And they're behind the auth wall. They're inside the castle.
Jesse Hanley
They're, they're inside the castle, right? And so I, I ended up using, uh, Cloudflare to make sure that never happens again. Um, but, uh, dur- during that happened, that, that, that, uh, that backlogged, uh... What did that do? That, that killed my Action Cable Redis instance, which then, which then meant things in the app didn't load, not great, but because Sidekiq was still up and everything else was still up, um, basically no one
could... Like, there was spinners, but our app is like, people do stuff and then they leave, right? And we're sending-
Aaron Francis
Mm-hmm
Jesse Hanley
... emails automatically on their behalf. Everything else continued to run smoothly. Yeah? So, so having things split means the problems that... By the way, when I was doing that, I was like at a Best Buy on the trip to Canada from Japan-
Aaron Francis
Oh, gosh
Jesse Hanley
... with a two-year-old that had just woken up. Yeah. Um, but having all these small things, it's very easy to like, you know, just restart a single instance and all that, so.
Aaron Francis
Mm-hmm.
Jesse Hanley
Yeah, a little bit of a, a tangent, but at least, at least that-
Aaron Francis
No, fantastic story
Jesse Hanley
... that's how I think about it.
Aaron Francis
Great story. We love a good story. So the only, I think the only monolith I'm hearing is your Rails monolith, and you mentioned early on you've got a fast, uh, fast Ruby team working on that.
Jesse Hanley
Yeah, I do.
Aaron Francis
So let's wrap there. What's, what's going on on the Rails monolith side?
Jesse Hanley
Yeah. So, um, on the Rails monolith side, so Rails 7.2 I think, so Rails 7.2, and obviously like Rails 8 and stuff, um, comes jam-packed with really great, uh, stuff for multi-tenant DB. Um, and so I want to get m- my app up to like the latest on, at least on 7.0-
Aaron Francis
Mm
Jesse Hanley
... just so I can pull in a lot of that stuff just to make my life a lot easier.
Aaron Francis
Mm-hmm.
Jesse Hanley
Things like joins across multiple databases, all that kind of like good stuff. Um, and by being on the latest version, it just allows a more seamless transition over. Um, and then once, once that's done, then, uh, we can start, you know, experimenting by rebuilding the world and, uh, seeing how that kind of, you know, seeing how we're gonna orchestrate a lot of that.
Um, but yeah, so Rails, Rails 7 comes with a lot of... And from my understanding, a lot of it's pulled from GitHub, like how GitHub does-
Aaron Francis
Mm
Jesse Hanley
... multi-tenant DB. So I think GitHub has m- multiple databases for all kinds of things, and a lot of Rail 7 is kind of in their philosophy of doing things from, from my, from like what I've, what I've read. Um, and yeah, I'm probably gonna follow that path for, for, for the, the most side of things. Um, so yeah.
Aaron Francis
Wow. So cool.
Jesse Hanley
Thanks, man.
Aaron Francis
This has been a delight. Is there, is there, um... So two things, one, anything else on the technical side that you, we haven't covered that you want to cover?
Jesse Hanley
No. No. I'm, I'm... No. I, I think, I think, I think that, that, that's most of it. My, my like, my, my big kind of, uh, I guess ask for anyone that is trying to like build something is like don't overcomplicate it. You can stay on a single node for like quite a long time. It's very rare that people are storing like as much data as, as we are, and from my understanding and like talking to some of the, um, yeah, like some of the Postgres experts, people are running very large multi, multi, multi, multi-terabyte, uh, single node instances kind of pretty calmly
and well, and a lot of that is like trying to... It's just like how you use the database.
Aaron Francis
Mm-hmm.
Jesse Hanley
So your database can get quite large if you use it in a certain way. And so just trying to work out, all right, like how, how do I wanna use this database? Are there ways that I can use it that are less stressful and are a little bit calmer? And then try and like design your app around that. And a lot of the times when you do take some responsibility off the, the database, I don't know, you sometimes you build better products because of it.
I think Bento is very, very fast. I think it is like quite delightful to use, and a lot of that is because of the decisions I've had to made because of Postgres, um, to try, try to make it like a, a better experience for me, and that's led to a better experience for my users. I don't know if that makes sense, but it make, feels right to me.
Aaron Francis
Yeah. No.
Jesse Hanley
Um-
Aaron Francis
That, that makes perfect sense. Um, okay, so the last thing I want you to say is give us your pitch for Bento, but before we do that, um, you are not out on Twitter doing a lot of like thought leader-y stuff, but you are a-
Jesse Hanley
Mm-hmm
Aaron Francis
... one person bootstrap company, profitable, calm. So give us your... G- give me, give me your pitch to the aspiring, the, the young Jesse Hanley, the person that wants to be in your position, running a software company without losing their mind, without having to raise VC if they don't want to.
How, how would you encourage the next generation of, of aspiring, uh, builders?
Jesse Hanley
That's a big responsibility. Um, okay. So like I think, I think something that has been true to me, and I actually mentioned this to like another guy on, on a demo call who asked me, like my advice is like you got to stay true to, you know like when you start out, you've kind of got those like rose-tinted goggles of like how a startup should be and how a company should be. You know, you follow Basecamp and all that.
Aaron Francis
Mm-hmm.
Jesse Hanley
You have to stay true to that, and sometimes that sucks, and sometimes it's actually not too much fun. It's not fun. Bootstrap is not really that fun. You gotta like take money- ... from your own pools of cash. Um, sometimes you gotta pay yourself not that much for a while.
Aaron Francis
Yeah.
Jesse Hanley
Um, it takes a really long time. Um, like I'm seeing, I'm seeing one of our competitors that has, uh, a bug as their logo. You know, they're, they're multiple times larger than us- Um, but I, I don't think they're profitable, and it sounds really-
Aaron Francis
Mm-hmm
Jesse Hanley
... stressful in there, right? And I'm like, "Well, I could potentially be like that. I could raise some money." Um-
Aaron Francis
Mm-hmm
Jesse Hanley
... but I, I don't want to. Like, I love living in Japan. I have a two-year-old daughter who I absolutely adore. I've been able to be home for all of this time. Um, I love my wife to bits. I'm able to go get lunch with her whenever I want.
Aaron Francis
Mm-hmm.
Jesse Hanley
I can chill. Like, it's, it's just... It's a good lifestyle. But I've stayed committed to what I wanted, and I've been okay with the trade-offs of what, what that's entailed, right? Like, I've been, I've been okay with not growing that fast. I've been ocr- okay with taking things slow. Um, and it's turned out o- it's, it's turned out fine for me. So I think, like, if you have rose-tinted goggles of, like, the business that you wanna build, try not to make compromises.
Be, like, super patient with it. Um, listen. Work obviously very, very hard. I've worked very hard on this business. Very, very hard.
Aaron Francis
Mm-hmm.
Jesse Hanley
Every day I work on it, and, uh, and it's paid off. It's paid off for me. And so I think-
Aaron Francis
Mm-hmm
Jesse Hanley
... hard work, staying committed to your ideals, t- s- most often figures itself out if you kinda stay in the game long enough. That... Maybe that's the, the one caveat I wanna put. If you stay in the game long enough, you'll hopefully figure it out. Uh, otherwise, maybe try something else. Maybe give it a go for six years and, and haven't found product market fit. May- may- maybe you should try something else.
But, um-
Aaron Francis
Yeah. Maybe pivot a little bit. Yeah.
Jesse Hanley
Yeah.
Aaron Francis
I like that.
Jesse Hanley
But-
Aaron Francis
That's a great answer. I, I put you on the spot there. That's a great answer.
Jesse Hanley
Thanks, man.
Aaron Francis
I know that, uh, I know that you wanna lead a quiet life and work with your hands, but we could use more people like you being vocal on Twitter. But I won't, I won't put-
Jesse Hanley
Ah
Aaron Francis
... that on you. That's, that's a lot.
Jesse Hanley
But, but, but, but, but, but-
Aaron Francis
You don't wanna wade into those waters.
Jesse Hanley
Yeah, I mean, like, slight, slight tangent. Th- part of not... I, like, I don't wanna be a thought leader and, like, I don't actually wanna attract too many customers. Like, this-
Aaron Francis
Hm
Jesse Hanley
... this is a weird, this is a weird thing. I don't wanna attract too many customers. Like, I, I love that you're a customer. I love that some of your friends are customers. I love that, like, a lot more of our friends are trying Bento out-
Aaron Francis
Mm-hmm
Jesse Hanley
... and, and using that, and the company is profitable. And, like, frankly, like, I, I think I mentioned on, on the preamble before we, like, kinda went into this, my rent's, like, under 1,500 a month, including utilities and stuff. I live in Japan. Food here is, like, I can have an amazing, like, teishoku meal for, like, 5 to $7. I don't-
Aaron Francis
Psh
Jesse Hanley
... I don't really need to, I don't really need too much more money. Uh, uh, our daycare's $4 an hour. We were talking about daycare before this. Um, you know? How much more money do I need?
Aaron Francis
Love it.
Jesse Hanley
So, like, but-
Aaron Francis
A bunch of people just cursed at you, just screamed out loud at you- ... for that one.
Jesse Hanley
Yeah. So it's like, after I paid myself, like, what I was earning, uh, when I was running the agency-
Aaron Francis
Mm-hmm
Jesse Hanley
... I, I don't, I don't really need too much more than that. So, um, yeah. But it, it did take... It took, it took... I've got it in, uh, the footer of our website. It took, right, to get to this point, six years and 251 days.
Aaron Francis
Oh, wow.
Jesse Hanley
So-
Aaron Francis
We're almost at seven. Almost.
Jesse Hanley
Yeah. Al- almost at seven.
Aaron Francis
That is wild.
Jesse Hanley
So it just, it just takes a really long time.
Aaron Francis
Well, you are, uh, you're doing an incredibly good job, and if you're not-
Jesse Hanley
Thank you
Aaron Francis
... you should be proud of yourself, um, because this is, this is very inspiring for me. So tell us, uh, I know you don't want-
Jesse Hanley
Thanks, Aaron
Aaron Francis
... too many more customers. But tell us, uh-
Jesse Hanley
I'll take 'em
Aaron Francis
... why people, why people should at least consider Bento.
Jesse Hanley
Yeah. So, um, Bento is very good at a couple of things. We're very good at sending marketing email. We send all your newsletters and all that kind of stuff.
Aaron Francis
Mm-hmm.
Jesse Hanley
We're very good at sending automated email. So if someone signs up to Aaron's, uh, wait list, you say, "Hello, I'm Aaron. You're on my wait list." We're very good at that. We're also very good at a couple of other things in that automation area. Um, and then now we're getting ver- we're getting better at sending transactional email.
Aaron Francis
Mm-hmm.
Jesse Hanley
So in the last two weeks, we've actually... You know how you hacked on that Mailer for Laravel?
Aaron Francis
Mm-hmm. Mm-hmm.
Jesse Hanley
We now have an official Laravel SDK-
Aaron Francis
Hey, look at that
Jesse Hanley
... with that baked, with that baked in. You can now say, like, whatever it is. You can do the Mailer Bento thing and the transport-
Aaron Francis
Uh-huh
Jesse Hanley
... that's what, that's what it is, right? Yeah.
Aaron Francis
Yeah.
Jesse Hanley
You can do the transport Bento-
Aaron Francis
Yep. Yep
Jesse Hanley
... and it all just works.
Aaron Francis
Amazing.
Jesse Hanley
And then we've got all these nice Laravel methods. We shipped a Python library. We shipped a, a new Rails library, shipped a Swift library for funsies. We shipped- We're gonna do a Unity library, so we can serve video game developers.
Aaron Francis
Why?
Jesse Hanley
I don't know. It's just fun. Um, there was a, there's a guy, there's a guy in, uh, called Zach. I actually wanna give him a little bit of a shout-out. There's a guy in Zach, uh, called Zach, uh, who lives in Dazaifu, which is some neighborhoods away. He signed up to Bento as a customer, made us the Laravel SDK, and has just kept hacking. He doesn't stop.
Aaron Francis
He just kept going.
Jesse Hanley
He's a mad- he's a mad man. He's like, "I, I built a Swift library for funsies." Now we've got a Swift library. So, um, Zach's been, Zach's been a machine. I, uh, yeah-
Aaron Francis
Amazing
Jesse Hanley
... I just wanna give a public shout-out. So-
Aaron Francis
Good job, Zach
Jesse Hanley
... so... Yeah. He's, he's, he's been a, he's... I, I am paying him for his work, but he's just... He, he was, like, a customer that wanted to, like, just help out for fun. Um, and so yeah, he's... Been paying him to build these libraries, and so we've got SDKs coming out the wazoo. So, uh-
Aaron Francis
I love it
Jesse Hanley
... that, that's been, that's been good. So for most, for most things, people, you know, Next.js and all that stuff-
Aaron Francis
Mm-hmm
Jesse Hanley
... um, most frameworks people are building on that are watching this are dealing with databases. Uh, Bento's got very easy ways now, and much better docs, to get started-
Aaron Francis
Nice
Jesse Hanley
... to send marketing and transactional email. So that's the pitch.
Aaron Francis
Yep. And I, I cosign that. I use you for marketing and transactional, so we do all of our password resets through Bento. Obviously, we send all of our, uh, SQLite, Postgres, aaronfrinst.com, screencasting.com, all of those go through Bento. And just, I think yesterday or the day before, uh, I was DM'ing you about pulling down tags from the API.
I use your API for everything. I'm pulling down, syncing down all the tags, so I know locally when somebody, like somebody from SQLite signs up for Mastering Postgres, I can look and see, like, what tags do you have? All right. Let's, let's do a sync job to make sure you have all the right tags in Bento, and then I can keep them locally. It's great. I love it. I love it. It's great. Great product.
Jesse Hanley
Thanks for saying that. And thanks for being a customer.
Aaron Francis
Yeah.
Jesse Hanley
It like puts food on the table-
Aaron Francis
Of course
Jesse Hanley
... for my family, so I appreciate it. Thank you.
Aaron Francis
Of course, yeah. Well, um, thank you for doing this. Uh, I know that, uh, I know we've been trying to do this, but Japan and Texas are not lined up, uh, on time zones quite as easily, so I'm glad we finally got to make this work. This has been a delight.
Jesse Hanley
Same.
Aaron Francis
Thank you. Uh, thanks for giving us all of your knowledge. And where can, where can people find you online?
Jesse Hanley
Uh, on Twitter I've got bento, @bento the handle. Um, and so that's that. And then I think I've tagged, my ego's tagged myself in the bio, so you can type in my name. It's Jesse T. Hanley. You can cl-
Aaron Francis
Perfect
Jesse Hanley
... click through there, but it's a lot easier to remember, @bento on Twitter. Um-
Aaron Francis
Perfect
Jesse Hanley
... and then yeah, and then bentonow.com to start a trial. I don't know.
Aaron Francis
Okay. Giving 'em the hard close, Jesse.
Jesse Hanley
You can talk to me. This way, um, may, maybe, maybe like a, maybe like a GIF. If anyone wants to like just chat about stuff, um, or chat about like database stuff, there's a, there is a demo link. Just tell me that you, you don't wanna be sold, and, and I'm, I'm happy to chat about database stuff. I'm happy to talk about scaling Rails. I'm happy to talk about anything that like we've covered in here, even just as like a friend.
'Cause building apps is hard, building apps is stressful, and it's a lot easier when you know there's approachable people out there to talk to. And so open invite for anyone to click the demo link and just tell me ahead, "Hey, this isn't about Bento. I just wanna talk about Rails," and I'll happily talk to anyone for 30 minutes about whatever problem they've got. So yeah, there's a-
Aaron Francis
Awesome
Jesse Hanley
... if anyone wants it.
Aaron Francis
So ge- yeah, so generous. Thank you. All right, y'all. Well, um, if you liked this episode, please either I guess subscribe on YouTube, uh, Aaron D. Francis, or there is an RSS feed somewhere. Uh, it's in the show notes, so go down there and find that, and I'll put links to everything Jesse, uh, does and has mentioned in the show notes. And until next time, we'll see you later.
Jesse Hanley
Bye.