text
stringlengths
0
1.24k
**Johnny Boursiquot:** The first question I have for you is -- you've just raised a good point of using your framework to help you get off the ground and do prototyping quickly... But in this case you went a different route. I'm wondering what caused you to not use a framework; why did you go the standard library, bare...
**Mat Ryer:** Yeah, it's a good question. For me it's really about what we know. We wanted to be productive as quick as possible, so we just picked the things that we were the most familiar with. If I'd used Buffalo enough before, I could easily have started with that and got that going to start to test out the ideas a...
Initially, we didn't have very high demands on what the Go side needed to do. It's the business logic and it connects to the data, and it's a set of services, and things... But that's quite easy to do. It's the same whatever you choose, I think, for those sorts of things. So it just kind of made sense for us to start t...
**Jon Calhoun:** You said that you had some technologies that you knew you wanted to use, and I assume this was before you'd built anything... Was this because you thought they'd be a good fit, or was it because it was something you were interested in learning about? Or how did you have those technologies you knew you ...
**Mat Ryer:** David, we started -- it was App Engine, wasn't it? It was something we decided quite early...
**David Hernandez:** Yeah, we were quite successful with App Engine before; we were using it for a while. It's kind of the original serverless platform, isn't it? So we were quite happy with the results in previous projects. We thought "Oh yeah, why not?" It was the main decision how we were gonna deploy the backend; i...
**Johnny Boursiquot:** I'm picking up a theme here... Obviously, your approach to your architecture, your approach to what tools to use and not use, what framework to use or not use, how to deploy, basically not taking risks on things you weren't' familiar with... In your case it was a very deliberate decision to go wi...
**Mat Ryer:** \[08:00\] Yeah, absolutely... And I tell teams this when I talk to different teams as well about when they're choosing their technology - that's a big thing. gRPC for example might be the perfect choice from a purely technical perspective. But if nobody on the team has experience with gRPC, then there's a...
You can do some of that, but there's effort and there's kind of a cost to being productive in any of those. And we had that already on the frontend, because we hadn't done much frontend work for a while, and we knew we wanted to use a -- it was gonna be a rich frontend, so we knew it had to be somewhat of a modern fram...
And I've done that before, where I keep the frontend ultra-simple; it'll just be bits of jQuery or something just for the places where I want it to be dynamic, and then the rest of it is dead simple... And ultimately, for me, I want the frontend to be the best it can be. So you're better off, still, writing a rich fron...
So we knew there'd be learning for us there, so we didn't want to also have learning on the backend. We almost wanted the backend to be a given for us, since we've been writing a lot of Go for a long time.
**Jon Calhoun:** Do you think that's part of the reason when people switch to Go from a language like -- people using Python and Django, or if they're using Ruby on Rails... Do you think that's part of the reason that they struggle, is that if they're not using a framework there's not only the language to learn, but al...
**Mat Ryer:** Yeah, it could be. And similarly, you might decide learning a framework is the best way to spend that, because if that framework is then gonna do exactly what you need it to do, if the framework really fits well with what you're doing and you're not gonna be fighting it, then maybe it makes sense in that ...
But of course, anytime you choose a framework - and this really applies to any time you make a choice about any sort of foundational technology, you are necessarily constrained at the same time as it gives you things that you'd have to build otherwise. Similarly, it makes decisions for you as well. So if control is som...
**Johnny Boursiquot:** It's always interesting when you talk to teams about decisions made... Obviously, the two of you have worked together before, and you sort of know each other in terms of your propensity to go one way or the other, with this architecture or technology... I'm wondering, initially, in terms of desig...
**David Hernandez:** \[12:15\] Clearly. We have frictions every day, probably... Isn't it, Mat? Every day there's a friction and a battle, "I like this this way, I like this the other way..." But at the end, one of the things that we constantly do is little experiments that you can throw away in a few hours, or a day.....
**Johnny Boursiquot:** And he's usually wrong, right?
**David Hernandez:** Of course he is. \[laughter\] But I'm also 90% wrong, so it's also good...
**Mat Ryer:** Yeah. It's like argument-driven development.
**David Hernandez:** Yeah, pretty much.
**Mat Ryer:** Yeah, but it does serve a good purpose though. To be honest, when it comes to tech choices, I don't know that there were any of those kinds of frictions actually... But when it comes to things like abstractions, when we can see -- this is something that we talk about all the time... Basically, early abstr...
**David Hernandez:** A Mat abstraction killer... It's like, Mat told me "Oh, I've found this problem again and again, so we'll do an abstraction." No, Mat. No time for abstractions right now.
**Mat Ryer:** Yeah. Or ever.
**David Hernandez:** The next day he asks again; maybe he has a better chance to do it.
**Jon Calhoun:** Do you have an example of something that you recently went to do, that you decided to copy over?
**Mat Ryer:** It happens quite a lot in the frontend, because we have little bits of functionality that we find repeating again and again. One example is the waiters we have in the frontend. We should focus more on the Go side, I suppose, but let me just tell you this quickly... So you get like a spinner in the browser...
That feels like there should be an abstraction there; that's something we do again and again and again. But in practice, in code, it's just an integer and then a few places where you're increasing and decreasing things. So it would be more complicated if that was an abstraction, because then imagine looking at that and...
**David Hernandez:** In the backend it's security. We have a lot of code to check -- well, it's a product management tool, so you have orgs... So we have a check user has permission to write a message or a card in an org. Because the permissions are not very complex yet, we don't have a really clear abstraction for per...
**Mat Ryer:** \[16:32\] Yeah, so he's right, there's about ten lines of code almost at the start of every one of our service implementation methods that does the same things... And of course, a couple of times it'll break the rules. If we'd made an abstraction early, then the next time we needed it probably suddenly yo...
So yeah, it is kind of the most valuable lesson, I think. And the code feels bloated, doesn't it? When you look at the code and you keep seeing the same things repeated, we get a bit obsessed with wanting to dry that up, and I think that's worth resisting.
**Johnny Boursiquot:** Interesting how that plays into the flat folder hierarchy you've chosen to adopt... Because when you're thinking of abstractions, I think how your file system looks, how you have your folders and your files, and the naming - that also plays a role in how you think of your abstractions. So having ...
**Mat Ryer:** It's a great question. I actually think it all comes from that being a little bit allergic to these abstractions... Because we've done what everyone else has done, and junior developers will do, which is we've again and again built abstractions that were wrong, or we tried to structure - we put everything...
And actually, we've in the past just tied ourselves up in knots with this, and have difficulties with pulling out anything common into a different package, so that they can both then import, trying to solve that dependency, and avoid cyclic dependencies, and things like that. And it was quite a headache. And the only b...
I think it probably looks quite naive. A junior developer wouldn't do it like this because of how overly simplified it is... And we don't think it's necessarily gonna stay a completely flat structure forever necessarily; we just don't know what that structure should be yet, so we're waiting until that's more obvious be...
\[19:46\] It's not true for everything... Some things are just as a concept completely separate. But within our system, especially given the way that different things interact in any sort of sophisticated system, there are no clear lines between services; we just went for something simple and had basically public-facin...
**David Hernandez:** Yeah, the only time that we ask ourselves if this should be a package is when we think "Oh, is this something that potentially we can make open source and people contribute?" That's why when we start, "Oh, that should be an independent package that we use externally, so we can make it better, poten...
**Johnny Boursiquot:** So is that what led to Oto and outsourcing that? You saw this pattern emerge, or out of a desire to keep your frontend communication and your backend as simple as possible, you came up with Oto - I'm interested in diving into that a little bit, and understanding what makes Oto different from perh...
**Mat Ryer:** Yeah, that's a good question. The Oto project - the problem we had is we wanted to have the frontend in the browser communicate with the server. Naturally, in my history I've used mainly REST services and JSON services, and things over HTTP. And when we were looking at this, we started with gRPC, we start...
And the other thing with gRPC - because we wanted to generate our own code, we wanted to generate our own server stubs and clients for JavaScript and for Go, and other languages, we started to look at how to do that using gRPC, and essentially you have to build these plugin tools which themselves are very complicated, ...
**David Hernandez:** Yeah, it was funny, because the protobuffer definition - we were looking at it, and I'm saying to Mat "Oh, this looks a little bit like Go. If you remove some things and put some things, it's just exactly like interfaces, isn't it?" So what about if instead of using protobuffer we just use interfac...
\[24:07\] And the last thing is the browser is just JSON, so you can debug it with your usual tools, you can see what's coming in, what's coming out... So it's kind of a perfect fit for us, so we are quite happy with that little project.
**Johnny Boursiquot:** So you weren't trying to emulate gRPC, basically. You got some ideas from how it works, and you stole some ideas, some implementation details rather, and you sort of eschewed the whole binary format; you just went with plain JSON... You solved your problem, in a sense, rather than bringing in som...
**David Hernandez:** Yeah, stealing from open source is not really stealing, isn't it? It's just kind of Robin Hood wise isn't it?
**Johnny Boursiquot:** \[laughs\]
**Mat Ryer:** Yeah. I was gonna say, the thing about that is the Oto project gives you these templates for you to use, but actually the power is in your writing your own templates. That's actually the key point of it. Because we did do a JSON HTTP implementation, but actually there's no reason why that has to be the on...
Somebody wrote a Rust client template, for example, as part of the open source project. So yeah, it's about - solve just want you want, and also don't tie yourselves in... We didn't tie ourselves into anything. We can still use a binary protocol; we can do different things in dev and in prod, because we just control ev...
**Jon Calhoun:** This seems like a pretty common theme in Go - instead of looking for a library that does all these things, see if you can just build the small version that you need... And I think one area where it comes up is migration tools. If you need something to handle your database migration, if you're coming fr...
**Mat Ryer:** We did for our testing, because the way that we do testing is, again, kind of quite different, as a result of how we've been working for so long. But yeah, so we used the built-in Go tester for unit tests, but we have these integration tests which actually use the generated client that hit our real Oto en...
\[28:15\] I think the blog is probably the other one where we chose to roll our own way; you wouldn't expect that, I think, given there are tools like Hugo, which is kind of a static HTML site generator. If you can learn something like that, it's probably a great choice... But again, we wanted the full control, and our...
**Break:** \[28:57\]