Back in 2013, I gave a brief talk at php[tek] which was about all of the things you need to learn along the way to be a developer. I promised I would put up the list from my notes — and as you can see from the date, I pretty much failed on that promise. However! I found the notes! So without further adu…
- Broaden your general PHP knowledge
- PSR-0 (and other PHP-FIG initiatives)
- Code versioning (Git, SVN, anything…)
- Dependency Managers (Composer!)
- Design Patterns
- Unit testing
- Basics of encryption
- Public and private key encryption specifically
- Code smells
- HTML & CSS
- UI integration tests
- Learn about build automation tools (phing, make, ant, jenkins, travis)
- Learn about deployment automation (capistrano, dploy.io, etc…)
- Pick up some solid Linux administration skills
- Code smells (MOAR!)
- Pick up more languages
- More design patterns
- More code smells
- Better your testing approach
- Programming styles
- Object Oriented
- Event Driven
- Build on a new type of platform (notice the “web” in “Web Developer” went away up there?)
- Build a desktop, or mobile app.
- Build a server daemon.
- Build command line tools.
- Learn to do Security Model assessment
- Pick a new thing to learn, and learn it!
- Teach others what you just learned
- GOTO 1
It occurred to me this morning that there are actually quite a few parallels between functional programming and infrastructure design and management.
It all started by what I realized that I said while talking about environments: Production is meant to go from one stable, working, vetted version of code to another stable, working, vetted version of code. Any state between those two is invalid and should (preferably) never occur.
If you cycle on that again, you start to see that most deployment processes you know about violate this One Basic Rule(tm).
I posit that if you are deploying new code to currently running hosts that are handling traffic, you are doing it wrong.
Think about it like this: what is the one core feature of every highly scalable functional programming language? Every one has (or has developed patterns which essentially create) immutable values.
So when we scale this out of software and apply it to infrastructure, your code is the value of your server. If you are changing the value of your server while other processes are trying to access it, you’re going to run into concurrency issues. Ask any developer about sharing data between threads, and they’ll quickly tell you it’s difficult. Why, then, do we improperly share data between releases of our software?
The simple answer is that you have two options for atomic deployments that follow the rules of immutability:
- Drop the servers you are deploying to out of the flow of traffic. This is the easiest, but still fails to honor the spirit of immutability because the value of the server is still changing, it’s just changing while nobody is looking.
- Spin up new instances, and slowly work them into live traffic, confirming along the way that you are in fact getting the expected behavior out of the code.
Now, I know this is all hand-wavy because it glosses over the important aspect of data migration: I don’t have an answer there, yet. I suspect the true answer to that part of the solution would be something to the effect of being able to seamlessly decouple your entire system from write traffic (using a request proxy which could ‘pause’ calls) for some period of time while data updates are done.
What if, to create a truly fault tolerant design, you simply create a nearly 100% asynchronous API. All requests come in and go into a process queue, and are handled from there. This way you are never required to turn off traffic to do an atomic update of your software because you can simply tell it to stop processing while the update progresses.
This week, I am in Louisville, KY at Code PaLOUsa! Next week, I leave for SXSW Interactive in Austin, TX. Right as I get back from SXSW, I take off for Midwest PHP in Minneapolis, MN.
I’m speaking at Code PaLOUsa and Midwest PHP, so if you’re around, be sure to come check out why you should care about development environments, and how to go about implementing them in your organization.
I love to meet new people, so if you see me, please come say “Hi!!” and introduce yourself.
This weekend I was invited by a few friends from the Ann Arbor PHP User Group to join them on Saturday night and figure out something to work on together.
TLDR: I need to do this more. It was immensely fun.
So it started off with a few ideas flying around on what to build, and then I’d mentioned that I have wanted to build an app for estimation poker since forever. Also — it seems I can be somewhat persuasive.
So the four of us sat down (Jonathan, Kelly, Jason and I) and we sorted out what our MVP (Minimum Viable Product to those of you who don’t live in startup land) was going to be. We settled on features and the basics of the protocol, and then had to pick technology. I’d seen that Ember.js seems particularly well built for building a multiple concurrent user system, so I suggested that, and I believe it was Jonathan who suggested Node.js for the back end, and of course — socket.io for communication. Jonathan and Jason would pair to build the back end, while Kelly and I would take the divide and conquer approach for the front end. With all of that decided, there was only one other choice to make…
Because it’s a fun name to say, that’s why.
So as of today, the minimum viable pieces are actually working. You can check out the github repository, or even see the live demo up on Heroku. I’m hoping we can maybe look at using it at work to help encourage participation during planning meetings perhaps, but even if that never comes to fruition, it has certainly been a fun project to work on, even just as far as it is now. It still has a lot of rough edges, but you can see it starting to come together.