2 ms·
And I would even say that’s not true most of the time. Why is the update button slow? - Is your customer in Asia and your servers are in us-east-1? Do we need
by scarface74 8y ago
And I would even say that’s not true most of the time. Why is the update button slow?
- Is your customer in Asia and your servers are in us-east-1? Do we need a multi master database one in each region? Can we make even that faster by doing an eventually consistent write?
- do we really need a synchronous update process or can we use queues to make it more consistent?
- is our web server slow? Should we scale horizontally or vertically? Should we use autoscaling and if so which metric should we use? What should our cooldown time be between autoscaling events? Do we need to autoscale across regions? Where is our traffic coming from?
- is our database indexed properly? Did we look at our slow query logs? Did someone do something stupid like have triggers on our database unnecessarily? Is an RDMS the right choice? Do we need to denormalize the table?
- or is it our code?
This is the thought process my manager was looking for when he interviewed me. Not the best way to traverse a tree.
- pjmlp 8y agoAnswer 5. Update implemented as O(n!) for the input dataset graph because the coder didn't knew any better.
- scarface74 8y agoBut with a complex system. How would you know where the bottleneck is if you don’t know how to instrument your entire system and how would you know the possible solutions?
- pjmlp 8y agoBy doing a proper architecture design and data analysis before writing a single line of code, instead of coding away without any sense of direction. Delivering a good result out of that process, requires knowing algorithms and data structures tailored at the problem space.
- scarface74 8y agoRight. Like that’s going to happen in an environment where shipping code on two weeks sprints is expected. Even in your perfect world where this does happen, it’s not like you could possible know what type of bottlenecks or usage patterns will happen until you get real users using your code. Are you suggesting we go back to a waterfall approach and not get fast feedback and learn what works as you are developing?
- pjmlp 8y agoIt does happen in two weeks sprints, that is what refinement planning, spike stories and research sprints are all about. And in case you missed, the large majority of companies that actually moved into agile, nowadays are doing what we could call scrum-waterfall. Plenty of bottlenecks and usage patterns are already clear from reading the RFP documents and preparing the respective sales pitch offer. Surely if one codes away without thinking about overall system architecture, like the TDD proponents, then these problems aren't possible to predict.
- scarface74 8y agoSo within those two weeks while you are “researching” how are you going to know real usage patterns with real users? Is your research going to perfectly predict where all of the bottlenecks and optimizations need to be in the entire system? Are you going to perfectly predict the size and number of VMs that you need? The size of the database? Where your users are and the average latency? Are none of your developers going to mistakes that aren’t apparent until you are running at scale? There is more to architecting a system than just “code”.
- pjmlp 8y agoSure there is more to "architecting a system than just “code”.", which is exactly my whole point. Performance is a feature, it doesn't get retrofitted. There is only one shot, specially in fixed budget projects. While a perfect design is an utopia, and there will be surely some unforeseen problems, not designing at all is even worse. To calculate the initial set of VMs, database size, average users, network latency, you name it, it only requires reading the RFP requirements, having technical meetings with all partners about those requirements, and having a team that knows their stuff around CS. If it already clear from deployment scenario that at very least 4 VMs will be needed, or that a DB node will need 100 GB on average, it would be very risky just to do on the go. As for running at scale, that should already be obvious from RFP requirements, unless we are speaking about startups dreaming of being the next FANNG. MongoDB is a very good example of running at scale without doing the necessary engineering, but they do have a good marketing department to compensate for it.