0:00:00- Welcome to Under the Radar,
0:00:01a show about independent iOS app development.
0:00:04I'm Marco Armet.
0:00:05- And I'm David Smith.
0:00:06Under the Radar is never longer than 30 minutes,
0:00:08so let's get started.
0:00:10So today we are going to, I guess,
0:00:12have our third Q&A that we've ever done,
0:00:15a follow-up to the one we did last week.
0:00:17Got a lot of great questions that came in from that,
0:00:20you know, since we recorded that episode,
0:00:23and I think it was really, it's a good time
0:00:24to talk through some of these things.
0:00:26I think this is always an awkward time
0:00:29for in-apple developer land,
0:00:30because this is the quiet period before WWDC,
0:00:32and then in the summer, things will pick up dramatically,
0:00:34and there'll be a lot more topical and interesting things.
0:00:38But it's also really interesting for me
0:00:39just to hear from listeners of the show
0:00:42and the kind of topics and things that you're interested in,
0:00:44because as creators of something like a podcast,
0:00:47it's very often, you know,
0:00:50it can often be somewhat one way,
0:00:52and so it's really nice to just hear
0:00:54what you guys are interested in hearing us talk about,
0:00:56and so that's really useful.
0:00:58So we're gonna do another one of those this week.
0:01:01So our first question comes from Rick,
0:01:04who asks, "What does your app's
0:01:06server infrastructure look like?"
0:01:08And I think we're gonna answer this question
0:01:09slightly more broadly, just like in general,
0:01:11having a kind of a high-level talk
0:01:13about the way we do servers.
0:01:16It was a question that was asked by many other people
0:01:17if we didn't happen to pick your question, apologies,
0:01:20but we had a lot of general questions
0:01:21about like how do we structure our servers,
0:01:24how do we kind of, strategies and things
0:01:26that we take for that.
0:01:28Maybe getting into backups and scalability and so on.
0:01:31Like there's lots of questions about that,
0:01:32and I think getting into the specifics,
0:01:35like the specific specifics,
0:01:37is probably not particularly helpful.
0:01:39I mean, I think there's something to be said for,
0:01:41you know, the nature of any server infrastructure you create
0:01:45is that it is immediately sort of obsolete and outdated,
0:01:50in the sense that I'm sure there's a better,
0:01:52you know, at the low level,
0:01:55there's probably always a better approach
0:01:56or something, some new hotness
0:01:57that people would recommend or say,
0:01:59oh, we're doing this wrong or this wrong.
0:02:01Or even just in general,
0:02:02that there's a lot of kind of these opinions about,
0:02:06well, this is the way that I do it,
0:02:07this is the way that you should do it, and so on.
0:02:09So I think in general,
0:02:10rather than talking about the actual specific details
0:02:12of like I use this version of this package
0:02:15to manage my servers, or I use this library for this,
0:02:18or you know, this web host,
0:02:19it's like this is at a high level,
0:02:22what we have found, I think, to work well.
0:02:24And I think that is useful
0:02:25and probably much more constructive,
0:02:27and then the details in your specific installation will vary.
0:02:31So for me, I have a variety of different servers
0:02:35that I manage as part of my work.
0:02:36I think I have four apps that have server backends to them.
0:02:41The biggest one for me is Feed Wrangler,
0:02:43which is my RSS syncing platform.
0:02:45And so I'll talk about that one probably in depth,
0:02:46because it's sort of the superset of everything else.
0:02:49So I host it with a Linode VPS or a series of those.
0:02:56In front of those,
0:02:57like starting out from the client and working back,
0:02:59I have a, I guess it's like a proxy, we call it,
0:03:04or a load balancer out in the front.
0:03:07Requests go to there.
0:03:08They then go to a variety of web servers.
0:03:10I always have at least three,
0:03:12because then if one goes down,
0:03:14or I need to take one down for maintenance,
0:03:16then there's at least two others.
0:03:18And so then you're not falling down
0:03:20to just one at any one time.
0:03:23So I go out to three.
0:03:24I have a main database server.
0:03:26I have a variety of utility servers.
0:03:28For an RSS syncing system,
0:03:29you have a lot of scrapers and things that are,
0:03:32these sort of task-based systems
0:03:34that are being spun up and spun down all the time.
0:03:37So I have a couple of utility servers,
0:03:40which I have a memcache server
0:03:42that's just basically just sitting there
0:03:43to be a big pile of memory to do basic caching.
0:03:46And I think that's it.
0:03:49That's sort of at a high level,
0:03:50the way that I structure things.
0:03:52I do backups at multiple levels.
0:03:54I have a continuous backup of my main database
0:03:59that is always running,
0:04:00that is just sort of doing this binary log streaming version
0:04:03of that to take all of the data in real time
0:04:07and doing a backup,
0:04:08as well as taking advantage of a variety
0:04:10of other kind of more snapshot-based snapshots.
0:04:14So if, for whatever reason,
0:04:15my binary logs or things got corrupted,
0:04:17I can fall back to a less precise snapshot
0:04:22for a particular point in time.
0:04:24That's sort of my general approach.
0:04:25- You know, I've done servers big and small,
0:04:29and at a high level,
0:04:32the biggest piece of advice I can give anybody
0:04:35when doing server work,
0:04:37especially in the context of iOS apps,
0:04:38where your job is not to be the coolest server developer
0:04:41in the world, your job is to make an app
0:04:42that happens to include a server as part of how it works.
0:04:45My best advice I can possibly give
0:04:48is to have your server side stack be as boring
0:04:51and established as possible.
0:04:53And you never wanna be on the cutting edge
0:04:56of anything server side, like anything,
0:04:59the software, the hardware, anything.
0:05:02You want to be as boring as possible.
0:05:04So this means using tools in your stack
0:05:08that have been around for a while,
0:05:09that are well understood,
0:05:11that other people are using,
0:05:13way more people than you are using at scale,
0:05:16and so everyone else can run into the bugs
0:05:19who's on the cutting edge.
0:05:20Let them fix things, let them patch things,
0:05:23let them find the limits and fix them,
0:05:25or at least document them.
0:05:26You should not be doing that on your server
0:05:28because you can't afford the time.
0:05:31Simple as that, that's a whole different thing
0:05:34that honestly I think nobody should be doing.
0:05:36But if you, maybe if your entire career
0:05:40is gonna be cutting edge server side stuff,
0:05:43maybe you can consider it then,
0:05:44but in the context of what listeners of this show
0:05:47are doing and need to do,
0:05:49and the context of what I've always needed to do,
0:05:51boring established server side stacks are best.
0:05:54So in my case I use PHP,
0:05:57which is pretty much the definition
0:05:59of boring established and battle tested,
0:06:01and I use MySQL for the database,
0:06:04which again, boring established tested.
0:06:06Google and Facebook use tools like this,
0:06:09and if they don't run into problems with it,
0:06:12I know I won't run into problems with it,
0:06:14or at least any problem I run into will be well documented,
0:06:17will have tons of people online.
0:06:19If you search for it, if you run into a problem,
0:06:21you can figure out a way around it,
0:06:22or you can figure out what you're doing wrong.
0:06:24Anything cutting edge is gonna have problems with this,
0:06:27'cause it's just newer.
0:06:28There's less help, it's moving more quickly,
0:06:31it's changing more quickly, it's gonna be less stable,
0:06:33just by definition of being newer,
0:06:35and so keep things boring and old and stable.
0:06:39Other than that, I structure things similarly.
0:06:42I have a load balancer through our sponsor this week,
0:06:45Linode actually, I use their node balancer
0:06:47in front of things now.
0:06:48I do software load balancers, things like HAProxy,
0:06:51but I just don't need them anymore.
0:06:53I have web servers behind that, all hitting databases,
0:06:57and then a couple of servers that are neither web servers
0:07:01nor databases that are just doing other app related tasks,
0:07:04things like crawling or processing or generating backups
0:07:07or things like that.
0:07:08That's about it.
0:07:09Again, it's not something you should really be overthinking
0:07:13or overdesigning.
0:07:14I wouldn't suggest doing anything that requires
0:07:18fancy scaling things like, say, database sharding,
0:07:21for instance, is one thing that I've found
0:07:23is almost never worth doing for almost anybody
0:07:25until you get to a very, very large scale.
0:07:29Crazy kind of distributed tools, things like Cassandra,
0:07:32really usually not necessary for anybody operating
0:07:35at our scale or even much bigger than our scale.
0:07:39If you use boring things like MySQL or Postgres,
0:07:43if you use them well and properly,
0:07:47you can get very, very far with them
0:07:49without going to anything crazier.
0:07:51Keep it simple, keep it old, keep it boring,
0:07:53because you gotta keep in mind,
0:07:55your job is to make this app that you're making
0:07:59or to make this service that you're making.
0:08:00Nobody cares how fancy your server-side stuff is,
0:08:04and if you're working by yourself
0:08:07or with a small group of people and listening to this show,
0:08:10no matter what you think, you are not at the scale
0:08:12where you need to be using cutting edge
0:08:15or less commonly used things.
0:08:17You're just not.
0:08:19Google AdWords ran on MySQL for a very long time,
0:08:22long after all of us heard of it and started using it.
0:08:25Twitter ran on MySQL until, I think,
0:08:28at least about 2009 or so, and probably even past that.
0:08:33Facebook used PHP until they kind of developed
0:08:37their own weird offshoot of it.
0:08:40Wikipedia still uses PHP.
0:08:42These are tools that, anything that you think,
0:08:45X or Y doesn't scale, if you've heard that
0:08:47or if you think that, you're probably not right
0:08:50about that here, like, almost everything scales
0:08:53if you learn how to use it responsibly.
0:08:56The only thing I would also say about that, if possible,
0:08:59is to basically make all of your requests stateless
0:09:03so that any request can go to any server
0:09:07and it still works just fine.
0:09:08So basically, that doesn't take that much
0:09:11to avoid just avoiding session state, basically,
0:09:14being stored server-side.
0:09:16That's about all you need for that.
0:09:18And be very, very careful when going to database
0:09:22replication setups, where you'd have kind of like
0:09:25a master-slave kind of setup.
0:09:27I use those, I use them a lot.
0:09:30They are extraordinarily prone to weird caching bugs
0:09:35if you're not careful.
0:09:37And I've built up my own framework over time
0:09:39to make it a little bit easier, to make it more automated,
0:09:41where I'm not caching stale data from the read slave
0:09:44or anything else, but just be careful
0:09:46when you do that kind of complexity.
0:09:48In general, it is much better to scale up
0:09:52a single master database or to split it
0:09:55between multiple master databases with different tables
0:09:58in one, different tables in the other
0:10:00before you go to replication setups,
0:10:01because replication just introduces so many
0:10:03subtle little bugs and little problems.
0:10:06But yeah, otherwise, again, just keep it simple,
0:10:08keep it old, and this is a really good time to tell you
0:10:10about our sponsor, which is Linode.
0:10:13Linode is my favorite web host.
0:10:16It's where all of my servers are.
0:10:17I have something like 20 servers there,
0:10:20something in that ballpark.
0:10:21With Linode, you have access to a suite
0:10:23of powerful hosting options, with prices starting
0:10:25at just $5 a month.
0:10:27You can be up and running with your own virtual server
0:10:29in the Linode cloud in under a minute.
0:10:32Whether you are just getting started with one server,
0:10:34which is where you should probably start,
0:10:35or whether you're deploying a more complex system,
0:10:38like what me and Dave have,
0:10:39Linode is the right choice for you.
0:10:41Linode has the fastest hardware network,
0:10:43fantastic customer support behind it all.
0:10:45It has never been easier to launch a Linode cloud server.
0:10:48And they guarantee 99.9% uptime for server availability.
0:10:52Once your server is up, they intend to keep it that way.
0:10:55And they now also have block storage out of beta.
0:10:57This is available in Fremont and Newark,
0:10:59and they're expanding it to all data centers by June.
0:11:02Linode is great for things like hosting large databases,
0:11:05running mail servers, operating VPNs,
0:11:07running Docker containers.
0:11:08I really intend to actually learn Docker soon.
0:11:12It's one of those things that like,
0:11:13it's kinda like flossing, like you know you should do it,
0:11:16and I just still haven't really gotten into the habit yet,
0:11:18but I really gotta learn Docker.
0:11:20Hosting a private Git server, you can do that there too,
0:11:22and so much more.
0:11:23And Linode's even hiring right now.
0:11:25If that interests you, go to linode.com/careers.
0:11:28So Linode has fantastic pricing options.
0:11:31Plans start at just one gig of RAM for just $5 a month.
0:11:35And they have all sorts of plans that go up from there,
0:11:36including high memory plans.
0:11:38As a listener of this show,
0:11:39if you sign up at linode.com/radar,
0:11:42you will be supporting us,
0:11:43and you will get $20 towards any Linode plan.
0:11:46So if you choose, for example, the one gig plan,
0:11:48that's four months free.
0:11:49And with a seven day money back guarantee,
0:11:51there is nothing to lose.
0:11:53So go to linode.com/radar to learn more,
0:11:56sign up and take advantage of that $20 credit,
0:11:58or use promo code radar2018 at checkout.
0:12:01Thank you so much to Linode for supporting the show.
0:12:05- So related to server development,
0:12:07another question that we had
0:12:08that I think has come up many times, Brad Payne asks,
0:12:11our thoughts on when if Swift server development
0:12:14will ever become a thing?
0:12:16And I struggle to answer this question,
0:12:20because I feel like it both feels inevitable,
0:12:23and it seems like it's never going to happen,
0:12:26both at the exact same time for me.
0:12:27It seemed like Swift, if I felt more confident
0:12:32about Swift as a general purpose,
0:12:38like this is going to be the language of the future,
0:12:41then it would seem inevitable
0:12:43that it will eventually be used for server development.
0:12:46I think that is just part and parcel
0:12:49of whatever the most dominant languages
0:12:52that are being used by the most developers in the world,
0:12:55because web development is such a significant part of that.
0:12:58And inevitably, frameworks and things are going to spring up
0:13:01that let you use those skills in those places.
0:13:05The thing that is awkward, I think,
0:13:06is at least at this point,
0:13:08Swift doesn't quite feel like it has that broad appeal yet.
0:13:13And in a weird way, Swift sometimes still feels
0:13:17like it's still in its infancy and still growing up,
0:13:20and they're still making so many changes to the language
0:13:23at such a pace and level that it's,
0:13:27if you aren't an iOS developer,
0:13:29I could see it being difficult to want to dive into it
0:13:33and use it as just a general purpose language.
0:13:35And so I think at some point it might,
0:13:38but I think it seems very far off at this point.
0:13:40And I think if Swift Server is your jam, then go for it.
0:13:45That sounds great.
0:13:47I'm certainly glad that there are probably people
0:13:49who are driving that forward.
0:13:51But I think in general, my advice at this point,
0:13:53for most iOS developers is,
0:13:55just like you were saying earlier,
0:13:56is to use boring tools for your server side
0:14:01and use things that are kind of old and battle tested
0:14:04that the benefits you would get from reusing,
0:14:07you're using the same language on your client and your server
0:14:10are probably fairly minor because at the end of the day,
0:14:13it's just gonna end up being JSON being passed back and forth
0:14:16between these two apps or between these two things.
0:14:18And once you've gotten through the translation part of that,
0:14:21what they actually are speaking is only useful
0:14:25on the server in very specific cases.
0:14:28If you have some kind of specific business logic
0:14:30that you want to replicate in both places,
0:14:33but then you have to start wondering,
0:14:34do I really want to replicate this in both places
0:14:36or should this really be maintained in one place and so on?
0:14:40So I think at some point it seems possible,
0:14:43but it doesn't seem like for me anyway,
0:14:45something that is likely in the short term
0:14:47or something that I'm putting much interest and attention on.
0:14:51- Yeah, I would love to have Swift on the server
0:14:55be a big thing that takes off
0:14:57because I'm not that into the idea
0:15:00of necessarily sharing a bunch of code
0:15:02between client and server
0:15:03because for the reasons you said,
0:15:04I don't think I'd actually be doing that very much, if ever,
0:15:08because the needs are so different
0:15:09and what you're dealing with is so different.
0:15:10But I would like to only master one language
0:15:15as my next language for client and server.
0:15:17Right now, the languages that I actually use in practice
0:15:21are basically Objective-C, PHP,
0:15:25and a very small amount of Go for a few server things
0:15:29that PHP just didn't do that well
0:15:31and Go just does a better job of that kind of task.
0:15:33So that's about it.
0:15:35And I don't like Go that much, it's fine.
0:15:39I would love for PHP, I mean for Swift,
0:15:42to replace everything everywhere
0:15:44because the kind of, just like the style of ProgrammerAM
0:15:47is I don't learn every single language out there.
0:15:49I learn a small number,
0:15:50I try to master them as much as possible,
0:15:52and I try to be very productive in those
0:15:54until it's not possible anymore to be productive in those,
0:15:57like until I'm forced to go do something else
0:15:59because learning new languages and starting from zero
0:16:03at my skill level is just not something I find fun.
0:16:06Although that's very different for every programmer,
0:16:08so you might be one of those people.
0:16:08Anyway, so Swift on the server,
0:16:12it goes against everything we just said
0:16:13about do things that are old and stable and established.
0:16:18I don't know who's using Swift on the server
0:16:21at any kind of scale or for any kind of complex code base.
0:16:24I have no idea, there might be people out there doing that.
0:16:27I think it's fairly unlikely
0:16:29and it's so new right now.
0:16:31So maybe in five years,
0:16:34that might be a more established thing to do
0:16:37and there might be a lot of people doing that.
0:16:38Maybe there would be great library support and everything.
0:16:40The thing is, on the server side,
0:16:43the language matters a little bit,
0:16:44but what matters a lot in practice also
0:16:46is just what kind of built-in libraries and functionality
0:16:50and good third-party libraries are available
0:16:52to do things that people commonly need to do on web servers.
0:16:55So that's one of the reasons PHP took off so well
0:16:58because it had a whole bunch of very common web stuff
0:17:01just built right into the language
0:17:02that was super easy to use.
0:17:04And anything that you'd have to do on a server,
0:17:07various form processing things, image operations
0:17:11for processing and generating images,
0:17:14obviously tons of string processing, some network stuff.
0:17:17There's all sorts of stuff that you need to do on the server
0:17:19that you don't always,
0:17:21that usually aren't built into a language,
0:17:24that usually have to come
0:17:25by some kind of third-party library.
0:17:27And there's a reason why certain languages
0:17:30take off on the server, and most don't.
0:17:33Objective-C on the server never really went anywhere,
0:17:35except I think that's what WebObjects is,
0:17:36or was it Java?
0:17:37Anyway, certain languages just make server tasks easier.
0:17:41Swift, I don't think, is inherently one of those languages.
0:17:44So for it to become really awesome on the server,
0:17:47it's gonna have to have a very large library
0:17:50developed for it that becomes
0:17:53either an official standard library
0:17:54for web serving type needs,
0:17:56or a very, very, very popular third-party one
0:17:59that effectively becomes the platform,
0:18:01similar to how Rails kinda did that for Ruby.
0:18:03Rails is not made by the guy who made Ruby,
0:18:05but it basically became the de facto platform
0:18:10for writing web apps using Ruby.
0:18:12And so we need basically the Rails for Swift.
0:18:15I have not been following that community at all,
0:18:18so I don't know if that exists yet,
0:18:20but it's probably too early in its lifetime and usage
0:18:25to really have a clear winner there,
0:18:27even if some appear to be front runners right now.
0:18:30And when you're developing server apps
0:18:32that support your iOS app,
0:18:33and your heart's really in the iOS app,
0:18:35and you're kinda doing the server apps
0:18:37kinda the same way you do your taxes,
0:18:39because you have to,
0:18:40that's not a great reason to pick Swift for the server.
0:18:44And I hope someday that it will be a more responsible
0:18:48and boring and old choice, but we're not there yet.
0:18:51- Yeah, and I think the reality too is
0:18:53it's going to have to be better than everything else
0:18:56that it currently exists.
0:18:58Like, the problem that a new web platform has to overcome
0:19:03gets harder and harder over time,
0:19:06because there are so many very reliable,
0:19:09well-trusted established players.
0:19:12And so one day it may happen,
0:19:14but it's going to have to be incredibly compelling
0:19:16in the way that Rails was compelling to learn Ruby,
0:19:20because it was a totally,
0:19:22at the time it was a totally different
0:19:24sort of paradigm for web development
0:19:26that is superficially super powerful
0:19:29and straightforward and simple.
0:19:31And so that's what allowed it to overcome it.
0:19:33And so I think something similarly would have to come along
0:19:37that made it just that much more compelling.
0:19:39- Yeah, and also with server-side languages,
0:19:41the language is only one,
0:19:43as I was saying earlier,
0:19:43the language is only kind of one part
0:19:44of why you want to use it.
0:19:45There's all these built-in libraries and everything too.
0:19:48There's also a third part of that,
0:19:49which is how easy it is to administer and run servers
0:19:53that use this language.
0:19:54So that includes things like how easy is it to install it
0:19:56from the most common Linux package managers?
0:20:00Do you have to build it from source?
0:20:01Do you have to update it frequently?
0:20:03Can you use just apt-get or yum or something like that
0:20:06to automatically install it with one line of code
0:20:09in your config script,
0:20:09and can you have it updated on a regular basis
0:20:12and not break things?
0:20:13Things like that.
0:20:14And then when you're administering the servers,
0:20:16are you getting woken up in the middle of the night
0:20:18with pingdom alerts because the app server process crashed,
0:20:23or it was leaking memory and it ran out of memory
0:20:26and the whole server's now down,
0:20:27or something like that?
0:20:28Are you dealing with stuff like that on a regular basis?
0:20:31Why bother doing that when you can use something,
0:20:36like I use PHP,
0:20:37and PHP, the server just doesn't crash.
0:20:40That is never a problem I have,
0:20:44and it hasn't been for a decade at least.
0:20:46(laughs)
0:20:47The web server just doesn't crash.
0:20:50I have other problems,
0:20:50things like, oh, there's a huge flood of traffic
0:20:53and MySQL is starting to back up
0:20:55and connection's starting to back up,
0:20:56like that could be a problem.
0:20:57But the actual server processes for the server language,
0:21:02like if you choose an old boring thing,
0:21:04there's problems you don't have to deal with.
0:21:07Where any of the newer things, just by being newer,
0:21:10you're gonna probably be dealing with things
0:21:12like memory leaks and occasional crashes,
0:21:14and that just adds to the burden of running your own servers.
0:21:18A lot of the automatic, more abstract cloud platforms,
0:21:24like various app engines and stuff like that,
0:21:27the reason people go to those a lot of the times
0:21:30is that they don't theoretically have to deal
0:21:32with annoying little problems like that,
0:21:35but that isn't the only option.
0:21:37And going to a platform like that has a lot of downsides.
0:21:40Number one, they're usually proprietary,
0:21:42and so you can't move off of them if they start to suck.
0:21:44And number two, they're usually way more expensive
0:21:46for the computing resources that you're getting.
0:21:48So if you can do something like Linode,
0:21:50and I'm saying this because I do,
0:21:51not because they sponsored this episode,
0:21:52if you do something like Linode,
0:21:54where it's just a Linux VPS, and if Linode starts to suck,
0:21:57you can move to any other Linux VPS service.
0:22:00It's fine.
0:22:01You're doing something standard that you can put anywhere,
0:22:04or you can move to dedicated servers,
0:22:05or you can move to a Raspberry Pi in your basement.
0:22:07It all works the same way
0:22:08when you're on a regular Linux server.
0:22:11And so anything you can do
0:22:13when thinking about running servers for your business,
0:22:15anything you can do to make it more likely
0:22:18that you will stick with the regular Linux server path
0:22:22instead of going to something weird and custom
0:22:23that's gonna be more expensive and proprietary,
0:22:25I think will serve you well long term.
0:22:27So one little quick thing I wanted to hit
0:22:31from Jacob Tomlinson, who asked about server stuff,
0:22:34and asked, "How much server code
0:22:35"do you write compared with app code?"
0:22:39And this I thought was an interesting question to answer,
0:22:41because just to give some idea
0:22:43for people who were starting out, what to expect.
0:22:46And the answer is, between app code and server code,
0:22:49the answer really is it depends a whole lot on the app.
0:22:53Instapaper really didn't have that much server-side code.
0:22:58Overcast has more, but still not a ton.
0:23:02Something like Tumblr had a ton,
0:23:04because that was a way more complex web app
0:23:06that happened to also have iOS APIs.
0:23:09But if what you're mainly making,
0:23:11like in the case of Overcast and Instapaper,
0:23:12if what you're mainly making is an iOS app
0:23:16that has a web service to do some auxiliary tasks for it,
0:23:21the iOS app is probably gonna be way more code
0:23:25than the web app.
0:23:26But again, it depends so much on what you're doing.
0:23:29I would say if your web app is that much code,
0:23:32you're probably not listening to this show.
0:23:35- Yeah, and I think too, something that I have found
0:23:39really useful in my career of independent development
0:23:43is the understanding that the more I can make
0:23:47my client do, the more logic I can push down
0:23:51into the client, the easier things like scaling
0:23:55and navigating, the problems that you will hope to have
0:23:59of having lots of users get, because you have a,
0:24:04modern iPhone is incredibly capable
0:24:07and can do a tremendous number of things.
0:24:09And there is something that is just so nice about,
0:24:13if you try as much as you can to not have huge reliance
0:24:18on your web server, on your server,
0:24:20and instead push that logic down into your client.
0:24:22Say you get featured in the App Store,
0:24:24and one day you have 10,000, sorry, sorry, sorry,
0:24:27if you have 10 times more downloads than you normally do.
0:24:30If you're very server-based, your best day
0:24:35just might have become your worst day,
0:24:36because now all of a sudden you have to make sure
0:24:39that you're scaling all of your infrastructure
0:24:42to manage that, and it may be a very bursty thing,
0:24:44it may not be long-lived, and it's just becoming
0:24:47really complicated, whereas if, for most of my applications,
0:24:51they have no interaction with the server whatsoever,
0:24:54and if they, the ones that do, they try to try
0:24:56and minimize that as much as I can,
0:24:58just because then I don't have to worry
0:25:02about those problems, and I think in general,
0:25:04from a broad business-y kind of perspective,
0:25:08I find that to work well, that my,
0:25:11if my user base scales, my costs don't scale up,
0:25:15they are exactly the same no matter what,
0:25:18I don't have, I don't need as much of the kind of
0:25:22infrastructure-y kind of management,
0:25:24in terms of theoretically, if your servers
0:25:29are the absolute essential part of your business,
0:25:32you're probably gonna wanna have not just you
0:25:34being the person who's getting alerts when they go down,
0:25:36you wanna have coverage for when you're out of town,
0:25:39or when you're on vacation, and things start
0:25:41to get much more complicated if that's where your goal is,
0:25:43whereas if you can keep a lot of your code,
0:25:46and your logic, and the value that you're providing
0:25:49to your customer in your app, then you don't have
0:25:52to worry about nearly as many of those problems,
0:25:54and you can just take advantage of the fact
0:25:56that everyone who downloads your app is running
0:25:58a computer that is perfectly capable of doing
0:26:00a tremendous amount of computation for them,
0:26:02and so it's like, it scales so nicely in that way,
0:26:06so that I would always kind of push,
0:26:08whenever I have an idea, it's like, oh man,
0:26:10that's gonna take a lot of, it could be very server-dependent
0:26:14I become very cautious about if I should really
0:26:17go down there, or if it's like, is there a way
0:26:18that I can just do this client side?
0:26:21And maybe it's like, I don't know if that's better or worse
0:26:24for applications at large, but I can say for being
0:26:28a one-man developer team, that is fantastic.
0:26:32I can put all of my resources in one place,
0:26:34there's less area for bugs, there's less maintenance
0:26:37overhead that I have to manage, and it just works
0:26:40really well to de-emphasize that down.
0:26:43That you servers, they're a powerful thing
0:26:44and allow applications that you couldn't build otherwise,
0:26:48but the less I can do there, the better,
0:26:50and trying to make my web services,
0:26:53moving largely, they're just like, sort of dumb repositories
0:26:56for data that just gets shuffled back and forth.
0:26:59They're all, the actual logic and processing and things
0:27:01is happening client side, and that makes
0:27:03just everything better, I think.
0:27:06- Although I will give one counterargument here,
0:27:08is that if you are currently using,
0:27:11if you're currently avoiding a feature,
0:27:13or using some kind of external service to do things
0:27:17that are very, very easy to do server side,
0:27:19but you just don't wanna set up a server,
0:27:20'cause either you don't wanna manage it,
0:27:22or you are inexperienced in that area,
0:27:24and you don't know what you're doing,
0:27:25and you're maybe a little intimidated by it,
0:27:26or scared to do it, I would say two things.
0:27:28Number one, running servers is easier
0:27:31than you think it is.
0:27:32It's like, if you can write an iOS app,
0:27:33you can run servers, and it's really,
0:27:36if you do it conservatively, and just use basic Linux stuff
0:27:39and package stuff, it's super easy.
0:27:42And B, things like setting push notifications.
0:27:46There are certain things that apps need a lot,
0:27:49or verifying in-app purchases, or verifying subscriptions,
0:27:52stuff like that, very common things.
0:27:54There are a million services out there
0:27:56that are happy to take large amounts of your money
0:28:00to take these problems away from you,
0:28:02so you don't have to worry,
0:28:03because they make it sound really hard.
0:28:05Spoiler, it's not really hard to run services,
0:28:08to do things like verify in-app purchases,
0:28:10or send push notifications.
0:28:12Those are extremely easy things to do.
0:28:14You can do that on that $5 monthly node server.
0:28:17And so, don't jump immediately to going
0:28:20to other crazy enterprise-y services
0:28:22when you don't have to.
0:28:23Try it on the server side first.
0:28:25It really isn't that big of a deal to do stuff like that,
0:28:27and a lot of apps need things like that,
0:28:29and your app can be way more powerful
0:28:33with a little bit of server-side support.
0:28:35So I encourage you, if you're intimidated,
0:28:37or if you haven't done it yet,
0:28:39learn the basics of it.
0:28:40You'll be surprised how far you can get.
0:28:42- Yeah, and I think the best advice for,
0:28:44like the theme, I think, in all of our discussions
0:28:46is just keep it as simple as you can,
0:28:48and simple, thoughtful code will go a long way
0:28:51with any of this stuff.
0:28:52And that's, you know, don't be scared of it.
0:28:55Just keep it simple, and you'll be fine.
0:28:57- And keep your stack boring.
0:28:59Thanks for listening, everybody,
0:29:00and we'll talk to you next week.
0:29:02- Bye.
0:29:03[ Silence ]