Simon
00:00:08 – 00:00:21
Hello, everyone.
Simon here from snapshooter.com, and you're listening to the pushing to production podcast.
On this podcast, we focus on the purely technical side of running a project, learning about how startups go from code to production.
Simon
00:00:25 – 00:00:32
Hello, everyone, and welcome to another weekly episode of Pushing to Production podcast.
This week, I am joined by Aaron Francis.
How you doing?
Aaron
00:00:33 – 00:00:34
Hey.
Good.
Thanks for having me.
Simon
00:00:34 – 00:00:40
Aaron is the founder of Torchlight and the cofounder, did you say, of Hammerstone?
Aaron
00:00:41 – 00:00:59
Yeah.
That's right.
So Torchlight is a, like, a syntax highlighting API, and it's actually one of Hammerstone's products, but I kinda built that one solo.
And then me and a couple of other friends have Hammerstone together, and we're working on some stuff for the Laravel and Rails communities.
Simon
00:01:00 – 00:01:04
Okay.
So both ecosystems.
Yeah.
Could you go into a bit more about that?
Aaron
00:01:04 – 00:01:29
Yeah.
Sure.
So the primary thing that we're working on is how on most, let's say, ecommerce websites or, let's say, something like Mixpanel, and you wanna say, show me users that have clicked on this thing in the past week and are in the state of Texas, where I am, and are on the paid plan.
You know how you have those filter things that you wanna build?
Simon
00:01:29 – 00:01:29
Yes.
Aaron
00:01:29 – 00:01:52
So what we're building at Hammerstone is a way for developers to build that easily.
So it's a way for developers to offer that to their end users.
And so we provide for Laravel and Rails and Vue and React and Hotwire.
We provide a component that then allows developers to build that for their users.
Simon
00:01:53 – 00:02:00
So do you manage the storage of that data to search, or are you kind of like a library on top of some other storage system?
Aaron
00:02:00 – 00:02:25
Yeah.
So one of our primary, I guess, objectives is to sit on top of in the Laravel ecosystem, we sit on top of Eloquent.
And then in the rails ecosystem, we sit on top of active record.
And so we get the benefit of not having to worry about SQL injection, writing raw SQL, anything like that.
We sit on top of the 10 years of Eloquent work.
Aaron
00:02:26 – 00:02:53
And so what we do then is we provide we translate the user's intent into the Eloquent query, and we also provide the front end, the user validation, so we we do errors and that kind of thing.
And then we provide a way for the developer to store the filter if people wanna save, like, Aaron's favorite customers, they can save that filter and come back to it later and pull it up again.
Simon
00:02:54 – 00:02:57
Interesting.
So you're like a managed library at that level to make.
Aaron
00:02:58 – 00:03:06
Yeah.
Exactly.
So everyone owns their own data.
They would just buy the package, composer install it, and then start using it.
Kinda like Nova.
Aaron
00:03:06 – 00:03:08
Like, you just buy the package and you start using it.
Simon
00:03:08 – 00:03:17
Interesting.
Interesting.
You're giving me flashbacks.
So I worked on a hotel management system years years ago and having to build filters for the the search around.
Aaron
00:03:18 – 00:03:37
It's like something that everyone has to do at some point, but doesn't really set your app apart because your customers expect for it to be there.
But also it's really hard to do well.
And so it's this quagmire of developer time, and then when you get done with it, it's like, great.
That's what I expected to be there.
Thanks for building that.
Aaron
00:03:37 – 00:03:38
So it's super frustrating.
Simon
00:03:39 – 00:03:55
Yeah.
I remember some sort of Elasticsearch hybrid solution that we came up with, and it was just a real pain to to keep everything in sync.
So, yes, I like the idea of that.
Okay.
So, is that a finished product, or is that still early stages?
Aaron
00:03:56 – 00:03:58
Are any products ever finished, Simon?
So
Simon
00:03:59 – 00:04:00
I can't.
Aaron
00:04:00 – 00:04:30
It is in the sense that we have so on the rail side, we have a client who we've been building for a year, but it works over there.
On the Laravel side, we have 2 clients who have installed the package and are using it in their apps, and we're onboarding a third one this week.
So it is finished in the sense that people are successfully using it.
It's not finished in the sense that, like, we haven't had a a launch yet.
But, yeah, we're onboarding people currently.
Simon
00:04:31 – 00:04:37
I would presume that you're still sort of gathering feedback and improving things based off those sort of, like, initial
Aaron
00:04:38 – 00:04:46
I mean, the first two clients that used it on the Laravel side were like, this is great.
Have you thought about this?
And I said, no.
I haven't.
That's a great idea.
Aaron
00:04:46 – 00:04:49
Let me add that.
So it's been super valuable so far.
Simon
00:04:50 – 00:04:55
I still get people suggesting stuff after 4 years that I think, why didn't I think about?
That's so obvious.
Aaron
00:04:55 – 00:04:57
So you know it's never finished.
Exactly.
Simon
00:04:58 – 00:05:11
Cool.
So I guess the other part of what you do is torch lines, which, I discovered recently via Twitter.
It was recommended.
I put out a tweet, and I think I got 6 or 7 people will reply saying, use torch light.
Aaron
00:05:11 – 00:05:12
It's working.
Simon
00:05:12 – 00:05:17
So, yeah, why don't you give an overview of what that actually is before we go into how that works?
Aaron
00:05:18 – 00:05:49
Yeah.
So this was born out of writing documentation for the other Hammerstone products, and I found that all of the syntax highlighters work on the front end.
They're not quite as powerful as something you would expect, say, in Versus Code because they have to work in the browser.
And so what happened was they would end up missing a bunch of syntax.
So I would paste in some PHP 8 code from one of my projects, and it would miss half the stuff and, you know, color it wrong.
Aaron
00:05:49 – 00:06:21
And I was like, if part of our thesis at Hammerstone is high attention to quality and then our docs look like crap, that's really frustrating.
And so I started looking around for other ways to do syntax highlighting, and I found that there's really not a good one to do it in the browser.
And so what Torchlight is is it's a syntax highlighting API, and so it hooks into the rendering process in Laravel.
There are several libraries for it.
Jigsaw has a library, which Jigsaw is a static site generator for Laravel.
Aaron
00:06:21 – 00:06:49
And what it does is it sends off all the blocks, all your code blocks to a server.
I highlight them and send them back.
And what that allows me to do is use the full power of the Versus code engine, which is all open source.
And so we're able to do, like, proper PHP 8, PHP 8 1, all that kind of syntax highlighting.
We're able to do obscure languages and add extra languages like Alpine JS plus HTML.
Aaron
00:06:49 – 00:07:34
We're able to add that kind of stuff.
And then we're also able to add we're able to add these inline annotations, and so when you're writing documentation and or blog posts, sometimes you'll have a chunk of code, but you want to highlight specifically two lines that you want to draw your readers' attention to.
And some other packages have that, but it's in these, like, cryptic, obscure things that you have to put at the top of your code block, and then you change a line and the reference changes and everything's out of date.
What we've done is I've figured out a way to use code comments in the code blocks.
So if you're writing a code block, you can add a code comment and control the display of your code.
Aaron
00:07:34 – 00:07:48
So you can either highlight it, focus it, do git add, git remove, that kind of stuff, all from within the code.
So then in your editor, it still looks like actual code, so it doesn't freak out and try to reformat it and break your blog post or your docs.
Simon
00:07:49 – 00:07:50
I did not know about that.
Aaron
00:07:51 – 00:07:52
So Yeah.
Simon
00:07:52 – 00:08:07
Yeah.
I think you're gonna explore that.
For me, the thing that interested me was the fact that it's all done on back end.
So we are rebuilding Snapsheet as marketing site at the moment, and we're going to a static site generator.
We're using Jigsaw, and I'm writing the API docs and some other docs.
Simon
00:08:07 – 00:08:22
And to be able to send off stuff at render at at, like, build time and come back with basically HTML that's then ready to go.
No JS library when you load up the blog post and everything sort of moves around and jumps around.
Aaron
00:08:22 – 00:08:40
It's the static site generation story for Torchlight is really compelling because then you just ship HTML, and that's one less thing you have to worry about.
Like, if it looks right on your local machine after you build it, you're done.
It's gonna look the exact same way in production, which is really nice.
Simon
00:08:40 – 00:09:04
Yeah.
And I was happy that the, like, the SEO performance in a way or, you know, Chrome Lighthouse scores were gonna be.
You could actually tune them without having to pull in massive libraries to deal with, as you say, not being able to render PHP 8.1 because it doesn't like, no one's bothered to to write the code for it.
How do you deal with that at the on the back end?
And you said it was Versus Code.
Simon
00:09:04 – 00:09:05
So
Aaron
00:09:05 – 00:09:33
So I am traditionally a Laravel developer, PHP developer, have been for who knows how old I am now, have been for more than a decade.
But this is all JavaScript because Versus Code is all JavaScript.
And so I was pulling all this stuff in and able to get it running locally, and it worked great.
I don't love being in charge of DevOps.
I do it, but I don't love it.
Aaron
00:09:33 – 00:09:56
And so I go towards things like Laravel Vapor, which is a serverless platform.
So I go towards things like that.
But obviously, since this is, you know, entirely JavaScript, I can't use Vapor because Vapor is tuned for Laravel projects.
So what I use here is I use Vercel, which is another serverless platform that is probably a 1000 times bigger than Vapor.
Everyone's heard of Vercel at this point.
Aaron
00:09:57 – 00:10:11
And so I use Vercel for the rendering API, and I use Lambda or I use, Laravel Vapor, which is Lambda.
I use Laravel Vapor for all the application dashboard, doc site, everything like that.
Simon
00:10:12 – 00:10:18
I was gonna say, so you didn't want to use Lambda yourself, as in you could have built your own functions in Lambda and dealt with?
Aaron
00:10:19 – 00:10:49
I could have done that myself, but, again so I would have to figure out a lot of the plumbing myself.
Like, I'd have to figure out, like you mentioned, the the API gateway.
And then I have to figure out the deployment story because just vanilla Lambda doesn't have a very good deployment story.
Now I've written a PHP package to manage some Lambda stuff, but I would have to pipe it all the way through to a domain name.
And at that point, I'm in AWS console world, and I can do it.
Aaron
00:10:50 – 00:11:12
But it's a big fear.
Like, when you're running an API, It's a big fear of mine that I fat finger something in an API API gateway console, hit save, and it goes down.
And everybody's like, I can't render my code blocks.
And that that's just a big I don't wanna stay up at night thinking, did I configure a gateway right?
And so I just use Vercel for this one.
Simon
00:11:12 – 00:11:22
Yeah.
See, it's interesting.
When I was imagining how you did it, because I knew your sort of Laravel background, I thought you'd have used Laravel and then cooled down you 2 as, like, a binary that you had as part of the,
Aaron
00:11:22 – 00:11:23
So I tried that.
Simon
00:11:24 – 00:11:24
Yes.
Aaron
00:11:24 – 00:11:33
So I tried that.
Okay.
So this is my whole journey with Torchlight.
I tried that.
So I started on I started on vapor and had everything on vapor.
Aaron
00:11:34 – 00:12:22
And I would basically shell out to node to run the highlighting, but the boot up time was just prohibitively expensive.
And when I say that, I mean, like, a 100 to 200 milliseconds.
But then the other thing that was a real issue is not only was the, like, the node boot up time expensive, but there are certain like, I have to get an instance of the highlighter.
And getting an instance of the highlighter in the code, that itself takes a 100 milliseconds, because it's gotta load up the language files, and it's gotta parse all the JSON to get ready to highlight.
And so every time that I was shelling out to Node, it was booting Node for a 100 to 200 milliseconds, and it was getting a new instance of the highlighter for a 100 to 150 milliseconds.
Aaron
00:12:22 – 00:12:52
So we're talking like 300 milliseconds before I start even doing anything.
And at that point, an API for code highlighting is just too slow.
And so on Vercel, there's no shelling out to node, obviously, because it it just runs serverless platform.
But then I can also do this trick.
It's not a trick, but it is a technique where I get an instance of a highlighter outside of the actual handler that handles the request.
Aaron
00:12:53 – 00:13:10
And so the highlighter stays as a as a local variable.
So I can just reuse that highlighter over and over and over again.
So anytime it cold boots, it creates a new highlighter, and then every request use that same highlighter over and over.
So we're down to, like, 30 milliseconds.
Simon
00:13:10 – 00:13:16
Do you ever have issues after deployment then with just, like, cold boots with that, or is it?
Aaron
00:13:16 – 00:13:50
So that is part of yes.
So after deployment, a cold boot is where the container isn't available with your new code, and so they have to boot it up.
And so one of the things that I do on deployment in my GitHub actions is so my GitHub action will when I deploy, it'll run the tests locally.
It'll push to Vercel and run the tests on staging, so it hits that endpoint that Vercel gives you before it pushes it live.
And then something that I do after it's live is I just hit it once or twice.
Aaron
00:13:50 – 00:14:09
So I basically am I'm warming the container myself as a part of the deployment process.
Now Vapor gives you nice, like, prewarming stuff, Vercel doesn't.
And so I just kinda hit it once or twice before I finish my GitHub action.
So in theory, I'm hitting the cold boot and nobody else is.
Simon
00:14:09 – 00:14:25
Yeah.
It reminded me when I first played with Lambda or whatever, we'd have a Chrome script that would go through and continually continue to keep things warm.
I guess until you scale, then there's not yeah.
Then you hit cold boot issues again, but interesting.
So you've you got, like, completely serverless.
Simon
00:14:25 – 00:14:26
So there's an
Aaron
00:14:27 – 00:14:41
Completely serverless.
Yep.
And so the Vercel API talks to the Vapor application to figure out authentication, authorization, all that kind of stuff.
So they they talk to each other that way.
And, yeah, I don't have to worry.
Aaron
00:14:42 – 00:14:59
For example, if I lose my entire database and the vapor app stops responding, then the Vercel API is just gonna let everybody through.
Like, it's not gonna fail.
It's just gonna say, great.
Here are some highlights for free.
Because my whole thing is I don't wanna dork up anybody's website.
Simon
00:14:59 – 00:15:03
Cool.
So if anyone wants free, they just need to denial service attack you.
Aaron
00:15:03 – 00:15:07
Take down the other one, and you'll get highlighting for free.
Simon
00:15:07 – 00:15:13
Yeah.
Nice.
Have you had any worries about the pricing with the serverless function with Vasoli?
Aaron
00:15:14 – 00:15:51
So I did because what I'm offering is code highlighting, which in the rest of the world is entirely free.
And so, in fact, it's free even for for Torchlight, it's free if it's open source or nonprofit or anything like that, and so I'm offering a lot of free service.
The thing that helps me is I wrote all of the clients.
So I wrote the Laravel client.
I wrote the the Jigsaw 1, I wrote all of these clients, and all of the clients make heavy, heavy, heavy use of caching.
Aaron
00:15:51 – 00:16:23
And so every client inspects the code blocks before they send them off to me, and if they have already requested it in the past I think 7 days, it'll be cached and they don't send it off to me.
Even something like Laravel News, which uses it, Laravel News only sends, I don't know, a 1000, 2, 3000 requests a month.
And at that level, you know, when we're talking 50 milliseconds each, it's just basically free.
So I pay Vercel $20 a month, and that's it.
Simon
00:16:23 – 00:16:25
Oh, okay.
Okay.
Aaron
00:16:25 – 00:16:25
Yeah.
Simon
00:16:26 – 00:16:33
So make sure no one runs a a complete every time the page renders, it does your request.
I mean, you wouldn't wanna do that anyway.
Aaron
00:16:34 – 00:16:46
Yeah.
Our incentives are aligned because you as the developer wouldn't want that experience.
You wouldn't want that penalty every time.
Right?
And so people are are incentivized to make sure that they don't do that.
Aaron
00:16:46 – 00:16:48
So it works out for both of us.
Simon
00:16:48 – 00:16:56
Yeah.
Makes sense.
I saw a horror story online where someone had recently built a a blog system from Notion, and they were using the
Aaron
00:16:56 – 00:16:59
Two horror stories.
Two different companies got hit.
Simon
00:16:59 – 00:17:06
Oh, really?
I didn't hear about the second one.
It's just the cost of running functions on these platforms.
So
Aaron
00:17:06 – 00:17:07
Yeah.
I know.
Simon
00:17:07 – 00:17:15
I guess in the future, if you have a concern of that, you could go and optimize with, like, I see the Lambda or all going somewhere else as in
Aaron
00:17:15 – 00:17:28
I think both of these blogging things that sit on top of Notion did go back and adjust kind of their infrastructure, and now they're back into fair use on Vercel so that they're not getting hit with $2,000 bills every month.
Simon
00:17:28 – 00:17:32
I can't remember the person's name, but he is he is scheduled to come on this podcast.
Aaron
00:17:33 – 00:17:35
Oh, is he?
It's no it's Noah Braggs.
I didn't know if
Simon
00:17:36 – 00:17:41
Oh, no.
Not Noah Braggs.
It's the other it's the other guy.
So I was interested.
I might interview Twanget and Noah on at some point.
Simon
00:17:41 – 00:17:41
But
Aaron
00:17:41 – 00:17:52
Yeah.
So he's got potion dot so, and the other one is, I think I forget what the other one is called, but he got hit with the same thing, and I saw them talking about it on Twitter.
Simon
00:17:53 – 00:17:56
Yes.
So, anyway, I thought they'd be good podcast guests.
Aaron
00:17:56 – 00:17:57
For sure.
Simon
00:17:58 – 00:18:08
Have you had any, you I presume because of the age of 40, you haven't had any, like, horror stories with, like, infinite loops of scheduling and stuff.
I mean
Aaron
00:18:09 – 00:18:15
No.
Fortunately, no.
Thank goodness.
No.
Fortunately, this is all very basic.
Aaron
00:18:15 – 00:18:27
It's a very straightforward logic process.
I receive the request and highlight it and send it back.
So, no, I haven't hit any infinite loops that cost me 1,000 of dollars yet.
Simon
00:18:28 – 00:18:30
Yeah.
And that's the kind of thing that terrifies me.
Aaron
00:18:30 – 00:18:33
Yeah.
Yeah.
You and me both.
Simon
00:18:33 – 00:18:41
Yeah.
I mean, at the moment, we're still on, we're still on physical servers or, you know, virtual machines.
We haven't quite taken the leap into serverless hosting.
Aaron
00:18:42 – 00:18:44
Do you have a desire to move that way?
Simon
00:18:44 – 00:19:05
No.
We have got some constraints that make that a little difficult.
So we do, like, a lot of SSH connections, and sometimes they are slow.
Like, as in connecting to someone's server could take I mean, normally, it doesn't take that long, but sometimes they take 5 to, like, 15 seconds to establish a connection.
So leaving a Lambda just sitting there ticking it.
Aaron
00:19:05 – 00:19:12
Yeah.
And then once you get in there, you're doing a lot of work.
So I would imagine serverless doesn't make sense for y'all.
Simon
00:19:12 – 00:19:35
Once we've connected, we set things in motion, and we leave.
And, that that script kind of talks home to us.
But, you know, every 15 minutes, we, like, connect to the servers to make sure the backups haven't died.
Or if they stop, like, calling home, we go and do a check, see what processes are running or not.
And, yeah, sometimes those connections are really, really slow, like, getting timeouts and stuff.
Simon
00:19:35 – 00:19:43
So for that reason, no.
And I kinda like the monolith structure of not having, like, 6 different hosting types.
So
Aaron
00:19:43 – 00:19:48
Yeah.
No.
I get that.
That's what I love about Vapors.
I don't have to change anything.
Aaron
00:19:48 – 00:19:54
I just push my Laravel app to Vapors, and it is somehow serverless, and I just get to, like, not think about it.
So
Simon
00:19:55 – 00:20:02
I guess the last thing I was gonna ask around is how do you deal with backups?
But I don't think that makes sense in your case because you're not really
Aaron
00:20:03 – 00:20:32
Yeah.
So on on the Vercel side, I don't because there's no data.
On the app side, so on the Vapor app side, I have, for all of my Laravel stuff, I have basically just used Spotsy's backup thing.
And so what I do is I run the command and it ships the database backup to s 3.
And for this one, I can get away with doing it on serverless because the database is so small.
Aaron
00:20:32 – 00:20:52
But on, like, for example, the app I build at work, the database is, like, 300 gig, 200 gigs, something like that.
And so I couldn't get away doing that on serverless because that would, you know, it would take too long.
So for all of my Laravel stuff, it's all Spotsy's backup thing.
Simon
00:20:52 – 00:21:00
Okay.
That's one of our biggest competitors in a way.
Yeah.
I'm sure.
Trying to trying to get people off that into, you know, the world of managed solutions.
Simon
00:21:00 – 00:21:01
So
Aaron
00:21:01 – 00:21:09
I will admit it is definitely the entry level, like, I need a backup.
I'm gonna pull in this backup package, and that is
Simon
00:21:09 – 00:21:31
It is a very good solution.
And, ironically, it's what we used the first 2 years of touch here, before we had for for MySQL backups ourselves.
We used that.
But, yeah, now we do it from, like, a bash level, as in, we come in at the on the server and do the backup.
Or in the case of, like, sometimes, as you say, clients don't have servers.
Simon
00:21:31 – 00:21:48
Like, you you don't have a a server to physically connect to to do the backup.
So we'll spin up, like, a Fargate container and do the backup from there.
So that's kind of serverless, but also I don't know.
It draws the line between the 2, really.
Yeah.
Aaron
00:21:48 – 00:22:26
Yeah.
Well, I've had to do a lot of mucking around with the package because at work, we have several virtual columns in MySQL, and I have before just used the package to dump everything out and then tested a restore, and it all broke because you can't insert data into a virtual column because it's a virtual column.
And so I've had to do a bunch of mucking around with like, I dump it all out, and then I have to change the type of the column so that it's not virtual, it's stored.
And then when I restore it, I change it back to virtual so that it doesn't fail.
So, yeah, I could probably it is kind of a nightmare.
Simon
00:22:27 – 00:22:39
We get quite a few customers have issues with views.
Like, they've they've changed something and then views break.
So alright.
I think this is probably a good place to wrap up.
Is there anywhere people can go to find out more?
Simon
00:22:39 – 00:22:41
Where do you recommend they go?
Aaron
00:22:41 – 00:22:49
Yeah.
I would say Twitter.
I'm on Twitter all day every day.
You can find me at Aaron d Francis, a a r o n d Francis.
Yeah.
Aaron
00:22:49 – 00:22:52
Thanks for having me on.
I really appreciate it.
Simon
00:22:52 – 00:22:54
Cool.
Thank you very much for coming on too.
Cheers.
See you.
Simon
00:22:54 – 00:22:55
Bye then.
Aaron
00:22:55 – 00:22:55
Bye.
Simon
00:22:58 – 00:23:24
Thank you for listening to the pushing to production podcast from snapshooter.com.
Snapshooter is a backup service for all of your online servers, databases, and applications from the whole server snapshots at providers like Digislation, AWS, and Valtra, as well as direct backups from any provider to your given storage of choice, s 3, Backblaze, Google Drive, the list goes on.
Check us out today.
We have a limited free plan.
All plans come with a 14 day free trial with no card required.
Simon
00:23:24 – 00:23:25
Thanks for listening and tune in next week.