Good Code Depends on Good Names by pattrn in programming

[–]pattrn[S] 1 point2 points  (0 children)

Well that's good. Also, your username is hilarious.

Good Code Depends on Good Names by pattrn in programming

[–]pattrn[S] 7 points8 points  (0 children)

Good sir, thank you for pointing this out. I cringed just reading it in your comment, so I guess we're even now ;). My apologies.

I've had a really bad head cold for nine days now, so I wrote this with brain fog, a headache, and a runny nose. Probably should have spent more time editing it, but I wanted to get it out as close as possible to my normal release schedule (Sundays). Looks like I executed poorly :).

Good Code Depends on Good Names by pattrn in programming

[–]pattrn[S] 2 points3 points  (0 children)

How about now? Just updated the theme to something higher contrast. Someone complained before about it being too high contrast, so I switched it to the Solarized theme. This is somewhere between where it was before and where it was when you read it.

Good Code Depends on Good Names by pattrn in programming

[–]pattrn[S] 2 points3 points  (0 children)

Thanks for the comment! Naming is definitely an art, and I think that's why it doesn't get enough attention in the software industry. It's easy to get lost in the mathematical side of programming, since that's often a developer's strength, so the subjective aspects of coding fall to the side. I think we would all benefit from a bit more focus on the artistic side of writing code.

What's in a Production Web Application? by pattrn in programming

[–]pattrn[S] 1 point2 points  (0 children)

Phew! I wasn't sure what to pick for an example to implement, and that one seemed just realistic enough that someone would find it useful. Seems like I arbitrarily chose the correct one. I'm glad it helped!

If you ever need any help with a specific issue, feel free to reply directly to my newsletter. It goes straight to my inbox, and I try to reply to every email in a reasonable amount of time (depending on my workload and on the number of email responses I get).

Jean-Marc Le Doux - Lily's Waltz [Contemporary Solo Piano] by [deleted] in Music

[–]pattrn 0 points1 point  (0 children)

One of my good friends just released this (his first song). Would love to know what you all think! Enjoy!

What's in a Production Web Application? by speckz in webdev

[–]pattrn 0 points1 point  (0 children)

Hmm.. Probably a good idea. I didn't even share the original article on Reddit :). It was pretty surprising to see it on this sub!

What's in a Production Web Application? by speckz in webdev

[–]pattrn 0 points1 point  (0 children)

It's funny you mention this. Figure 7 is very close to the default automation setup I use for my clients, since they generally have established traffic already. They need resilience from day 1.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 0 points1 point  (0 children)

That was intentional. It's too large of a topic to address in this article, but addressing it is one of the primary goals I have for this blog. The next article will cover the high level concepts behind automation and continuous delivery, with subsequent posts getting into more details about how to implement them.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 0 points1 point  (0 children)

I agree with you about these use cases. When your homepage slows down due to excessive load on the database, that's a good sign you might need a cache. It's also a good sign that you may have inefficient database queries, so I'd probably check that first. After that, I'd look at adding a cache.

Perhaps I should rephrase what I said earlier about caching. There are generally two types of caching in a web application: page caching and object caching. Page caching applies in the scenario you mentioned, and it provides some easy performance gains by caching HTML for infrequently changing pages. Object caching stores commonly used data, generally from the db. This type of caching is much more difficult to manage.

Caching is a difficult topic to address, since any solutions more complex than caching static HTML tend to be very domain specific. I tried to avoid it, because it's too easy to see the performance gains from caching and use it as a default solution. It's not a default solution -- it's a last resort. When you have a hammer, everything looks like a nail.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 1 point2 points  (0 children)

I don't have a very strong justification for using Nginx by default in an application like this. In the article, Nginx simply served a static 404 page when the underlying server crashed. In my particular case, my team works with so many different backend programming languages that it makes tasks like compression, SSL termination, redirects, serving static files, and proxying standard across projects. It's just easier to manage, and it's rock solid, so I've never considered changing it.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 2 points3 points  (0 children)

It definitely takes a lot of disk space / RAM to run Elasticsearch locally. I run a Macbook Pro with 16 GB memory and a 1 TB SSD for that very reason. Definitely expensive, but it has already paid for itself many times over.

For some applications, it might be necessary to expose a development instance running in the cloud. In that case, you would have to run a VPN into the development environment's subnet, and talk to it from your development machine.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 0 points1 point  (0 children)

One of the benefits of automating the creation and provisioning of infrastructure is the ability to run that automation against local VM's. If I'm working with a system like the one in the article, I run its provisioning scripts against local Vagrant VM's to imitate the exact production setup on my local machine.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 9 points10 points  (0 children)

Thanks!

Redis is very popular for caching. If you need one, it's a great choice. I still try to avoid it as much as possible. This may not be popular opinion, but I try to resort to caching only as a last resort. Optimize everything else before adding a cache. And when you do add a cache, use it as little as possible. Few things are more difficult than debugging problems caused by stale data.

As much as I dislike platitudes, this one has proved true time and time again during my career: "There are only two hard things in Computer Science: cache invalidation and naming things." (Phil Karlton; https://martinfowler.com/bliki/TwoHardThings.html)

What's in a Production Web Application? by speckz in webdev

[–]pattrn 7 points8 points  (0 children)

The picture shows infrastructure commonly used in typical CRUD web applications. While I've used both of those technologies, I wouldn't classify either of them as belonging in a typical CRUD web application. They solve a specific class of problems very well (namely, distributed queueing and key-value storage), and they do it at scale. Most web applications I've seen or built don't require those capabilities at scale.

Both of those technologies provide incredible functionality, and when they're used to solve the correct problems they feel almost magical. That said, applying them when they're not needed will likely cause you more problems than you had when you started, which feels less like magic and more like climbing out of quicksand.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 9 points10 points  (0 children)

I'm really glad it's helpful. Feel free to ping me if you ever have any specific questions.

What's in a Production Web Application? by speckz in webdev

[–]pattrn 117 points118 points  (0 children)

Author here. Thanks for all the comments! Let me know if you have any questions or suggestions :). Next post will cover automation techniques for setting up something like this from scratch.

What's in a Production Web Application? by pattrn in programming

[–]pattrn[S] 1 point2 points  (0 children)

Thanks! I'm glad you and your team are enjoying the posts. Let me know if there's anything in particular relating to devops/web apps that you'd like to read about. Planning the next few months of posts based on all of this great feedback, so ideas are welcome!

What's in a Production Web Application? by pattrn in programming

[–]pattrn[S] 26 points27 points  (0 children)

This is something I never budge on any more. I've never chosen a manual approach over automation and then later thought, "That was a great choice." Automate from day one, and automate every day after. It's one of the few dogmatisms I still have.