by CharlieDigital · 3y ago · 0 comments
In this case, hitting the Lambda size limit would have been the first red flag that triggered a re-evaluation of the whole approach.
Understanding the limits of the stack (Prisma + PlanetScale) would have been obvious from a few simple toy examples.
Seems like this team dove headfirst without even building a simple toy to determine if the choice was actually viable.
Building the "toy" first is great.
In my experience, about one third of the time the toy is all you need, you can stop there, and what you were going to build fully would be over-engineering. About one third of the time, building the toy tells you you're taking the unworkable approach as you mentioned. And the other third of the time you can extend the toy.
The main thing with a toy model is speed. You can build/deploy/test with a smaller scope and progressively scale it up some reasonable scale of the full thing (whatever you're testing for) and you can iterate your testing faster. But many times, the key issues show up quite early in the process of grokking the toy model.
Just throw up a new project, hack around in it for an hour, and most often the problem/bug in my original code becomes apparent because of the isolation. I'll easily write four such sandbox projects per week.
In my experience, about two-thirds of the time management sees the toy and ShipsIt thinking that's all you need.
If you find offense to this, the easiest way to mitigate is with process and practice: sandbox code goes into a dedicated "Sandbox" mono-repo and if it's suitable for production, you rebuild it appropriately in a production repo.
On the flip side, the cases where the toy ends up being promoted to production service end up being riddles with technical debt, missing features, and buggy behavior that jeopardizes the whole project, also happen.
Survivorship bias is also a major problem. It's easy to presume that the winning bet you took is the right path.