Latest / Talk Python To Me / #43: Monitoring high performance Python apps at Opbeat
Transcript
- 0:00What does it take to track detailed analytics and errors from literally thousands of web
- 0:04applications at once? Could you build such a system entirely in Python? Answer is yes.
- 0:10And we'll hear from Ron Cohen from Opbeat about how they do it for Django, Flask,
- 0:15and even Node.js apps. This is episode 43, recorded January 13th, 2016.
- 0:21Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:50ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,
- 0:54where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,
- 0:59and follow the show on Twitter via at Talk Python. This episode is brought to you by Hired and SnapCI.
- 1:06Thank them for supporting the show on Twitter via at Hired underscore HQ and at SnapCI.
- 1:12Hey, everyone. Do you remember that t-shirt Kickstarter I did last summer to create a cool
- 1:18Talk Python To Me podcast t-shirt? It was super successful reaching its funding goal within
- 1:22just two hours. Well, the shirt is back. I've worked with our friends at pythongear.com to make
- 1:28the shirt available on demand for just $25. Visit talkpython.fm/shirt and get yourself one
- 1:36while they're hot. The proceeds support the show and the shirt helps spread the word about the podcast.
- 1:42Now let's get right to the conversation with Ron Cohen, the CTO and co-founder at OpBeat.
- 1:47Ron, welcome to the show.
- 1:49Thank you. Thank you so much, Michael.
- 1:51You're welcome. I'm a big fan of OpBeat, and I know you guys do a ton of stuff with Python.
- 1:55So it's going to be a really interesting conversation. And before we get into all that,
- 1:59though, as usual, how did you get started in programming in Python?
- 2:03I got started programming initially because one of my friends borrowed some books at the library.
- 2:09This is many, many years ago. And it was about the programming language,
- 2:14basic, as I'm sure a lot of people got started with basic. I immediately found it very intriguing to be
- 2:20able to tell a computer what to do and sort of interact with it. And my friend quickly lost interest,
- 2:25but I sort of kept going. And my dad was actually also programming and working as a programmer.
- 2:31So a lot of people think I got into programming because of him, but it turns out it actually was
- 2:38in spite of him also programming. And Python, the way I got started with Python was another buddy of mine
- 2:46who really thought I should take a look at this Django thing, this thing called Django.
- 2:51Because at the time I was working as a consultant doing web applications,
- 2:56and I had done web applications in Rails and PHP and all sorts of different languages and framework.
- 3:04But he really insisted that I try out Django. And then I had to learn Python to actually
- 3:08to work with Django. And I've pretty much stuck with it ever since.
- 3:12Oh, that's excellent. When was that? What time? What year?
- 3:15Oh, good question. I think it's like three or four years ago.
- 3:19Yeah, Django is excellent. Python is just such a fun programming language to work with.
- 3:25It's such a fun ecosystem. It's hard to not love it.
- 3:27Yeah, it really is. And so the thing I like about it is that it's so explicit.
- 3:33There's no surprises.
- 3:33Yeah, there's very few gotchas. You often hear about JavaScript gotchas
- 3:37and all the things you've got to be careful of. You don't typically hear about the Python gotchas.
- 3:41I love that.
- 3:42Yeah, JavaScript is interesting.
- 3:45Yes, it is. I'll ask you more about that later, actually.
- 3:48You like Python so much, you started a company called Opby, right?
- 3:51Yeah, yeah, exactly. So I helped start Opby with a friend.
- 3:54In the beginning, it was just me and him. He's called Rasmus.
- 3:57And we had been working as consultants building web applications for a while together.
- 4:03And every time we sort of built something, we found that we were also the people that ended up running it.
- 4:09So maintaining it and making sure that it actually worked.
- 4:12What we found there is that all the tools were sort of targeted people who were technical ops people.
- 4:18So ops people, basically.
- 4:20Developers just really think in a different way than ops people do.
- 4:24And they also need to know about different data.
- 4:29So we thought we'd build a product that helps developers operate their applications that they build that was targeted to developers directly.
- 4:38And that's how we sort of got started with Opby.
- 4:41At the time, I was really into Python.
- 4:42So, and I mean, I still am, obviously.
- 4:45So we started building in Django and Python.
- 4:49And today, it's pretty much all Python.
- 4:51That's awesome.
- 4:52So in sort of the whole back end of what you guys have going there, not just what plugs into the app, it's all Python, huh?
- 4:59Mostly Python, let's say.
- 5:00Yes.
- 5:01We started now doing, we started working on support for Node.
- 5:06So Node.js, because that's also a big opportunity for us.
- 5:11That's going to be really interesting to see how that goes.
- 5:13Yeah.
- 5:14I just saw today that you guys have a beta program that people can go sign up for.
- 5:18So that's cool.
- 5:19So let's talk about monitoring apps in general.
- 5:22You said there's sort of the infrastructure side of folks, and they have one set of things they want to know about.
- 5:28We've got the developers.
- 5:30And then also we've got this, you know, this growing sort of DevOps continuous delivery set of people that maybe have kind of a mix of those things.
- 5:39But what do people want to know about in their apps?
- 5:41Like what kinds of things can be tracked in applications like Opby, things like that?
- 5:46How does that all work?
- 5:46Right.
- 5:48So you're absolutely right.
- 5:49There are different sort of disciplines within this DevOps ideology or terminology or whatever you want to call it.
- 5:57So if we start with monitoring, that's really sort of focused on delivering actionable metrics for developers.
- 6:09And for us, that means that all the data that we give you, it has to sort of relate to your application.
- 6:14So it has to be something that you can use to improve the performance of your application.
- 6:18That means we don't deal with sort of the machines that your application runs on very much more sort of the code that you've written.
- 6:27And that's something we hear is really attractive to developers because that's sort of also their angle of attack, if you will.
- 6:36Basically, it all depends on the code and deals with the code.
- 6:40And things like response times for an application, that's, of course, really interesting.
- 6:46And then also sort of delivering it to developers in a way that they are used to think about stuff.
- 6:54So some tools deal with something called aptics, which isn't really a metric that people are very used to working with.
- 7:06It's probably something that ops people are more used to, or even just business people who need to deliver some kind of SLA.
- 7:12Developers are more familiar with averages and percentiles.
- 7:17So that's, for example, a choice we've picked instead of aptics.
- 7:22Then there's error logging.
- 7:23So there's a lot of ways that you can be logging errors.
- 7:28The most basic thing is write them to a file.
- 7:31A lot of people do that, and then they ship those lines in the file off to some service.
- 7:36And then they search through the lines of the files to see what kind of errors they had.
- 7:42And that's also, I feel like, something that caters to ops people more than developers.
- 7:47Developers are used to dealing with code.
- 7:50So when an error happens, they would really like to see a proper stack trace.
- 7:55They'd really like to get an email or get notified on a mobile phone that something is now broken.
- 8:01They don't want to just tail some log and sit there and watch it go by.
- 8:04They want detailed stuff that they can go back and actually track down the bug with.
- 8:08Not just knowing there's a problem, but all the details, right?
- 8:11Which maybe don't necessarily fit on a line in a log file.
- 8:14Exactly, exactly.
- 8:16And when you have the details sort of in a structured way, there's a lot of stuff you can do to make it more useful, more actionable.
- 8:23Yeah.
- 8:24Yeah.
- 8:25I guess you could say, like, what are the most common exception types?
- 8:28How many exceptions do we have per hour?
- 8:30Right?
- 8:31Yeah.
- 8:31Whose check-in has caused the most exception?
- 8:34Yeah.
- 8:35And we actually do that.
- 8:36Or we do something called automatic assignments.
- 8:39So, based on who checked in the code, we'll automatically assign that error to the person who checked in the code.
- 8:44That's awesome.
- 8:46Thanks.
- 8:47That's something you can only do if you have the data in a structured way.
- 8:50Yeah.
- 8:51Just one example.
- 8:53Yeah, yeah.
- 8:54I love the blame feature of source control.
- 8:58You can say, all right, this looks ridiculous.
- 8:59Who wrote this?
- 9:00And that's kind of the error equivalent of blame, right?
- 9:03Yeah.
- 9:04And it's, you know, it's not a good way to think about it, blame.
- 9:08But it's also not very effective for you to sit and work on something that someone else on your team knows much more about.
- 9:17Yeah, well, there's the negative way of looking at, like, blame, right?
- 9:21Whose fault is this?
- 9:22But then there's also the sort of the positive perspective of, like, whoever wrote that code and probably just checked it in, they're more likely to be able to quickly fix it, quickly go, oh, geez, yes, I understand.
- 9:34Let me do this, da-da-da-da-da, right?
- 9:36If you just give it to somebody out of the blue, go, here's a random problem with some app.
- 9:39You probably didn't write it, but fix it, right?
- 9:41That's much harder to get it fixed quickly.
- 9:43Yeah, absolutely.
- 9:44Absolutely.
- 9:44It's also about accountability in some sense.
- 9:47We can talk about it a little bit later.
- 9:48But in my experience, good developers, they like to be held accountable.
- 9:53So they like to know when they actually made a mistake.
- 9:55And this is sort of a way to complete the circle, if you will, after you write something.
- 10:02You will also be assigned to the errors that your code caused.
- 10:07Yeah, I think, especially when you're learning the program, when you're a fairly junior developer,
- 10:14the whole error handling, dealing with malformed data, unexpected things, and so on, that's much harder to get your head around.
- 10:23It's much easier, I think, to write the code so it's supposed to take this and it's supposed to do these things and it's done, right?
- 10:29Just like the happy path, if you will.
- 10:32But knowing to be aware of all these other errors, right?
- 10:36That's something that takes more experience, I think.
- 10:38And so if you can help catch those sooner and maybe learn those lessons sooner, that's also good.
- 10:43Yeah, absolutely.
- 10:44Nice.
- 10:45So you talked a little bit about performance and you talked about errors.
- 10:49You guys also talk about, like, deployment and workflow.
- 10:52What's the story of that?
- 10:52Right.
- 10:53Again, coming back to the DevOps paradigm, if you will, what we found is that developers now are more and more empowered to deploy their own code whenever they feel like it's finished.
- 11:06And whenever the CI tests pass, it's usually the case nowadays that developers actually have the power to deploy their code.
- 11:15Now, that's really cool.
- 11:17But it also means that it can get pretty difficult to figure out what was actually deployed at what time.
- 11:21Because you probably used to have an ops department that would make a little note in a changelog somewhere to sort of keep track of what was deployed.
- 11:31But developers don't really do that.
- 11:33So we help them do that by what we call release tracking, which is basically a list of releases.
- 11:40And each item in the list will contain the commits that went into a specific release.
- 11:45That makes it really easy for you to go back and see exactly what you deployed at what time.
- 11:49Yeah.
- 11:50So maybe you can link those back to a series of GitHub issues that have been closed or something like that, right?
- 11:55Yeah, exactly.
- 11:57Or errors that started happening after a specific release, etc.
- 12:01Yeah, it's another sort of case where the tools and the sort of workflows that you used to have don't really fit anymore.
- 12:11And that's why we did this release tracking.
- 12:14Yeah, that's really cool.
- 12:15I mean, it definitely ties together with continuous integration and continuous delivery and services that companies like SnapCI and those guys build, right?
- 12:25To sort of do the checking before it goes out.
- 12:28But you guys are kind of on the other end, right?
- 12:30Once it hits production, if something happens, you can sort of say, after this release, these errors started happening.
- 12:37Is that right?
- 12:38Yeah, yeah, exactly.
- 12:39And CI is obviously still a really important part of the modern workflow.
- 12:45And yeah, it's definitely not a replacement.
- 12:49Yeah, absolutely.
- 12:50But, you know, the thing is, there's the unit test you write and the scenarios you test for and look for.
- 12:57And then there's the real world, right?
- 13:00Yeah, absolutely.
- 13:01You know, no matter how good your CI system is or your tests are, chances are on some major application, there's something happening that's going to happen that you just didn't account for.
- 13:13Like, why are there browsers on my page that have no user agent?
- 13:17I didn't plan for this, right?
- 13:18You know, just weird stuff like that, right?
- 13:20This episode is brought to you by Hired.
- 13:33Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.
- 13:38Each offer you receive has salary and equity presented right up front, and you can view the offers to accept or reject them before you even talk to the company.
- 13:46Typically, candidates receive five or more offers within the first week, and there are no obligations, ever.
- 13:51Sounds awesome, doesn't it?
- 13:53Well, did I mention the signing bonus?
- 13:55Everyone who accepts a job from Hired gets a $1,000 signing bonus.
- 13:58And as Talk Python listeners, it gets way sweeter.
- 14:01Use the link Hired.com slash Talk Python To Me, and Hired will double the signing bonus to $2,000.
- 14:06Opportunity's knocking.
- 14:09Visit Hired.com slash Talk Python To Me and answer the call.
- 14:12Yeah, absolutely.
- 14:19And it turns out that users are really creative in what they will enter into a form, and you basically have no chance to guess what all the different scenarios are going to be.
- 14:29Yeah, yeah, absolutely.
- 14:31So right now you guys support Django, and that's where you started.
- 14:34And recently you added Flask support, and you also are about to add node support, or you're beta testing it.
- 14:41What about other apps?
- 14:42Like a lot of the apps that I work on, the web apps, are pyramid apps.
- 14:47Is there a way to add tracking to apps that are not one of those three?
- 14:52Yes, there is, actually.
- 14:53And we've not been very good at documenting this, but the Upbeat module has a very simple API, and it comes down to calling begin transaction whenever you sort of start a new request or a background job starts.
- 15:07And then you call end transaction whenever you've sent back the response or your background task has finished.
- 15:15And the Upbeat module will automatically pick up all the information it needs in between those.
- 15:20That's performance metrics, performance monitoring.
- 15:23And error logging, usually there's a way to look into the framework's sort of unhandled exception signal or something like that.
- 15:31So it should definitely be doable.
- 15:34We just haven't really had the time to look at it yet.
- 15:37Okay, that's interesting.
- 15:39So if I was able to sort of trigger like a bit, like do a begin transaction and an end transaction, all the calls I'm making, say, to SQLAlchemy or out to other web services, those would get tracked?
- 15:50Actually, what you need to do is just call begin transaction whenever your request starts.
- 15:56And we already instrument most of the modules you use, I hope.
- 16:01So that data should automatically show up, actually.
- 16:03What you need, yeah, the only thing you need to do is call begin transaction when the request starts and then end transaction when the request ends, the web request, let's say.
- 16:11Oh, sweet.
- 16:12Well, I may have to go play with this after.
- 16:14Cool.
- 16:14Let me know how it goes.
- 16:16Yeah, very cool.
- 16:17So what's the craziest sort of monitoring example you've seen?
- 16:22Like there's got to be some company or some piece of software that's just done something way crazier than you've expected.
- 16:32That's a really good question.
- 16:33Well, I can tell you the first time your main database server just drops off the face of the net.
- 16:39It's a very unpleasant experience.
- 16:43But that was a bit of a rough night.
- 16:46We had to fail over to the replica database and the site was down while we did it.
- 16:52So we did it pretty quickly.
- 16:54I would say it was like 15 minutes, but it was still not a very nice experience.
- 16:59Yeah, I guess so.
- 17:00Because, I mean, you guys are running real-time data collection from many potentially popular apps.
- 17:06And so you're sort of, you guys must have a lot of load, a lot of requests, huh?
- 17:11Yeah, yeah.
- 17:12We have quite a lot of load, quite a lot of requests.
- 17:15If we're down, then people will get us a little notification in their log whenever they try to send something to us.
- 17:20And that's really not cool, right?
- 17:23You want your monitoring service to be up all the time.
- 17:26Otherwise, it's sort of useless.
- 17:28So we spent a lot of time trying to make sure that we can't go down.
- 17:33And so what we recently did was we changed it so that we should still be able to receive data, even if the main database server is down.
- 17:41So that data is just going to keep being accepted by us.
- 17:44And then whenever the server is back up, it'll start processing the data.
- 17:48What infrastructure are you guys running on?
- 17:51Is it like Amazon Web Services or something else?
- 17:54Yeah.
- 17:54Yeah, so it's all Amazon Web Services.
- 17:56We've set it up ourselves.
- 17:58So it runs on EC2.
- 18:00We don't use too many of the sort of Amazon services on top of it.
- 18:04We use a bit of S3, but mostly EC2.
- 18:07Yeah, EC2, S3.
- 18:09Those are the main ones, right?
- 18:10Yeah, exactly.
- 18:11You talked about performance and collecting data, even if it can't necessarily be processed.
- 18:18And one of the really nice ways to do that is to add some sort of queue, asynchronous queuing mechanism to the whole process, right?
- 18:26Yeah, exactly.
- 18:27And we do that a lot.
- 18:29So whenever some data comes in, it immediately gets put into a queue.
- 18:32We use RabbitMQ, which is a very, very powerful software.
- 18:36That gives us a lot of freedom in scaling out, handling failures, et cetera.
- 18:42Right, because it's much easier to keep a queue alive than maybe a complex database where the schema could change and it can no longer insert into it or something like this, right?
- 18:51Yeah, exactly.
- 18:54Maybe talk me through what pieces are involved.
- 18:57What does it look like from some web app external to you guys sending some piece of data until it actually gets totally stored in some database?
- 19:07Right.
- 19:08So we have a separate service called the intake, which is responsible for basically accepting data and put it into a queue.
- 19:15It's also what does authentication and authorization of the data.
- 19:22So whenever data comes in, we need to make sure that it has the right tokens, et cetera.
- 19:26We also rate limit you there.
- 19:29So if you send us a lot of data, we will rate limit you right there.
- 19:34We need to validate that the structure of the data is actually correct.
- 19:39So we also do that.
- 19:41And then we put it into a queue.
- 19:43So that service is very sort of simple in the sense that it just needs to accept the data and put it into a queue.
- 19:50And that makes it easier for us to scale up when we have a lot of data coming in.
- 19:56Yeah, but it's almost stateless, right?
- 19:58Other than knowing the authorization part, it's like entirely stateless, right?
- 20:02Yeah, exactly, exactly.
- 20:04So a lot of the, you know, we can cache the authentication stuff really heavily.
- 20:09And it's also a very resilient interface of failures because it's read-only from the database, like the authentication stuff.
- 20:17It just needs to be able to put data into a queue.
- 20:21Yeah, excellent.
- 20:22So then there's something else that gets the data back out and really does the processing, right?
- 20:25Right.
- 20:26So we have a separate service that pulls the data out and then processes it.
- 20:29And that's also very convenient for us because it means that we can scale that out very easily.
- 20:36We have more freedom in sort of, let's say, we need to do some maintenance.
- 20:39We can stop that for a short period of time and then keep going.
- 20:44And things will just be in the queue for waiting for us to process them.
- 20:47Yeah, I think queues are somewhat underused.
- 20:50They're so easy to use, and yet they provide so much architectural flexibility and response time flexibility and so on.
- 20:58And even as you say, sort of like a deployment infrastructure management perspective, like long as you don't read things offline until the queues can't take anymore, then you're kind of golden, right?
- 21:07Yeah, yeah.
- 21:08We do have some requirements for processing time.
- 21:11So we can't leave stuff around forever, but it does give us a lot of flexibility in switching out things while everything is running.
- 21:19So that's great.
- 21:20And I agree on the point that queues are undervalued and also probably not that well understood in the best majority of developers.
- 21:28There's also some, as you mentioned, architectural benefits.
- 21:31It sort of forces you to decouple a lot of systems, which is always a good thing.
- 21:37Yeah, you know, there's a lot of talk about microservices and building more smaller pieces of software and putting a queue in between those two pieces makes it real easy rather than having a monolithic thing that does all the intake, all the processing, all the reporting, and on and on and on, right?
- 21:52Yeah, absolutely.
- 21:52And there's also a pattern emerging where people use the queue as a sort of bus to talk between the services.
- 22:00So it basically becomes a sort of communication medium instead of, for example, using HTTP, people will put a request in the queue and then expect a response on some other queue.
- 22:14And that's also quite useful because it gives you some additional architectural advantages when it comes to timeouts and things like these.
- 22:25Yeah, that's really cool.
- 22:26All right, so I have a big question for you.
- 22:28Hit me.
- 22:29Python 2 or Python 3?
- 22:30Python 3 for the sake of progress.
- 22:33Oh, beautiful, beautiful.
- 22:35I know a lot of people are on Python 2, but any chance we can get to kind of move forward, we should take that chance, right?
- 22:40Yeah, I agree.
- 22:42It's a bit of a cost that we have to pay now, sort of upfront, but it's the right thing to do, in my opinion.
- 22:49Yeah, excellent.
- 22:50I agree.
- 22:50A lot of the systems that people are writing that are kind of in the realm of what you guys are doing, they're maybe choosing languages like Go and Rust.
- 23:01Do you know sort of what the advantages of those are, like what the disadvantages are?
- 23:07Have you guys considered those?
- 23:08Not that I'm necessarily encouraging you to do so, but I know a lot of people are thinking about that.
- 23:14Yeah.
- 23:14So I've written some Go and a little bit of Rust, and I think they're really interesting.
- 23:20I think what still is very clear to me is that Python helps me get things done very quickly and with very little code in a very robust way.
- 23:29If we start with Go, for example, I think Go is mostly interesting in the way that concurrency works in Go.
- 23:36I think the main reason why you would write something in Go instead of Python is the concurrency primitives that exist in Go.
- 23:43So Python has a really sad concurrency story, in my opinion.
- 23:48And usually, like if you do Django, it's not a big problem.
- 23:53But as soon as you have to write a service that talks to the outside world and you want to talk to many different web services at the same time or something like that, then that becomes kind of difficult in Python.
- 24:03And it basically comes down to the event loop, in my opinion.
- 24:06Go is sort of built on top of an event loop that is seamless to you when you program.
- 24:13Getting an event loop into Python usually involves some kind of monkey patching, for example, with g event or some really sort of strange, at least if you're coming from the Python world, some strange modifications that you must make to your application to get this kind of event loop concurrency.
- 24:31And then there's Rust, which I think is also super interesting.
- 24:35It has a much more interesting type system than Go.
- 24:38But at the same time, the Rust feels more like a replacement for C++.
- 24:42So some of the things that you will typically use Python for, it also makes sense to use Go for.
- 24:50But I would say Rust is in a different category.
- 24:52And I feel like a lot of people are comparing.
- 24:54So there was recently a lot of people talking about if they should use Go or Rust.
- 24:59But in my opinion, they are applicable to different use cases.
- 25:02So Rust is more low level.
- 25:04You have to deal with memory management yourself.
- 25:07And that's important.
- 25:08But it's sort of other sorts of applications that you write in Rust than it is Go and Python.
- 25:14I see it almost more as a replacement for things like, I would have done this in C.
- 25:18So now I'll do it in one of these languages.
- 25:20But that could just be my lack of experience with them, right?
- 25:24No, I think you're right.
- 25:25Especially when it comes to Rust.
- 25:26I think Go is somewhere in between.
- 25:28It's aesthetically typed.
- 25:30It feels a lot more high level, I would say, than C or Rust.
- 25:54SnapCI for sponsoring this episode by trying them for free at snap.ci.
- 26:00simply do a git push and they auto detect and run all the necessary tests through their multi-stage
- 26:05pipelines. Something fails, you can even debug it directly in the browser. With a one-click
- 26:10deployment that you can do from your desk or from 30,000 feet in the air, Snap offers flexibility
- 26:15and ease of mind. Imagine all the time you'll save. Thanks SnapCI for sponsoring this episode
- 26:21by trying them for free at snap.ci slash talkpython.
- 26:25So let's talk about shipping software a little bit more. Yes. You said you had some recommendations
- 26:41for sort of how to make your team a high-performance shipping machine. What's the story there?
- 26:45Right. My role here at Upbeat has transitioned from coding every day to more and more trying to get my
- 26:55team to be efficient managing, if you will. And along that path, different things sort of became
- 27:01clear. Yeah, there's some different things that you should be aware of, I think, when you are managing
- 27:08a team of developers or even if you're just a single developer building applications, especially for
- 27:14the web. That's sort of what we've been focusing on, building applications that live on the internet.
- 27:19That's really interesting. You know, I think a lot of people who are working by themselves
- 27:25don't necessarily adopt some of the sort of what you would think of as best practices and tooling that
- 27:30maybe teams would automatically adopt. Things like continuous integration, things like, you know,
- 27:36sometimes even source control. But, you know, things like application monitoring and so on.
- 27:42So you think even if there's one person working on a project, maybe you should put this stuff in place?
- 27:47Yeah, absolutely. Absolutely. Especially like things like CI. I think you should definitely
- 27:52have CI even if you're just a one person team.
- 27:55So if I have like my files on the hard drive and I just zip them up periodically and put a date on it,
- 28:00that's probably not enough?
- 28:01I've seen that by the way.
- 28:05I've seen that before.
- 28:08No, really, that's not. Okay. Well, let's talk about first source control.
- 28:12Yeah. Oh, that's horrible.
- 28:14It's been a few years, but still.
- 28:16Right.
- 28:18So maybe you could make it concrete. Like, what do you guys do to ship software like
- 28:22at Opby to sort of push out new versions and so on?
- 28:26Yeah. Good question.
- 28:26So one of the things we really focus on is getting things shipped early in the sense that
- 28:32whenever there's something that is an improvement to what we have today, we'll generally try to ship it.
- 28:38And what typically happens when you are sitting and programming and working on some feature is that
- 28:45you sort of got started on this feature and it's going well, but your feature relies on something else.
- 28:50depends on some other code and you sort of take a peek into that code and it feels really sort of,
- 28:57it has some of those bad code smells that we as developers are familiar with and are sort of trained to recognize.
- 29:04So you consider whether you should just quickly refactor that other thing that your feature is going to depend on.
- 29:11What usually ends up happening is that you end up actually spending time both working on your feature
- 29:17and refactoring that other thing that you found.
- 29:20And then that thing relies on some third thing and you think, oh, well, I made it.
- 29:26I might as well just refactor that thing too.
- 29:28And then it ends up being a huge release when you finally get it shipped.
- 29:31And that's sort of a big red flag for us.
- 29:34Big releases are a problem.
- 29:36They're a problem for multiple reasons.
- 29:38First of all, they are much more cumbersome to review.
- 29:42So everything we do gets peer reviewed.
- 29:45And if you have a big release, that just takes much more time.
- 29:47And it's much harder to get an overview over the impact of this particular release when it's huge.
- 29:53And it also takes much more time before your stuff actually comes out to the users.
- 29:59The sad thing about that is that we know as developers that, you know,
- 30:03you can think of a lot of scenarios on how you have some idea about how your users are going to use a specific feature.
- 30:10And you obviously think that the feature is really valuable to them.
- 30:14But it turns out that our assumptions are often wrong about this kind of stuff.
- 30:18So getting new features into the hands of users is really important because then you will learn how they are actually going to use it.
- 30:25It's really hard to predict what people will find valuable, what they won't.
- 30:29Yeah, exactly.
- 30:30Like you said, how they're going to use it.
- 30:32Speed is an advantage in the software business, right?
- 30:36Yeah.
- 30:36Small releases actually give you a lot of speed, in my opinion.
- 30:41There's also the things like when something breaks.
- 30:44If you have just released a huge change, it's really difficult to figure out what part of that change actually made things break.
- 30:53But if you're releasing small releases all the time, it's much, much easier to go back and see exactly what caused a specific problem.
- 31:00So we're huge proponents of small incremental releases at Upbeat.
- 31:04And it's something to reiterate on, sort of talk about often.
- 31:08The other side of that story is if everything you are releasing is a small little feature or a small piece and something goes wrong, it's pretty painless to just say, whoops, we're just going to roll it back to the way it was before.
- 31:21Yeah, yeah, exactly.
- 31:22But if you've had to do some massive database migration to like roll out a huge new thing and then you're kind of stuck, right?
- 31:29Not only is it speed going forward, it also enables you to go, oh, no, roll it back, roll it back.
- 31:34Hopefully nobody saw that.
- 31:35Yeah.
- 31:37Another thing that is really useful when you're building applications is to make sure you try to break down silos.
- 31:45For us, that means that getting something shipped is a sort of cross-discipline process.
- 31:52We have a product designer that works with a visual designer that works with a developer and finally with marketing.
- 32:00And that means everybody is sort of aligned on shipping this feature.
- 32:06Of course, there's a lot of talk about DevOps, which one of the points there is that your operations people should be aligned or should have the same goals as developers.
- 32:17And that makes for a much better process and a much nicer product in the end.
- 32:23That's really interesting.
- 32:24That's really interesting.
- 32:24So, you know, I used to, I feel like teams used to be structured horizontally, like here's the data guys.
- 32:30Here's the middle tier service guys.
- 32:33Here's the front end people, right?
- 32:35Yeah.
- 32:36That doesn't seem like a great workflow.
- 32:38So you're saying a vertical slice through that is a much better way to group people and features and work, right?
- 32:45Yeah, exactly.
- 32:45And even including the marketing people and designers and product designers in that slice so that you have like a wide range of capabilities on a specific team or aligned together to ship a feature.
- 33:02My point was that, you know, people talk about DevOps, but really we should be talking about collaboration between all the sort of different roles or disciplines that are involved in shipping a feature.
- 33:14So DevOps, the collaboration between ops and developers is just the very start.
- 33:20You should have marketing and product design, et cetera, in there as well.
- 33:25Yeah.
- 33:25So you're proposing like a DevOps mark prod team.
- 33:29So it's going to be a new password.
- 33:32But I think you're right.
- 33:34That makes a lot of sense.
- 33:35And it's really easy as software people to forget once you write the software, unless you have a very established business,
- 33:43or you're writing internal software.
- 33:45That's only part of it, right?
- 33:46You've got to have a marketing effort and a product development.
- 33:49Like you said, it's a whole team effort and software is only part of it.
- 33:52Yeah, exactly.
- 33:54Another thing that's important for us when we ship code is that the person who wrote the code is also the person who actually presses the button to get that code into production.
- 34:03That's something we've insisted on from the very beginning, because that means that if something breaks, that developer who wrote the code will be around to fix it.
- 34:09So he didn't go home.
- 34:10And the developer who actually presses the button knows exactly what code is going to go out.
- 34:16And it's basically about accountability.
- 34:18So you want to make sure that the developers that you're working with and that you also understand that if you've built something, so you've written some code, you're the person who ships it.
- 34:28And then if it breaks, you're the person who fixes it.
- 34:30That's something we've really sort of been adamant about from the very beginning.
- 34:35And it seems to work very well.
- 34:36Yeah, I think that's great advice.
- 34:37You know, there's always on teams people who embrace things like continuous integration that you just have seen more, and there's people who embrace it, let's say, less.
- 34:46But making everyone be actively part of the shipping puts the accountability on them, which means maybe they'll rely on the process a little more.
- 34:56Maybe they will run those tests before they send it out, right?
- 34:59Something like this.
- 35:00Exactly, exactly.
- 35:01Let me ask you a few more questions.
- 35:03We'll kind of get into the end of the show here.
- 35:05What's your favorite editor?
- 35:08If you're going to write some Python code, what do you open up?
- 35:10These days, it's actually mostly PyCharm.
- 35:14I found it to be really useful, and it has a lot of interesting features.
- 35:19It helps me find the stuff that I need very easily.
- 35:22It's a bit heavy, but I still feel like the JetBrains people have spent a lot of time making it fast.
- 35:29So I'm pretty happy with PyCharm.
- 35:32Yeah, that's cool.
- 35:33Like I've said a bunch of times on the show,
- 35:35that's the one I use as well.
- 35:36And like you said, it's a bit heavy.
- 35:38But if you're willing to wait five seconds, the whole next few hours are a lot nicer.
- 35:42So that's worth five seconds in my opinion.
- 35:46That's awesome.
- 35:46I agree.
- 35:47And there's thousands and thousands of packages out there that you can use in Python.
- 35:52What are some of the ones that maybe not everyone knows about that you're like, oh, this thing is awesome.
- 35:56You should know about X.
- 35:58Oh, good question.
- 35:59Of course, I'm going to have to say the upbeat module.
- 36:02But apart from that, some of the modules we've used that are really useful are, for example, something called dog opt, which is a way to...
- 36:13It basically helps you write command line applications.
- 36:16And it helps you parse command line arguments.
- 36:18And the way it works is opposite of how all the other ones work.
- 36:21So in here, you actually write your usage document.
- 36:26So the stuff that comes out when you do dash H.
- 36:29And then it'll parse that.
- 36:30And from that, it'll know how to parse the arguments to the application.
- 36:34So that's really useful, in my opinion.
- 36:37The modules that come with Python, opt-parse, and arg-parse are really not very good, in my opinion.
- 36:44Yeah, that's a really cool package.
- 36:46I've heard of that one before.
- 36:48And what surprised me was that there's actually a specification for the way that you write that help documentation that's, like, well-structured.
- 36:56And so this thing just looks at that and builds the actual command line for you, right?
- 37:00Oh, yeah.
- 37:00Exactly.
- 37:01Man, that's really awesome.
- 37:02Yeah.
- 37:03I think some other things that we're using is requests is always a good module.
- 37:09Yeah.
- 37:10I'm sure most people know that.
- 37:12Request is amazing.
- 37:13You can't get away without requests, right?
- 37:15Right.
- 37:15Exactly.
- 37:16All right, Ron.
- 37:18So how about a final call to action?
- 37:20How do people get started with Upbeat?
- 37:22What should they do?
- 37:23It's really easy to get started with Upbeat.
- 37:25You go to Upbeat.com and you sign up, create your first Django application or Flask application, and the instructions are right there.
- 37:33It takes, like, five minutes to set up, probably.
- 37:35And it's free to get started.
- 37:36Everyone can go and check it out.
- 37:38Please let us know if you run into any issues or get any feedback.
- 37:41We're always trying to improve it.
- 37:43So, yeah, looking forward to hearing the feedback.
- 37:46All right, very cool.
- 37:48Thanks for the look inside of what you guys are doing there.
- 37:50There's a lot of cool stuff happening at Upbeat.
- 37:52Thanks for having me, Michael.
- 37:53Yeah, you bet.
- 37:54Thanks for the advice on shipping software.
- 37:55That's great.
- 37:56Talk to you later.
- 37:57Bye.
- 37:57Bye.
- 37:57Bye.
- 37:58Bye.
- 37:58This has been another episode of Talk Python To Me.
- 38:01Today's guest was Ron Cohen, and this episode has been sponsored by Hired and SnapCI.
- 38:05Thank you guys for supporting the show.
- 38:07Hired wants to help you find your next big thing.
- 38:10Visit Hired.com slash Talk Python To Me to get five or more offers with salary and equity
- 38:15presented right up front and a special listener signing bonus of $2,000.
- 38:19SnapCI is modern, continuous integration and delivery.
- 38:24Build, test, and deploy your code directly from GitHub, all in your browser with debugging,
- 38:29Docker, and parallelism included.
- 38:31Try them for free at snap.ci slash Talk Python.
- 38:34You can find the links from today's show at talkpython.fm/episodes slash show slash 43.
- 38:41Be sure to subscribe to the show.
- 38:44Open your favorite podcatcher and search for Python.
- 38:46We should be right at the top.
- 38:47You can also find the iTunes and direct RSS feeds in the footer of the website.
- 38:52And don't forget to check out the podcast t-shirt at talkpython.fm/shirt.
- 38:57Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 39:02You can hear the entire song on our website.
- 39:05This is your host, Michael Kennedy.
- 39:06As always, thank you so much for listening.
- 39:09Smix, take us out of here.
- 39:11Stay tuned.