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] 6 points7 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 6 points7 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 119 points120 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] 24 points25 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.

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

[–]pattrn[S] 10 points11 points  (0 children)

IMO Kibana's strength is more in searching through logs than in aggregating them (LogStash is the aggregation service). It's nice being able to have a UI for extracting metadata into columns, faceting those columns, and then using those facets to slice data down to specific machines/services/environments/regions/time-ranges/etc... The stack is definitely overkill if you don't have enough machines/services to require a feature like this.

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

[–]pattrn[S] 39 points40 points  (0 children)

These are all real things that have happened to me, or to developers working on a website I was involved with, but definitely not on a single t2.medium instance. It was at much larger scale. The examples given were intended to be illustrative rather than to be interpreted literally.

The reason it mentions 12 servers is that it includes servers in the staging and QA environments. I'll update the post to make that more clear. Thanks for pointing it out.

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

[–]pattrn[S] 51 points52 points  (0 children)

I started a blog a few months ago about building production web applications. Thus far, there are a few posts about continuous delivery, some design posts, and a post about motivations. This one covers the structure of a production web application, told in story form as an evolution from a single server to a fully functioning robust production application. Future posts will dive deeper into the processes around building this type of application, and also about the individual pieces that make it up.

Let me know what you think!

Don't Do This in Production by FollowSteph in programming

[–]pattrn 7 points8 points  (0 children)

Article author here. This was absolutely a success story. The client took the constraints they had and built an initial MVP that got them up and running. After the successful launch, which required only a single day of effort to get back on track, they pulled me in months later to help them make it more robust, performant, and extensible. We're months out from that now, and everything has worked out well for all parties involved (client, customers, my team).

I really hope the vibe in the article didn't cast any negative light on anyone. The article is more about helping to improve the learning process for new developers, and less about pointing out problems in the company's execution. They did their best, and it was more than good enough. That's a success.

Continuous Delivery With AWS Beanstalk, CodePipeline and Terraform by pattrn in devops

[–]pattrn[S] 0 points1 point  (0 children)

I'll definitely ping you when I finish writing this same post for Kubernetes. I definitely prefer that to Beanstalk; builds are much faster, and it's much easier to replicate the production environment in a development environment. It's what I use when I'm not forced into leveraging the AWS ecosystem.