0:00:00welcome to under the radar a show but
0:00:01independent ios and app development I'm
0:00:03Marco Arment and I'm David Smith under
0:00:06the radar is never longer than 30
0:00:07minutes
0:00:08so let's get started so last week we
0:00:10mentioned at the end how we were gonna
0:00:12tell this week tips and and stories and
0:00:15setups of how to run your own Linux
0:00:17servers because this is now you know in
0:00:19the wake of the parse announcement last
0:00:21week this is now kind of in the news and
0:00:22we think it's kind of a core competency
0:00:24that many app developers should know
0:00:26just how to run your own servers and and
0:00:28once you know this it enables your apps
0:00:30to be better to be more capable and and
0:00:33if you if you do kind of a standard
0:00:35server route without doing these like
0:00:37kind of more abstract proprietary
0:00:38services like parse it gives you a lot
0:00:41of flexibility with what you can do in
0:00:42the future and it kind of decouples you
0:00:44from depending on a particular third
0:00:47party to keep their their platform going
0:00:48yeah and this is probably fair
0:00:50disclaimer to say this is going to be an
0:00:52episode that goes a bit into the weeds
0:00:54like Dennis had some pretty low level
0:00:56stuff and if that's for you awesome if
0:00:59it isn't for you you know maybe stick
0:01:01around you might learn something and
0:01:02know that you know some some episodes
0:01:04are gonna be high level some episodes
0:01:06are gonna be low level and hopefully we
0:01:08can have a nice balance as a result so
0:01:10at a high level it's probably worth
0:01:12starting of just kind of talking about
0:01:13the the spectrum of hosting before we
0:01:16kind of end it before why we do it the
0:01:18way we do it
0:01:19so ultimately hosting see in many ways
0:01:22comes down to levels of abstraction like
0:01:25how abstracted away if they're like the
0:01:27actual computer that you're running your
0:01:30servers and your backends and systems on
0:01:32how much that is abstracted away from
0:01:35you so like at the lowest level you have
0:01:37a but I think it would be called
0:01:38colocation or something like that where
0:01:40you have a computer that's like your
0:01:43computer that you went to Best Buy or
0:01:45whatever to buy and you're taking it and
0:01:47you're putting it somewhere typically in
0:01:48some kind of data center that you put in
0:01:50a data center so that it has reliable
0:01:51power and reliable internet and reliable
0:01:54air-conditioning and all those types of
0:01:55things but like it's your machine most
0:01:59people don't do that I would really not
0:02:00recommend doing something like that most
0:02:03people with a very least we do but I
0:02:05think most people call like bare metal
0:02:06managed servers where it's not really
0:02:08your machine it's a service that they
0:02:11buy machines they manage machines if
0:02:13harddrive dies in the machine they'll go
0:02:15and fix it for you but it's you have
0:02:18actual like a dedicated piece of
0:02:20hardware you know a set of hard drives a
0:02:23motherboard a CPU that's exactly yours
0:02:26and you probably don't want that either
0:02:28I've I've gone down that road it's fine
0:02:30but it has a lot of difficulties that we
0:02:34aren't really offset by its costs both
0:02:37in monetary and like ease of use so most
0:02:40people who didn't even doing any kind of
0:02:43hosting themselves will use something
0:02:44that's more like a VPS which stands for
0:02:47virtual private server which is like
0:02:49basically like it's a machine from your
0:02:52apps perspective like you are your app
0:02:54sees it's a hard drive it sees a CPU it
0:02:57sees memory but all of those aren't
0:02:59actually physical things they're it's
0:03:02running on a shared environment with a
0:03:04bunch of other systems that I'll see the
0:03:06same things and share resources and you
0:03:09know you can use something like the node
0:03:11for this or digitalocean is another one
0:03:14that's pretty common in many ways ec2
0:03:16kind of runs like this but it's a bit
0:03:18different but you have these kinds of
0:03:20systems where you have a virtual Linux
0:03:23machine that you can do and you have
0:03:24some nice advantages that bit because
0:03:25because it's virtual you can do things
0:03:28like pick it up and move it around you
0:03:30know like you take an image of your hard
0:03:32drive and you can copy it onto another
0:03:33one and things like that that are really
0:03:35easy to manage and from a cost
0:03:38perspective it's way cheaper because
0:03:40you're sharing you know server resources
0:03:42and then above that you have things like
0:03:44virtual server environments things like
0:03:46a juror or Heroku or total abstractions
0:03:49like cloud cater parse or those types of
0:03:51things that are completely abstracting
0:03:53away from you and if I said for most
0:03:56people you probably want to start at a
0:03:57VPS like you want to find out where
0:03:58you're comfortable if you if the thought
0:04:00of administering a Linux server even
0:04:02after this episode is completely
0:04:04overwhelming like maybe go to something
0:04:06like Heroku or Azure where you have a
0:04:09little bit of control over what you're
0:04:11doing but mostly there's something there
0:04:13but it's still at least general-purpose
0:04:15but I think we both run for like reap
0:04:18yes sir vers because once you know what
0:04:21you're doing it's really cheap it's
0:04:23really efficient and you have a lot of
0:04:25flexibility that you could move
0:04:27providers you can spin up new servers
0:04:29and take them down really quickly and
0:04:31easily and you know especially like the
0:04:34cost is amazing it's incredible the
0:04:37amount of performance you can get from a
0:04:38really basic set up I mean at this point
0:04:40I think I administer 19 Virtual Private
0:04:43servers or something like that to ramai
0:04:45apps and it's a pretty big number but
0:04:48the actual load of that of actually
0:04:49doing that is pretty straightforward oh
0:04:51yeah and I mean and things have gotten
0:04:53so cheap over the years like I now pay
0:04:54for all of overcast which is something
0:04:57like something like 11 VPS instances on
0:05:00Linode I now pay for all of them what I
0:05:03used to pay for one database server for
0:05:05Instapaper back in the day and that
0:05:07wasn't that long ago that's like five
0:05:08years ago
0:05:09so what you can get now with with at the
0:05:12VPS level is just incredibly good
0:05:14I was the biggest fan of bare metal
0:05:15dedicated servers before but now even I
0:05:18have converted because you can just you
0:05:20know the competition especially between
0:05:22Linode and digitalocean has has really
0:05:24made incredibly fast Hardware available
0:05:26for almost no money and it also makes it
0:05:29much easier to learn because you know it
0:05:31lets you and we'll get into this in a
0:05:33little bit but it lets you you know if
0:05:34you can just like in you know in a
0:05:37simple command on a web interface so not
0:05:39involving buying anything not involving
0:05:41emailing anybody or placing any orders
0:05:43with anybody just in a web interface you
0:05:45can quickly create an instance of a
0:05:48server then you can do things like let
0:05:50me see how easy is it to set up PHP or
0:05:53whatever like you can do things like
0:05:54that or you can say you know I wonder
0:05:55how whether whether this new district
0:05:58district of linux makes more sense to me
0:05:59or or I wonder if my software will run
0:06:01on this other distro or this other web
0:06:03server or whatever you can just spin up
0:06:05a new instance in minutes and you know
0:06:08run your install script and and you know
0:06:10try poke around try things out see what
0:06:12works you would you know see what breaks
0:06:14and if if at any point you decide this
0:06:17wasn't for you or this didn't go well
0:06:18you can just delete the instance and
0:06:20you've paid up to that point maybe 50
0:06:23cents like it's it's crazy how easy this
0:06:26is to to both administer servers and to
0:06:29learn how to administer servers now in
0:06:31the world of VPS yeah because it's
0:06:33lovely think of most of these are
0:06:34charged by hour of use or something like
0:06:38that and so you can they're just kind of
0:06:39like utility in that way they
0:06:41you can just spin them up when you want
0:06:43him but take him down when you don't
0:06:44want them anymore and like it's very
0:06:47straightforward and easy to do in a way
0:06:49that is kind of scary the first time you
0:06:50do it that you just like hit a button
0:06:52and it's like oh here's a machine go
0:06:54ahead and ssh into it and get started
0:06:56yeah I mean it's so easy that like you
0:06:58know one way you could have done it
0:06:59before is by running something like
0:07:01VMware fusion or parallels on your
0:07:03computer and virtualizing little Linux
0:07:05setups on your computer and doing that
0:07:07but now it's so cheap and easy to go do
0:07:10it on linen or digital ocean that it's
0:07:13actually easier to do that than it is to
0:07:15do it on your local computer like now I
0:07:18do all my experimentation on VPS I don't
0:07:20even have our tools agent software
0:07:21installed anymore on my Mac yeah and I'm
0:07:23the same way like the only thing I used
0:07:25my Mac for when I'm doing this kind of
0:07:27thing is like the first level of the
0:07:30nice thing about using listen like Linux
0:07:32is that it's you know these are the
0:07:34basic underpinning is underneath our
0:07:36Macs are like it's you know it's some
0:07:38kind of UNIX space thing I couldn't tell
0:07:40you all of the history of it but
0:07:41functionally like your Mac is running
0:07:43the same basic stack kernel the types of
0:07:46things that your ultimate server is
0:07:48gonna run and so like I use my Mac
0:07:50because I can learn and kind of
0:07:52prototype and try some of the things
0:07:54that ultimately I'm gonna run on my
0:07:55linic I might like main so server
0:07:57locally like I have a development
0:07:58database that runs on my on my machine I
0:08:00have a web have a web server that runs
0:08:02on my local machine which makes
0:08:04prototyping really quick but as soon as
0:08:05I want to do anything that's going to be
0:08:07simulating my end environment I just
0:08:11yeah I just spin up an instance and run
0:08:12it and I have a couple of just instances
0:08:14that you're just bringing up you're like
0:08:15try it out if it works great if it
0:08:17doesn't you know you can just delete it
0:08:18and start again so wait once you've
0:08:21decided you're going to build and build
0:08:23in a Linux instance and get started like
0:08:26I'm the actual process is pretty
0:08:29straightforward she'll go to a virtual
0:08:30private server provider and just sort of
0:08:34you'll be set up your instance it'll
0:08:36give you some credentials and an IP
0:08:37address and a few things that you'll
0:08:38have for like how to log into it and
0:08:40then you just log in and get started and
0:08:42for most applications you're going to
0:08:44install at least two things on that
0:08:46you're going to install a web server and
0:08:48a database of some kind and starting out
0:08:52you could probably put them both on the
0:08:53same machine
0:08:54eventually you'll probably do a thing
0:08:56where you'll split the web database onto
0:08:58its own machine and put a one or more
0:09:00web servers in front of it but if you
0:09:03know the very least you're going to
0:09:04install some kind of web server
0:09:05environment some kind of database the
0:09:07web server that you choose it's entirely
0:09:09up to you like I use Ruby on Rails for
0:09:12all my backends I think all of your
0:09:13ziering PHP yeah I mean and I have many
0:09:16opinions on like how you choose these
0:09:18tools I will summarize them for the sake
0:09:21of this being a short show I will
0:09:23summarize them as what you want most of
0:09:26all when choosing server software if you
0:09:28don't want to be administering and
0:09:29tweaking with your server constantly
0:09:31what you want is old boring and popular
0:09:34those three things old boring and
0:09:37popular new and trendy does not
0:09:39necessarily always mean better in this
0:09:42case you know especially like what what
0:09:45makes some people think that the new
0:09:46stuff is better is vague claims of it
0:09:49being quote scalable and beware of any
0:09:52claims of things being scalable because
0:09:55in reality scaling web services up not
0:09:59only is it the kind of thing that you
0:10:00will probably never need for almost any
0:10:02project that you do but when you do need
0:10:04it it is way more complicated and there
0:10:08is no silver bullet for scaling there is
0:10:10nothing that automatically scales unless
0:10:13it also automatically scales on for all
0:10:14of your money away but there there is
0:10:16nothing that automatically and easily
0:10:18scales scaling is always complicated and
0:10:20always tricky it's just you know the new
0:10:22things that claim scalability just scale
0:10:24differently and it the challenges are
0:10:27just different challenges the newer
0:10:29something is the trendy or new or
0:10:31something is that means you know the
0:10:35fewer people have experience with it and
0:10:37and the the fewer large installations it
0:10:41has and so that means there's less
0:10:43knowledge in the world about how it
0:10:45fails or what the anti-patterns
0:10:47of it might be so as you go a lower
0:10:50level in the stack being this kind of
0:10:52conservative preferring things that are
0:10:54old boring and popular it becomes more
0:10:55important so like if you want to use
0:10:58like a brand new cutting-edge CSS
0:11:00library go for it doesn't matter really
0:11:02you know if it works for you go for it
0:11:04your risk is pretty low there but you
0:11:06you probably would not want to use
0:11:08a beta version of the Linux kernel you
0:11:11know it's like as you go down the stack
0:11:13you want to be more conservative because
0:11:15it's just it's just kind of a bad idea
0:11:16to take risks lower down and I include
0:11:19things like the database in that you
0:11:21know MySQL and Postgres are great
0:11:23they're battle-tested they are old
0:11:25boring and popular that is what you want
0:11:28in your database just like you wouldn't
0:11:30want a trendy new kind of breaks on your
0:11:32car like you want to time-tested breaks
0:11:35that everyone knows works and everyone
0:11:37knows that you aren't going to be
0:11:38pushing the boundaries of them you know
0:11:40you want a really boring database and I
0:11:44would say you want a really boring
0:11:45language - because let really new
0:11:47cutting-edge languages are still in flux
0:11:50and so if you want to have this kind of
0:11:53like set it and forget it kind of server
0:11:55approach you don't want to have to deal
0:11:57with a young languages frequent changes
0:12:01and frequent needs for being updated you
0:12:04know you want to minimize anything that
0:12:06will require your attention or that
0:12:08might break your app so you want to
0:12:10minimize the need for you know backward
0:12:12compatible updates and things like that
0:12:14or crashes and you know having to
0:12:16install little bug fixes constantly for
0:12:18the for the language of database you're
0:12:20using you want to avoid all of that
0:12:22because new really new means untested or
0:12:26less tested another thing that you hit
0:12:28with new stuff is in the language layer
0:12:31new means that you have fewer
0:12:34third-party libraries and and generally
0:12:36less third-party code and this is a
0:12:38problem like I I'm using PHP forever and
0:12:41PHP third-party code is mostly garbage
0:12:43but there is so much of it out there
0:12:45that any any need that I have I can find
0:12:48something to do it and it isn't always
0:12:50good but I can find something and as
0:12:52I've started writing some newer things
0:12:54and go and go I like as a language
0:12:56conceptually but there because it's such
0:12:59a such a younger language and it isn't
0:13:01that popular yet and might never become
0:13:03popular who knows but because it's it's
0:13:05younger and less popular there is very
0:13:08little third-party go code for some very
0:13:11common things that I keep meeting to do
0:13:12and I keep every time I need to write
0:13:14something new and go I hit this wall of
0:13:16oh I'll just load up the you know
0:13:17markdown module and I look and there's
0:13:19like three of them that are all kind of
0:13:22half
0:13:22and you know and I haven't looked in a
0:13:24while for markdown so maybe that's a bad
0:13:25example but I keep hitting that wall
0:13:27whenever I do anything in a new language
0:13:29if oh I just want to see how oh how do I
0:13:31resize an image oh well you kind of
0:13:33can't unless you do this and so it's
0:13:36always easier to use old boring and
0:13:38popular stuff it may be less interesting
0:13:40and if you are the kind of person who
0:13:42wants you know cutting-edge languages
0:13:45and who find that satisfying then you
0:13:48will trade time and maintenance for that
0:13:50and so if for the goal of
0:13:51low-maintenance and and you know low
0:13:54server maintenance I highly suggest that
0:13:56you use other parts of your app to get
0:13:59the kind of like newness out of your
0:14:01system like yeah use the higher-level
0:14:02parts or use maybe the iOS side of it if
0:14:04if you have an iOS and a web app use
0:14:06that side of it to do new cool stuff and
0:14:08make the server as boring old and
0:14:11popular as possible because the old
0:14:12boring popular stuff works it really
0:14:15works it hardly ever breaks and if and
0:14:18you will never be the biggest person
0:14:20using it because long before you know
0:14:22even suppose that you build something
0:14:24with old boring stuff suppose it gets
0:14:27like the size of Etsy right Etsy is huge
0:14:29it's not the biggest website on the on
0:14:31the internet but it's huge right it gets
0:14:32the size of Etsy if you get that big
0:14:35will you be the biggest user of anything
0:14:39in your stack because once you're the
0:14:40biggest user of like your database or
0:14:42something then you basically become a
0:14:45developer of that database you will hit
0:14:47all the bugs you will have to go in and
0:14:48make patches yourself to customize
0:14:50things that aren't working or that
0:14:51aren't working well or aren't working
0:14:52right for you you know so like Facebook
0:14:54if Facebook rolls out tons of patches
0:14:57and things Twitter has rolled out tons
0:14:58of patches or things like memcache I
0:14:59mean like there's there's all these like
0:15:01big companies all these big web
0:15:02companies end up having to basically
0:15:04partially take over parts of the stack
0:15:06that depend on open source wise and make
0:15:09their own contributions and fixes
0:15:10because they hit tons of bugs you never
0:15:12want to be the biggest user of anything
0:15:14in your stack and you know when you
0:15:16start out of course you won't be the
0:15:17biggest user of basically anything but
0:15:19you could become the biggest user like
0:15:20you'd be surprised you know you hear
0:15:22about new trendy things but you'd be
0:15:24surprised how few big companies actually
0:15:27use them so you never want to be that
0:15:29because he was ever anything you want
0:15:30Facebook to have fixed every bug in that
0:15:32stack years before you ever hit it
0:15:35yeah I think we're ready rubber both
0:15:36coming at it from the perspective of
0:15:38being apt developers like what makes our
0:15:40apps cool is not the back end stack
0:15:42that's got nothing to do with like the
0:15:45thing that I'm gonna be marketing my app
0:15:46has like my customer shouldn't care no
0:15:49one like it's only it exists for the
0:15:52sole purpose of just getting a job done
0:15:54like my most of my backends are the most
0:15:56ridiculously boring simple applications
0:15:59as I can possibly make it I put all the
0:16:01much logic and smarts as I can in the
0:16:04apps itself like the database is just
0:16:06it's mostly just a nice wrapper for a
0:16:08database and something that's simple and
0:16:10straightforward that I can set up and
0:16:12then I never think about again like the
0:16:16only time I ever really think about my
0:16:17databases is or like my servers is like
0:16:20when there's some big security thing
0:16:22that I need to make sure was Auto
0:16:23updated or I'm adding major new
0:16:26functionality to the front end to my
0:16:28applications and then I have to go back
0:16:30and like you know add something to it
0:16:33but otherwise I just wanted as simple
0:16:34and basic as can be it's just like a big
0:16:36dish just like a big database that I
0:16:38just a database that I can put things in
0:16:39and then later get them out and as long
0:16:41as it can do that I'm good and if
0:16:43anything what are you using old boring
0:16:45and popular if anything ever goes wrong
0:16:48or if you have any questions whatsoever
0:16:50or anything comes up you can just search
0:16:52the web and you have hundreds of answers
0:16:55from the thousands of other people who
0:16:57have used that already and have
0:16:58documented it like three years earlier I
0:17:00think like it's just it's so much easier
0:17:03to to make your your your server-side
0:17:06stack something that you can easily
0:17:08forget about most of the time and you
0:17:10know you don't even have to deal with it
0:17:12exactly and I guess once you decide on
0:17:16which one you want to do it's like it
0:17:17the process from there is honestly
0:17:18pretty straightforward you pick
0:17:19something you install it usually these
0:17:22kind of things that are pretty
0:17:23straightforward install process like if
0:17:25you're you know there's you be some kind
0:17:27of version of like go get me my sequel
0:17:30go get me Postgres go get me nginx go
0:17:33get me apache and the server will go get
0:17:36it install it configure it you'll change
0:17:38a few configuration files and you'll be
0:17:40up and running because it's boring and
0:17:42the process that I'm getting it set up
0:17:46has been done by thousands of people so
0:17:48everything's
0:17:48automated inscripted and the only thing
0:17:51that I had mentioned there is one thing
0:17:52that I learned early on is once I've set
0:17:54up a server the first kind of what the
0:17:56first time for I always a document how I
0:17:59did it like the steps I did and then I
0:18:01will usually destroy what I did the
0:18:02first time and do it again
0:18:03to make sure I actually know what I'm
0:18:05doing to avoid the situation where down
0:18:07the road you are trying to like recreate
0:18:09a web server and you can never get it to
0:18:11work quite right and it turns out it's
0:18:13because the first time you did it you
0:18:15did this step that you forgot to
0:18:16document and so that was like no one
0:18:19will approach first little pro tip is
0:18:21like the first time you when you think
0:18:22you got it right that's great
0:18:24now do it again because if you if it
0:18:26works the second time then you know you
0:18:28actually understand your city or your
0:18:29setup and could we'll be able to do it
0:18:31multiple times if down the road you need
0:18:33to because when you need to do it down
0:18:34the road it's usually under some kind of
0:18:36duress because you're like wow things
0:18:39are going really well I needed another
0:18:40web server to keep up with the load like
0:18:43that's a good thing but it's also a bit
0:18:44of an urgent thing yeah and VPS does
0:18:46make this so much easier because not
0:18:47only can you like you know you can just
0:18:49clone whatsoever you already have if you
0:18:50need to but also like you can do things
0:18:52like you know automate this with a big
0:18:54shell script as you as you figure out
0:18:56like this is what I do like whenever I
0:18:57have to install you know something new
0:18:58or change something I format everything
0:19:01I'm doing as a shell script as I'm going
0:19:02and then I can then I can rerun it on a
0:19:05fresh server from a VPS like you know it
0:19:08just what you said that you can kind of
0:19:09verify your work and it's it's so much
0:19:12easier man it's like doing this and I
0:19:15should also say like anything that is
0:19:17not really easy to install from a
0:19:19package manager like if if suppose
0:19:21you're looking at you know I'm looking
0:19:23at some PHP library to manipulate an
0:19:25image or something you know that this is
0:19:27just a weird example and if there's like
0:19:29three of them and one of them is in the
0:19:32repository that my server comes with
0:19:34like the the UM or apt-get repo like one
0:19:37of them is in the repo and I can install
0:19:39it with what with you know one word on
0:19:41the command line and one of them needs
0:19:43to be built from source I'm going with
0:19:44the one in the repo because like that's
0:19:47like anything as a general rule of thumb
0:19:49anything that you need to build from
0:19:51source or manually download from
0:19:53somewhere that is not in your package
0:19:54manager try to avoid needing that and
0:19:58and everything becomes a lot easier and
0:20:00package managers are not flawless you
0:20:01know sometimes
0:20:02you'll hit some weird conflict but
0:20:04that's very rare
0:20:06if you especially if you stick with the
0:20:07with like the the default repositories
0:20:09that come configured with it because
0:20:11those are so heavily tested by other
0:20:14people and again old boring and popular
0:20:16that you might not be able to use the
0:20:17newest version of something or or a
0:20:19cutting-edge feature of something or or
0:20:20an obscure module of something but if
0:20:23you can if you can get away with not
0:20:24using it you are saving yourself time in
0:20:26the future
0:20:27exactly we're sponsored this week by our
0:20:30friends at a glue the intranet you will
0:20:32actually like with a glue you don't have
0:20:34to be stuck at your desk to do your work
0:20:36you can manage your task list from your
0:20:37laptop during a meeting you can share
0:20:39status updates from your phone as you're
0:20:40leaving a client site you can even
0:20:42access the latest version of a file from
0:20:43your home whether you're wearing pants
0:20:46or pajamas or anything nobody will even
0:20:47know these days everything is mobile
0:20:50your work should be - now if you've ever
0:20:52looked at a corporate intranet you can
0:20:54possibly thought whoever designed this
0:20:56must truly hate me and everyone I know
0:20:57with a glue those days are over
0:21:00igloo Internet's are actually places you
0:21:02want to be they're surprisingly
0:21:04configurable you can even customize it
0:21:06and rebrand it to give it the look and
0:21:07feel of your team they have group spaces
0:21:09role-based access permissions easy to
0:21:11use drag-and-drop widget editors so you
0:21:13can reorganize the whole platform to fit
0:21:14exactly how your teams work now of
0:21:16course today Mobile is everywhere igloo
0:21:19is great on mobile they are fully
0:21:21responsive they work on every device any
0:21:23screen size new devices come out they
0:21:25work on day one and they have all these
0:21:27great integrations with modern services
0:21:29that you actually use things like box
0:21:31Google Drive Dropbox all of this is
0:21:33integrated into one big easy to secure
0:21:36platform they do things like 256 bit
0:21:39encryption single sign-on Active
0:21:40Directory integrations you if you know
0:21:42what any of those things are you know
0:21:44how safe and secure a glue is so share
0:21:46your files with your co-workers for
0:21:47everyone to collaborate on do everything
0:21:49you want inside your intranet with a
0:21:51glue break away from the internet that
0:21:52you hate go sign up for a glue right now
0:21:54and you can try for free for any team
0:21:56with 210 people for as long as you want
0:21:58so I put a glue software comm slash
0:22:01radar once again that's a glue software
0:22:03comm slash radar start your free trial
0:22:05today thank you so much to a Lou for
0:22:06supporting under the radar and all of
0:22:08real afm okay so once you now have this
0:22:12the server set up its running your
0:22:15systems up and going
0:22:16the thing that of course seems worth
0:22:18pointing out is some of the lessons
0:22:20we've learned about how things typically
0:22:23go wrong when they actually you know
0:22:26said if you got this deployed you got it
0:22:27running hopefully you have something
0:22:29running to monitor it I think I use
0:22:32Pingdom I don't know what you use but
0:22:34you have some kind of call where I also
0:22:35use big dumb there you go they're a
0:22:37great service it just you give them a
0:22:39URL and they will hit it and one thing I
0:22:41always like with those kinds of URLs is
0:22:44don't point it to like the root URL of
0:22:47your site to make sure that it's up like
0:22:50have a special URL that it hits that
0:22:52will test your whole stack you know so
0:22:54it'll go down to the database make sure
0:22:55the database is running it if you have
0:22:58like a certain search you know query
0:23:00system like it'll go and hit that and
0:23:02then report back results so that you're
0:23:04actually testing your whole thing but
0:23:05you know you have something that's
0:23:07testing it every now and then you'll get
0:23:09a little message that says oh it's down
0:23:11like why is that and usually on the nice
0:23:16thing like it doesn't actually happen
0:23:17very often like for running of as many
0:23:19services I think we both run like
0:23:20outages are pretty rare things are
0:23:22pretty reliable and stable these days
0:23:23like in general like you every now and
0:23:25then you'll hit some kind of network
0:23:27outage in the data center which you
0:23:29can't really do anything about which is
0:23:31awesome because you can't do anything
0:23:32about it yeah you know you go you go on
0:23:34Twitter and you apologize to your users
0:23:35and you just wait for the host to fix it
0:23:37yeah and that's great it's it's there's
0:23:40nothing to be done and that's gonna
0:23:41happen no matter where you are to like
0:23:43originally I think oh well you know
0:23:46maybe I if I was using something else I
0:23:48wouldn't have this problem but it's like
0:23:49everything has this problem like I've
0:23:52been on a lot of hosts before they've
0:23:53all had outages yeah like those are just
0:23:56built into it but like beyond that
0:23:59there's not that many of things that
0:24:00happen like usually the issues I run
0:24:02into you like the most common thing that
0:24:04I'll hit is something like a machine
0:24:08will run out of disk space which seems
0:24:10kind of basic but it's happened to me
0:24:11several times where I turns out I have
0:24:13some log file that isn't being rotated
0:24:15correctly and it's you know it's just
0:24:18like my machine it's completely out of
0:24:19space and so some things it'll just like
0:24:22start falling over in a really confusing
0:24:23way so I just go and check on my servers
0:24:26every now and then and just like make
0:24:28sure that they have space and the space
0:24:30isn't
0:24:30getting smaller and smaller because most
0:24:31servers should just be very stable and
0:24:33unchanging and once you do that things
0:24:36are pretty good and then you run into
0:24:39unfortunately the the next most likely
0:24:42case of problems is probably what we
0:24:44would call human error and unfortunately
0:24:48you are the human that is causing the
0:24:50error
0:24:51so we've when you're administering your
0:24:53own servers you have all these little
0:24:55opportunities for you to do something
0:24:57that ends up breaking your back-end I've
0:25:01run a deployment to one of my to my via
0:25:03RSS syncing system feed Wrangler or I
0:25:05roll the deployment out that dropped the
0:25:08main feed item table accidentally that
0:25:11was that was an interesting test of how
0:25:13good my backup strategy was and took the
0:25:16service down for four hours but you know
0:25:19that's why you have backups and that's
0:25:21why you eventually learned to be very
0:25:23very very careful whenever you're
0:25:26touching your production databases yes
0:25:29yeah database backup is very very
0:25:31important
0:25:32every VPS provider I know of supports
0:25:35snapshotting the machines backup usually
0:25:37you have to do something special to
0:25:38backup a database because you can't just
0:25:40like copy the file and have it be
0:25:42consistent but there are tools for every
0:25:43popular database to take like snapshot
0:25:45backups of them and dump them into files
0:25:47or whatever so so look into that for
0:25:49your database of choice for MySQL it's
0:25:51definitely a extra backup as the one I
0:25:53recommend from Percona Postgres probably
0:25:55you Postgres people you probably go oh
0:25:57just automatically does this for you you
0:25:58don't have to even think about it cuz
0:25:59Postgres is amazing in MySQL you know
0:26:01bad but right is that is that roughly
0:26:03correct not exactly I used a thing
0:26:05called Wally as my backup system which
0:26:10is yeah like the nice thing about a most
0:26:12good backup systems to with databases is
0:26:15they can often allow you to do point in
0:26:17time recovery mmm which is really
0:26:20helpful for that kind of a human error
0:26:22problem where you issued a particular
0:26:24command at a particular time and that
0:26:27destroyed all your data so like even if
0:26:29you had like your backup if you had a
0:26:32snapshot right afterwards like wouldn't
0:26:33you know it's like you need to recreate
0:26:35the database you need to go back in time
0:26:36and like undo queries and so if you have
0:26:39an a system where that uses point in
0:26:42time recovery which I don't like while
0:26:43he does and I'm sure there's
0:26:44sequal things to do the same thing like
0:26:45you can kind of replay what your
0:26:47database was doing and recreate it like
0:26:49just before you were an idiot yeah bitch
0:26:51binary logging in my school yeah which
0:26:53is awesome being able to do that is a
0:26:55tremendously helpful thing hopefully you
0:26:57never use it but you know I think given
0:27:00that we've both done it or done things
0:27:02like that it probably happened at some
0:27:04point and you just want to be prepared
0:27:05oh yeah one thing also uh you know
0:27:08earlier research about automating as
0:27:09much as possible with the set up as much
0:27:11as you can automate the the health of
0:27:14your servers like you know Pingdom
0:27:16monitoring for the overall uptime of
0:27:18your app is great one thing I do to
0:27:20prevent like your disk space issue is I
0:27:22have to Pingdom alerts for any surface I
0:27:24run one of them is is it up and that
0:27:26one's on high alert if anything goes
0:27:28down it that would like the main site is
0:27:31down then everything of mine beeps and
0:27:34vibrates like everything alerts me but I
0:27:36also have have a lower class one usually
0:27:39called stats or vitals where that hits a
0:27:41special URL which checks all the servers
0:27:44for things like low disk space and very
0:27:47high CPU load and things like that and
0:27:49it it gives Pingdom a down result if
0:27:53anything like that is out of whack and
0:27:56then it's logged in a place that I can
0:27:57see like what caused this so I can see
0:27:59Oh at you know at noon every day this
0:28:02server has a really high load or I can
0:28:05see oh this server right here has low
0:28:07disk space right now so I'm never
0:28:08surprised by things like low disk space
0:28:11or very high load because I have that
0:28:12automated and being automatically
0:28:14checked by another Pingdom check yeah
0:28:16that's a great idea like it's it's it's
0:28:18those types of things that you're just
0:28:20trying to think of ways to anticipate
0:28:22the problem before it happens yeah I
0:28:24mean even like a low-tech version of
0:28:25that which I've done on some servers is
0:28:27you just put a cron job that runs every
0:28:29five minutes that emails you of disk
0:28:31space is too low yeah worst case
0:28:33scenario you wake up to a pile of 40
0:28:34emails okay you go you go and fix it
0:28:36like so it's yeah it's great there's so
0:28:39many easy ways to do this kind of
0:28:40automated maintenance of servers now
0:28:42it's running a server is really not as
0:28:45hard as you might think if you've never
0:28:47done it before yeah and I really think
0:28:50that if you can't if the things that
0:28:51we're talking about this week sounds
0:28:53scary like that's an important thing to
0:28:55get over and get used to and comfortable
0:28:57with
0:28:58because as a developer it's just like it
0:29:01feels like it's like in some ways like a
0:29:03very basic skill that if you can't do
0:29:06you're kind of holding both your your
0:29:09work back in terms of the things that
0:29:10the the level of complexity of other
0:29:12projects you want you can take on as
0:29:15well as your career in terms of like the
0:29:16things that you're able to do and the
0:29:18things that you know the jobs you could
0:29:20potentially get and those kinds of
0:29:21things like these are useful scales that
0:29:23don't go out of date if you know at a
0:29:25basic level like how to administer a
0:29:27server that's always going to be useful
0:29:29and interesting like I don't think
0:29:30that's going away like as much as new
0:29:32high level abstractions and things up
0:29:33here like that's cool and all but like
0:29:36UNIX has been around for a very long
0:29:38time
0:29:38for very good reasons all right we're
0:29:40out of time this week we'll probably
0:29:41cover more of these topics in the future
0:29:43or expand on them so keep listening if
0:29:45you want more of this or anything else
0:29:46for that matter because we are great and
0:29:48you can keep listening to our show
0:29:49thanks a lot for listening everybody and
0:29:51we'll talk to you next week
0:29:52bye