4 ms·
your example is interesting. I assume the reason is that it's an in-between situation between stateful and stateless: aka shipping using 3rd party api is a tran
by bsaul 5y ago
your example is interesting.
I assume the reason is that it's an in-between situation between stateful and stateless: aka shipping using 3rd party api is a transient state of a complex process that can be ultimately recreated from the orders stored in the DB, but better not for speed reason.
I wonder if there are other patterns like that.
- di4na 5y agoAny kind of long held connection is state ;) So websocket, long http one, database connection, etc. Being able to tightly define what part of your app is impacted if one of these fail and restore it before the rest of the app is impacted is a game changer. OTP also deeply force you to think of how you start and how you stop these, taking dependencies into account. It helps in cleaning up stuff.
- bsaul 5y agosure. By state i really meant working end-user business-level data. Those are the kinds that really set the type of guarantees you need for your system. I guess i'll have to try OTP one time to understand why so many people rave about it. I only know one guy who had made real work with erlang / otp and he told me it was beautiful, but not quite as relevant anymore, because of k8s. But i guess i need to make my own opinion.
- ch4s3 5y agoIf the value you're looking for is just 0 downtime, then k8s solves that for you. As others have pointed out, the BEAM/Elixir/Erlang give you great process isolation and resilience to small failures, timeouts, weird transient issues, big short lived spikes traffic, and stuff like that. With respect to user data, a supervised process can crash and the supervisor can restart with the last known good state of that data. It requires some thought on the part of the developer to achieve this, but it's really powerful.
- nivertech 5y agoYou don't need k8s for 0 downtime, putting a monolith into an autoscaling group behind loadbalancer solves that ;)
- bostonvaulter2 5y ago> aka shipping using 3rd party api is a transient state of a complex process that can be ultimately recreated from the orders stored in the DB, but better not for speed reason. Plus some 3rd party APIs are rather terrible and if you end up re-sending a request (because your server/container went down after the request got sent to the API, but before the response got back/was processed) then the 3rd party API could end up in an inconsistent state.