Podcast Search

Developing Perspective

#179: Avoiding the Stampede.

Select a time to play from there. The line being spoken is highlighted as the audio plays.

0:00:00Hello and welcome to Developing Perspective.

0:00:02Developing Perspective is a podcast discussing news of note in iOS development, Apple, and

0:00:06the like.

0:00:07I'm your host, David Smith.

0:00:08I'm an independent iOS developer based in Herna, Virginia.

0:00:11This is show number 179.

0:00:13Today is Thursday, April 3rd.

0:00:16Developing Perspective is never longer than 15 minutes, so let's get started.

0:00:19All right, so I'm finally back from all of my travels and conference speaking, which

0:00:24all I'd say went pretty well for some of my first times out.

0:00:28But I'm glad to finally be able to button down in April, probably be focusing more on

0:00:33building things rather than just talking about building things.

0:00:35Which I guess is somewhat ironic, even that I'm starting off the month talking on a podcast.

0:00:40But anyway, so unless you live under a rock or in under a rock that only has internet

0:00:46such that you can download 15 minute podcasts, you probably heard that this week WWDC was

0:00:53announced, which is a delightful break

0:00:56from their typical pattern, or by typical,

0:00:58I mean what they've done the last couple of years.

0:01:00They announced in late April, where they've

0:01:02announced now nice and early.

0:01:04We have the dates.

0:01:05It's the first week in June.

0:01:06And they're doing something different this year.

0:01:08They're distributing tickets through a kind

0:01:11of more of a lottery, or a random selection,

0:01:13I think is how Apple called it every time.

0:01:15And I'm pretty excited about that.

0:01:17The more I thought about it, the more it kind of became obvious

0:01:19that this is where they were going to have to go,

0:01:22that the old system that was largely based on either knowing

0:01:27when tickets were going to be in terms of having alert systems

0:01:29and things, then rushing and doing it,

0:01:31what they tried last year with the stampede,

0:01:34those are all kind of-- they just don't scale well.

0:01:37And the only system that scales once you have too high--

0:01:41way too high demand for the number of tickets

0:01:43you have available, if you don't want to or can't increase

0:01:46the number of tickets, is to go with something like a lottery.

0:01:49And so that's what they did.

0:01:50We'll all put our names in the hat.

0:01:53You have until, I believe it is 10 AM on Monday to do it.

0:01:56So if you have a chance between now and then

0:01:58and you're wanting to try, by all means do.

0:02:02But then through some process, randomly

0:02:05select 5,000 names out of that hat.

0:02:09And if you get one, great.

0:02:10And if you don't, I'm sorry.

0:02:13But by and large, I think this is a great improvement.

0:02:15And hopefully it'll go well.

0:02:17And this is where they'll be heading going forward.

0:02:20would expect. And I think it's generally good because while no system is perfect,

0:02:24there's no way that they can build, you know, build a structure for getting

0:02:29tickets where everyone who wants a ticket will get one. That's impossible,

0:02:33unless they're able to drive down interest in developing for Apple's platforms to such a

0:02:38degree that there's no longer 5,000 people who want to do it, which seems very unlikely.

0:02:42Or they would have to do something like, how would you determine who are the, you know,

0:02:49the 5,000 correct people to get it,

0:02:50in terms of for some definition of correctness.

0:02:52Some people would say, like, oh, I want the old guard

0:02:54to always get their tickets.

0:02:55The most successful people should get their tickets.

0:02:57The newest people should get their tickets

0:02:59so we can build the platform.

0:03:00The youngest, the oldest.

0:03:01I mean, you could imagine whatever you want.

0:03:03The reality is you just want to do it randomly.

0:03:05You just want to give everybody a chance, an even chance,

0:03:08an honest chance to get a ticket.

0:03:10And then from there, just hope everyone

0:03:14gets seen as sort of hope things--

0:03:16people understand if they don't get one.

0:03:18And on the flip side, I hope the people who get tickets, use them, enjoy them, take them

0:03:23to full advantage.

0:03:25I'll be out in San Francisco either way.

0:03:26I've already booked my plane and hotel for the week.

0:03:29I'll be out there either way because it's such a wonderful week.

