2 ms·
Now you have a good rule of thumb for splitting services: stuff that must belong to a single transaction should live in the same service. This is how you e.g.
by nine_k 6y ago
Now you have a good rule of thumb for splitting services: stuff that must belong to a single transaction should live in the same service.
This is how you e.g. can split a bank transaction service from a bank balance-telling service, with different requirements for scaling, latency, SLAs, deployment schedules, etc. You can deploy a change to the balance-telling service and then roll it back if it exhibits a problem, all without touching transaction proceeding in any way.
These abilities are worth something if you're a big enough. But this is not a starting point for a new side project. You start with a monolith.
- tluyben2 6y ago> You start with a monolith. I think that is the HN syndrome; people start projects like they will be larger than facebook even though the project will probably never launch and if it does, get more than 10 users. Yet it runs all services aws has to offer and has 100 microservices and the little company(‘s investors) are paying through the nose in both dev time and hosting while a raw php script on a $1/mo vps would’ve been sufficient to validate the idea and get to ramen profitability and (far) beyond. Like someone said in another thread; focus on your market and acquisition channels first, build great stuff (much) later.
- nine_k 6y agoI remember that eBay seriously rewrote their backend three times — not because they kept doing it wrong, but because they grew. An architecture that fits well for a small company is inadequate for a large company, and vice versa.
- collyw 6y agoI bet there are orders of magnitude more cases where a ton of time and effort has been put into scalable architecture when it wasn't needed. Ebay is a serious outlier when it comes to scale of software, most people aren't going to serve anywhere near as many customers.
- zimpenfish 6y agoI've been through a couple of iterations of "MONOLITH BAD!" where none of the issues were monolith related but instead database design and usage. Also an iteration of "MICROSERVICES GOOD!" where there are more microservices than entire company employees (not just devs) and yeah, it's a bad idea at this scale.
- ryanbrunner 6y agoI know it's a simple example, but wouldn't the balance of an account be critically important to be part of a transaction. Otherwise, how could you manage two simultaneous withdrawals if the transaction processing service isn't able to put a lock on reading the balance until it's complete?
- nine_k 6y agoThe teller can show a slightly stale, eventually consistent balance figure, depending on its use. This would allow for massively better read performance, which is important when reads occur many times more often than writes. Instead of a balance of a checking account, think about the karma balance of a reddit post, where this approach more emphatically belongs.