4 ms·
The stateful application server is actually a common architecture for initial prototypes of new apps, because of its simplicity. Hacker News, Mailinator, Plent
by nostrademons 8y ago
The stateful application server is actually a common architecture for initial prototypes of new apps, because of its simplicity. Hacker News, Mailinator, Plenty of Fish, and IIRC StackOverflow were all built with this architecture.
Where it really falls down is when you have a team of developers all trying to add new features. Code changes a lot more frequently than data. With stateful app servers, every time you deploy new code you need complex and error-prone routines to bring the new process up, have it read the existing state, make sure it's consistent with the new features, and if not migrate it to the new format.
With RInKs, a huge benefit is that you can take the application up and down and all persistent state is already there, and usually the RInK itself handles persistence & error-checking (because it enforces a common data model itself). For minor UI tweaks and per-request features (which are a large portion of changes in the early part of the product lifecycle), you don't need to do a migration at all, the new version just magically appears. For more complex data format changes, you make it so that the application code can read both the old and new formats, converts old to new if necessary, and writes back only in the new format, and then you can drop the old format once it is no longer present in the persistent store. This lets you do the upgrade piecemeal, and avoids corrupting your entire data store if you do it wrong (because the architecture functions as a canary on every deployment, and you can rollback with zero to a handful of corrupted records if things aren't working properly).
The other situation where stateful app servers are useful is when scalability is much more important than change velocity. This may be why Google is coming out with this paper now. This would never have flown within Google when I was there (2009-2014), but I've heard that the focus on maintenance, performance, and architectural improvements is now much greater than that on new features, so it may be appropriate for the Google of today.
- sonnyblarney 8y ago"every time you deploy new code you need complex and error-prone routines to bring the new process up, have it read the existing state, make sure it's consistent with the new features, and if not migrate it to the new format." Pardon my ignorance ... but wouldn't a stateful model that used mem as true 'cache' not avoid that problem? As if to say the in-memory store is not 'pre loaded' persey, rather, it's loaded incrementally on a on-demand basis from the app itself? So 'rebooting' has the effect of flushing the cache thats built up over time after reboot, hopefully seamlessly? Or am I (probably) missing something?
- latch 8y agoYour upstream needs to be able to handle 100% of the load, which could be several orders of magnitude more traffic than it normally has to handle. Handling that huge spike in traffic for, what might not be more than a few minutes a year, can be insanely expensive. Also, you're potentially giving users a noticeably worse experience as you rebuild the cache.
- sonnyblarney 8y agoWell that'd be it then, thanks.
- shereadsthenews 8y agoOnly problem is the network caches in wide use at Google are significantly faster than what they are using as a baseline in this paper. It’s pretty misleading.
- graycat 8y agoNice. The paper anticipated in good detail just what the heck I did with its "These stores enable services to be deployed using stateless application servers [16], which maintain only per-request state; all other state resides in persistent storage or in a RInK store. Stateless application servers bring operational simplicity: for example, any request may be handled by any application server, which makes it easy to add and remove application servers, to handle server failures, and to handle skewed workloads." Yup, I thought that was a good idea. After reading more of the paper, for my project, I still think it is a good idea. Your remarks add weight to that view!
- bostik 8y agoIn all honesty, the paper describes a solution to a problem most companies won't need to care about. If processing latency for remote cache lookups is a performance bottleneck, it's likely you're already dealing with either enormous scale (Google/FB/Twitter/Uber/...) or some form of HFT (exchanges/hedge funds/banks/adtech/...) Amusingly enough, I have reason to believe those groups are over-represented in HN audience. They are also environments where computing capacity can make up a significant fraction of your overall engineering costs. In practically any other scenario the sub-millisecond delay is dominated and completely masked by your business logic taking tens to even hundreds of milliseconds per request. Remember - if you can return a response and a visual update to a client action within 100ms (including the network roundtrip), you're already operating in the lowest Nielsen band. Another funny thing about this paper is that it feels to me like people are rediscovering zero-copy network processing. Again, a topic dear to many HN hearts but unlikely to be a prime consideration for most companies.