0:03:33Even if I can get a ticket, I'd still want to be out there to meet, sort of see the people

0:03:36who I only typically see once a year at DubDub, as well as just being around.

0:03:42It's a really kind of jazzing energy that is always kind of a motivating thing for the

0:03:45middle of my year.

0:03:46So that's kind of what I'm doing.

0:03:48I said make sure you put your name in the hat if you want.

0:03:51WVDC is really cool.

0:03:52If you've never been, I highly recommend having the experience at least once.

0:03:57You know, getting up early, waiting in line, going to some of the kind of special events

0:04:01that there aren't videos for.

0:04:02It's fun.

0:04:03Obviously it's kind of a bit of an expensive vacation, but it's definitely useful and fun.

0:04:09And I think there's something about it that is kind of a bit infectious.

0:04:14And so that's kind of cool.

0:04:15All right, so I'm going to be diving into the main topic.

0:04:18I'm going to be talking for the rest of the show.

0:04:20And it's a slight break for my App Store series.

0:04:23I'll be picking that up.

0:04:24I have a few more topics I want to talk up through.

0:04:26But with W3C popping up today, I wanted

0:04:29to make sure I had a full episode the next time I

0:04:31did the App Store thing.

0:04:32And so W3C took about a third of it.

0:04:34So I was going to do something a little bit shorter.

0:04:36And so it's going to be what I want to talk about,

0:04:38is server hosting.

0:04:40And this is going to be maybe a bit of a funny thing

0:04:42to talk about.

0:04:42But it really got prompted from a series of podcasts and conversations back and forth.

0:04:49I think it got started with Justin Williams was talking about it, Bart Garment, Brent

0:04:53Simmons, you know, we've done a lot of these back and forths about what level of abstraction

0:04:58is the appropriate place to find for your own application.

0:05:02So in the one extreme, obviously, you could build your back ends, you know, your and honestly,

0:05:07it's probably even taken even step further and say, almost every utility application

0:05:11these days uses some form of online backend.

0:05:14Maybe if you're a game, you can get away with it.

0:05:16But even then, you're probably using something like Game Center.

0:05:19Very few apps now work well as just the app in itself

0:05:24in complete isolation.

0:05:26You're always interacting outwardly,

0:05:28because that's often even what makes apps useful.

0:05:31And so if you're going to interact with something,

0:05:34you have to decide what you're going to interact with.

0:05:36Are you going to, on the one end,

0:05:38to kind of purchase very high level, very large building blocks, kind of building your

0:05:43backend with Duplo.

0:05:44You know, are you going to be sitting there and just kind of snapping some big blocks

0:05:48together to build your backend?

0:05:50You know, using things that are very simple, very well defined interfaces, kind of these

0:05:55big blocks.

0:05:56Or are you going to go farther and farther down the stack?

0:05:57Maybe you're going to go from Duplo to Lego and then at some point you're going to be

0:06:00building your own Lego, but you buy an injection molder to make it.

0:06:04And then you're going to be buying the machine that's necessary to build the injection molder.

0:06:09You could imagine if you brutalized that metaphor to go all the way from the Duplo all the way

0:06:13down.

0:06:14But at every level, you're making different choices.

0:06:18And there's always trade-offs between the different levels as you're going.

0:06:22And the reality is-- and I've worked at all of those levels.

0:06:27And so I feel like I have some authority to talk about this.

0:06:32But the reality is at every level, you're making trade-offs.

0:06:35And you're just choosing which trade-offs

0:06:37make the most sense for you and your product.

0:06:40And those are going to differ for every different--

0:06:42every project is going to have a different set of trade-offs

0:06:45that make the most sense for it.

0:06:47But here's some of the kind of things that I think about

0:06:49that will hopefully-- maybe I thought

0:06:50it would be helpful to kind of get you thinking as you're

0:06:52trying to plan out your back end,

0:06:54as you're trying to decide what makes sense for you.

0:06:56First is to say, every abstraction choice

0:06:59you make in your hosting stack is a leaky abstraction.

0:07:05And by that I mean, if you take the core functionality,

0:07:08say whatever it was, if the functionality is,

0:07:11I want you to take this picture and I need to put it somewhere

