Java application servers: I’m starting to think I’m not smart enough
As a currently-side-but-soon-to-be-main project for work, I’m looking at options and ideas for deploying Java web apps.
Our current infrastructure is normal and boring LAMP: DB server and N Apache+PHP boxes. Our app makes heavy use of SSL so we can’t do name virtual hosting. The current application gets “installed” into each sites docroot.
The “obvious” first solution is Tomcat with the Apache connector. This seems to work on paper: we already have a lot of “institutional” knowledge (despite Tomcat not really having shit to do with Apache proper), it ships with our distro so updates are handled without extra work, we actually have an Apache+PHP+Tomcat instance running for a customer (someone else did the Java) and despite a few glitches and pains (that large-scale dev would require me to solve), it actually works, is stable, and performs well.
I am perhaps swayed by fancy screencasts and white papers about other app servers, though: many offer fancy admin panels that show all sorts of exciting telemetry like memory usage, deployed apps, etc etc. I am not sure Tomcat offers anything even remotely like that. We’d have to write it; and we’re already considering a huge leap to a new platform and tool chain, so the idea of making lots of tools is both appetizing (great way to get deep into the guts of the platform we’re going to have to support) and depressing (I’d rather spend time on the actual app).
Many app servers are essentially repackaged Tomcat with additional pieces bolted on. But there’s your value-add: the very thing I mentioned. That shit takes work.
Other app servers, like JBoss, confuse and confound. Their FOSS offering is loose components, a big pile of Lego all over the floor. I have a $0.00 budget for this project but I can see how throwing some scratch at JBoss and saying, “Just send a fuckin tarball with the pieces I need” is extremely appealing. If integration took longer than a week to get ‘Hello, World!’ up and running, it’s a complete no-go.
There are additional hangups I can’t find clear answers to. Nearly all app servers seem to operate on the same conceptual model: the app server “owns” a domain, and apps are installed “into” it via URLs hung off /, eg www.dom.tld/app1, www.dom.tld/app2, etc. Each .war is installed as a separate instance.
I can’t figure out how to do “shared code” with wars and app servers. The way I was going to do it with PHP was, I’d build a more or less standard ZF app but each dom’s docroot would contain only the bootstrap and per-site views and layouts. That way everyone is running on the same bits. App upgrades upgrade everyone. You pay a price in complexity by spending a lot of time wrangling paths in your bootstrap (you ordinarily don’t need to, beyond setting the top level) but that’s about it.
Since Java apps are deployed as zipped blobs, and each instance is “unique”, I can’t even see how I’d do this, since it relies on a small amount of per-virtual-host wizardry separate from the blob. My understanding is, you can’t do that. Maybe I’m wrong? This shit is confusing.
Lastly I’ve considered using Apache or some other httpd as a proxy to an app server (probably nginx for performance reasons). I could install each instance in a URL off the app server’s notion of ‘/’ and proxy everything, so www.dom.tld maps to ‘internal.local/dom’ and www.dom2.tld maps to ‘internal.local/dom2′ and so on. This doesn’t necessarily solve any of the above problems, save for not asking the app server to do anything crazy.
All of these seem like ridiculously normal cookbook problems: I’ve got decent Google-fu and I find nothing. I also note that there’s very few Java-oriented hosting companies, which is essentially what we’re considering becoming (albeit hosting only our own app).
I should note that utilizing our app in a shared manner, a la Paypal’s skinnable-but-shared checkout service, is unacceptable. Our customers specifically reject a skinned app that takes them off their domain.
A quick question
It’s a pretty fair statement that Americans want change in the way health care is handled: just about every poll shows a majority or statistically significant minority are to some degree unhappy with cost, availability, or whatever.
So I was wondering:
If the Canadian health care system is so horrible, why aren’t Candians trying to change it?
A few quick Google searches at least implies to me that there are close to 0 Canadian organizations devoted to overturning it and replacing it with an American/corporate model.
Similarly the bulk of the criticisms of Canadian health care seem to come from Americans, who are not living on the Canadian border and do not regularly get health care in Canada. Oh, sure, they found more than one person who had a long wait or something; but please google “selection bias” if you’re not sure how that matters.
Dual Lives
I think I had a minor epiphany today, about work. I’ve always had this difficult-to-pin-down thought about why we do certain things, and how we should be doing certain things, and how I’m eternally restless about things I perceive as “broken” but feel powerless to fix. It finally hit me.
In short, our particular niche is completely bipolar. On the one hand, I’m constantly railing that we need to be “agile”, we should be making copious use of new technologies and methodologies, we should be able to build the company on laptops at a Starbucks.
These things are true. Our main app is a fucking PHP script. Agility should be our “secret” weapon.
But, that’s not entirely the case all the time. First, there’s a difference between a typical Silicon Valley startup (eg, Digg) and us: oh yeah both are LAMP+secret sauce, but we have so many more considerations. We deal in actual money, we have actual paying customers whose entire income may come from our app. Security is beyond important. Features get added not just to entice new customers and impress current ones, but to deal with real business problems.
Put another way, this side of our business is firmly rooted in the traditional BigCo software development methodology. We should have notebooks full of UML diagrams, and be genuinely concerned about design patterns, and use zOMG FRSRS this-that-and-the-other (CI, etc). Eg, no hacky solution to a problem them move on; documented in triplicate after being tested to death.
Bridging these dual worlds is pretty much impossible. I think every company, at some point, wants to be “big” without being overly formal, bureaucratic, and process-heavy. I’m pretty sure it never works, too, if the various “how to manage a tech company” sections at B&N are any indication.
Some companies manage; I would assume 37Signals manages to be “enterprise” without the bullshit. But not every company can be them: it’s not that we’re not awesome but our mix of product, personalities, and customers is not the same, so it’s always apples to oranges. You can’t just WW37SD? because you are not them!
So that’s where we are, and one of the many reasons why I’m so grumpy. We keep missing the glorious, glorious 10-ring of Big Company Process To Protect Us From Ourselves and Little Cowboy Hacker Shop.
Your trails, let me run them.
So I did a reasonably strenuous but nonetheless beginner trail run this weekend: I ran the Big Schloss trail (this one, not this one). I did the 4.4 mile trail in exactly 60 minutes (exactly 30 minutes each way – very odd) and learned a few lessons which may be of interest to beginners.
First: HOLY JESUS FUCK, do not assume that downhill will be any easier than uphill. Yes, it’s all massive OMG-QUADS-ON-FIRE going up, but going down, it’s serious impact on your feet, ankles, and calves; and somewhat unexpectedly it seemed to require a huge amount of core tension. I know from experience hiking that downhills can be hard, but magnify that by several times over when trying to maintain a running pace.
Second: don’t be afraid to walk. Or, put another way, remember that this little hobby is considerably more risky than running on flat, groomed trails or roads. There’s obstacles galore: rocks, lose gravel, mud, roots, branches … If the terrain ahead looks potentially risky, slow down. On more than one occasion I stumbled and thought to myself, “had things gone ever-so-slightly worse, one or more of my feet would be pointing in the wrong direction”. Don’t forget that a wet rock often looks like a dry rock, a deeply set root like a loose stick, loose gravel like hard-packed gravel. Shit happens: be careful.
Third: Consider fueling. I brought along some Gu. I noshed a packet at midpoint and spent a couple minutes hydrating. It seems silly to consume something after only 2 miles (my regular warmup is a couple miles on the treadmill) but it helped. A packet’s only 100 calories and weighs next to nothing. If like me you’re still in a training/development mode, it’s nice to have handy if you feel like you need it.
Lastly: Pay attention around blind curves or when coming to rises/ridges. You’re making more noise than usual, you might freak people the fuck out.
How’d you spend your afternoon?
Them:
Listen here, boss. Right now things are really complicated. What we’re trying to do is make them more complicated. Also, I’m breathtakingly stupid and really, really unqualified for any of this. What I’m hoping we can do here is throw all this shit in your lap, you know, make it your problem.
Me:
um, but the process cannot be completed by me; and really, you’re just making things worse. leave them alone. the ‘problems’ you’re trying to fix exist only in your mind, because you’re stupid.
Them:
Now you wait a minute. I don’t know what I’m talking about but I know what I want, smart guy, so shut the fuck up while I kick some awesome science. None of this will make any sense but it sounds really cool, so HOLD THE FUCK ON.
BLAH BLAH BLAH WORDS WORDS WORDS WORDS WORDS BLAH BLAH BLAH
How about THAT SHIT, internet guy?
Me:
Clearly, you have a staggering intellect.
NORTH KOREA IS BEST KOREA
The Korean War has a weird place in the American war pantheon. Everyone pretty much assumes we “won” and no one’s entirely clear how there can be a technical state of war for 50 years.
The whole war is extremely complex. China and to a lesser extent the Soviets became a huge spoiler for what was a mostly cut-and-dried regional conflict; the North Koreans caught the poorly trained and ill-equipped South Koreans by surprise, but withered when faced with “modern” American combined arms warfare.
So I guess the big question now is, “Just how much does China value North Korea”?
You can pretty much assume we’ve already got every possible nuke storage site assholed already; say what you will about Barry I seriously doubt that he didn’t allow every available Tomahawk-enabled sub to be put on station. Some shock-and-awe action could eliminate their ability to go nuclear, if they can even make nuke attacks.
But, as in 1950, how China intends to deal with any action is critical.
My personal opinion is that they (China) see NK as useful idiots: irritate the US and its allies, keep us busy and distracted. They probably want a North Korea that’s just nuclear enough to stress everyone out, but I can’t imagine the Chinese want NK doing something stupid like randomly launching a nuke at Tokyo one sunny Thursday.
It seems consistent with modern proxy warfare to allow us to bomb NK a little closer to the stone age, then jump in and demand peace. This makes sure commerce (a key Chinese concern) is not ruined, but the useful idiot is now knocked down a peg by its arch-nemesis, keeping them hungry and angry at the Americans. China then makes a bunch of concessions and promises to oversee the peace. With Kim Jong Il with a foot in the grave, you can restructure NK to be more … useful to you.
Simplifying.
In today’s instance of “shuffling around things”: I’m dicking with my email.
The short story is, “you probably ought to send stuff to gregg@neurobashing.com and stop worrying about where stuff I send you comes from“. The corollary to this is “just hit ‘reply’ and stop thinking about where it’s going”. Trust me: I know internets.

You’re going to have to trust me that I know enough about how to manage multiple email accounts that everything will arrive in the right place.
Congrats on making me hate my iPhone, Apple
Between the shittiness of AT&T – how is it I sound like I’m talking to someone over a sat phone during a solar flare storm while in a cave in a combat zone, when I have lots and lots of bars? – and stories like this, every time I look at my iPhone I get a little more angry.
One imagines the reviewers making sure an e-book reader can’t access ‘120 Days of Sodom‘ as well. I wonder, does AAPL query the RNC for its list of books to ban?
The entire app review process sucks. In the aftermath of the baby shaking app approval, it’s obvious there’s no sanity there. It’s stupid and arbitrary; I imagine it’s a 100% true statement to say it keeps malware and epic fucktons of porn out of the App Store, but it’s unfairly catching too many honest developers.
So, I’m helping raise a stink, making me an essential part of the app review process.