0:07:15and then retrieve it later, say it's a very simple operation

0:07:19conceptually, not simple to implement,

0:07:21but simple conceptually, I have these bytes

0:07:25that I need to put somewhere and then get back.

0:07:28Now I could use a service on the one end that

0:07:30was very abstracted, that basically just said,

0:07:33save picture, retrieve picture.

0:07:36That's all it did.

0:07:37It's very, very high level, very abstract.

0:07:40And that's great.

0:07:42Or I could go all the way to the other extent,

0:07:45I could build a web application who

0:07:48takes in some binary data, who then packages it up,

0:07:51and then take that binary data and I distribute it out

0:07:54to a content distribution network or whatever.

0:07:57And you could build and imagine systems all the way

0:08:01in between of those two things.

0:08:02Like, from a very, very low level,

0:08:04dealing with the raw bytes, putting them on disks,

0:08:07to something that's just like a web endpoint that you

0:08:10hit with a post method.

0:08:12Like, you could very easily kind of go in either direction.

0:08:16And understand that the very abstract version,

0:08:18you know, the very high level version, it's nice.

0:08:22It's easy to use.

0:08:22You're just like, here's my thing.

0:08:24I'm going to put it in there.

0:08:25And that's usually fine.

0:08:28But every now and then, little implementation details,

0:08:30little other things that are being hidden away

0:08:32are going to leak through.

0:08:33And so you have to understand what those are likely.

0:08:36What are those problems?

0:08:37What are those issues that are going to come back to bite you

0:08:40so that you can understand if those trade-offs make sense

0:08:44to you and those trade-offs are worthwhile to you?

0:08:47And inevitably, they will.

0:08:48Inevitably, they'll be things or cases or situations

0:08:52where you try using that backend in a way that it falls down.

0:08:57Say, for example, you have a very, very large image.

0:09:00You'd have a 10 gig image, and you try and send it

0:09:03to your very, very high level thing,

0:09:05and it's just the whole thing falls apart.

0:09:07Well, that's why I did it.

0:09:08Well, it's a leaky abstraction.

0:09:10Maybe it just isn't built to handle that thing.

0:09:12Or if you give it a very small file,

0:09:16you give it a zero byte file, maybe weird things will happen.

0:09:20Things that are just intrinsic in the way it was implemented

0:09:24that you won't necessarily find out right away.

0:09:27Now, obviously, those are contrived examples,

0:09:29but hopefully they kind of get you

0:09:30thinking of what I'm saying.

0:09:31No matter how abstract the front end interface is,

0:09:34there's always going to be back end implementation details that

0:09:37are going to affect you.

0:09:38So the first question you always have to ask yourself

0:09:40when you're doing this is, what can you live with?

0:09:45What are the things that you feel comfortable having

0:09:47to-- the constraints and things that you're

0:09:49have to place in your application as a result of making these choices.

0:09:54And also, whatever choice you-- the deeper down in the stack you go, the more flexibility

0:10:01you have, the more things that you can do, the fewer constraints you have overtly on

0:10:05your application, that you can do whatever you want.

0:10:08And that's awesome, and that's terrifying.

0:10:12If you can do anything, that means you can do anything.

0:10:14You can do really bad, horrible decisions that you then have to maintain and deal with

0:10:19forever. Or you can build awesome solutions to not problems that nobody else can solve

0:10:24because no one else has built the great back end. So you have to be thoughtful about what

0:10:29constraints do you want to work in? How big of a sandbox do you want to get messy in?

0:10:36Generally what I find, and this is kind of just a personality thing I think in a large

0:10:39degree, is that the more and more I do this, the deeper into the stack I go. And that's

0:10:46interesting because I suspect, I suspect there'll be a curve or a couple of curves, I guess,

0:10:51into this where as I keep going, I'll go deeper and deeper into the stack. And at some point,

0:10:57I'll likely sort of start coming back up again. And I think a lot of that has to do with the

0:11:03role that learning plays in this. Because as a developer, I love learning new things. I love

0:11:08learning new platforms and technologies. That's something that I just really enjoy. And so part

0:11:14of what's made feed wrangler, for example, really interesting

0:11:17from a personal level is that I'm learning

0:11:20a lot of great new stuff.

0:11:21I'm understanding now, feed wrangler

0:11:25is built from pretty small pieces.

0:11:27It uses Postgres, obviously, as a database, which is pretty big.

0:11:31But exactly how that's deployed and managed and orchestrated

0:11:35is all done by me.

0:11:36I'm SSHing into servers and editing config files

0:11:38and doing all this very low level stuff.

0:11:41And some of it was out of necessity

0:11:44because it's a very data-intensive application.

0:11:46But a lot of it, too, is just because it's really interesting to learn.

0:11:49And I can do things now that I wouldn't have been able to otherwise.

0:11:52And the number of times things that I can learn from implementing a UI table

0:11:56view again isn't as fun for me right now as it

0:11:59is for doing this really cool server networking stuff.

0:12:03And so that's kind of just really fun.

0:12:05And even beyond just being fun, I mean, it's cool.

0:12:10And it's weird to say, but it's just cool.

0:12:12Like this last week, one of my main database servers

0:12:15for Feed Wrangler was running out of hard drive space

0:12:18because I kind of poorly planned it.

0:12:20And so it's like, OK, I'll go and provision a new server,

0:12:23have it physically built in my data center,

0:12:26have that deployed out, set it up,

0:12:28configure all the security and the permission stuff,

0:12:31go and do all that, deploy Postgres onto it,

0:12:33set it up from a backup into a live streaming binary copy

0:12:38of the main primary master server that was starting to run out of space,

0:12:44get it set up so that the two are perfectly in sync and running perfectly forward,

0:12:47and then dynamically switch everything over to that being the new master,

0:12:52which is crazy.

0:12:53Like, the fact that I was able to-- and it actually worked.

0:12:57It's a funny thing when you roll out a server change and everything goes well.

0:13:01And that's almost scarier than things going poorly.

0:13:04But I've done this now a couple times.

0:13:07I know what I'm doing in a way that is really fun.

0:13:10And so I kind of would be sad if I

0:13:12was using a service that didn't-- I just hit a button

0:13:14and says, like, expand database size.

0:13:17Brrp!

0:13:18Like, that'd be kind of sad.

0:13:19I wouldn't be learning.

0:13:20And so it's kind of fun.

0:13:23Another reason I tend to go low level

0:13:25is I enjoy being able to optimize things

0:13:28for my application.

0:13:29I can work through a lot of bottlenecks

0:13:31that I wouldn't be able to if I didn't have access

0:13:34to much lower level stuff.

0:13:35things where I'm tweaking kernel values,

0:13:37when I'm changing the memory configurations on Linux servers.

0:13:40You can get really low level, and you can increase performance

0:13:43in tangible ways that you just couldn't do otherwise.

0:13:46It's pretty cool.

0:13:48One of the things is the realization

0:13:50that no matter what level I do it,

0:13:52I'm going to have to monitor the system.

0:13:53A lot of people say, well, I use an off-the-shelf system.

0:13:57I use Azure.

0:13:57I use AWS.

0:13:59I use something higher level because I

0:14:01want to have someone-- if something goes wrong,

0:14:03I want someone else to be trying to fix it.

0:14:05In some ways, that's better.

0:14:06But the reality is, if it goes down, it goes down.

0:14:08And I'm going to have to worry about that either way, which

0:14:11kind of sucks, but it is how it is.

0:14:14And lastly, it's often cheaper.

0:14:17And really, that's the bottom line for an indie like me.

0:14:21A lot of these services, I look at them like Azure.

0:14:24And it's just expensive.

0:14:26It's compared to me just running some raw Linux servers.

0:14:30It just doesn't really scale.

0:14:32And so you have to make that choice.

0:14:33You have to think about your application.

0:14:35Think what trade-offs you want to live with,

0:14:37what abstractions are leaky that you'd be OK with.

0:14:40And just find what works best for you.

0:14:42All right, that's it for today's show.

0:14:43As always, if you have questions, comments, concerns,

0:14:45or complaints, I'm on Twitter @_davidsmith,

0:14:47david@devlaucomperspective.com.

0:14:49Have a good week.

0:14:49Good luck on Monday.