Architectural Spiking
Architectural Spiking is running a small technical experiment, building working software to prove or disprove feasibility or a specific hypothesis. Spikes are throwaway code: they are not integrated into released Products, they are used to prove or disprove a theory.
Spiking is intended to investigate an area, reduce complexity, mitigate a risk or otherwise prove/disprove a theory. By diving deep into the solution space (a vertical “spike”) we can understand whether our early architectural ideas are likely to work. Spikes are particularly useful during Architectural Synthesis.
The purpose of a spike is to test a theory, not to create part of a working product. So although they are built as working software, they are throw-away code, usually ignoring all architectural, style and even good coding guidelines in favour of expediency. Spiking is an excellent form of risk mitigation, and a great way to reduce Complexity through learning.
We recommend that Spikes are formed by articulating a theory and a simple test or two. Although we describe Spikes as “throw-away code” we don’t actually throw them away. We don’t integrate them into our real code but they are useful to keep, alongside their specification/tests for people to refer to later or find out how something was done.
Here’s a simplistic example of a real spike for a system that was looking to access a SQL Server database using JavaScript. If this spike failed the team had other ideas, but this was a feasibility test they needed to answer.
This was the entire documentation for a Spike. The spike involved doing some web searching, running some command lines and writing around 5 lines of code for each theory, which proved both cases. The team simply ticked the tests and saved the following produced assets:
- Spike documentation
- Links to online guidance
- Install scripts
- Produced code
The team were then able to reduce a risk related to technical integration (although had to create some new risks around the security implications of accessing a database using local JavaScript – but that’s a different story).
Spiking in the cloud
Cloud makes spiking dramatically cheaper. Instead of debating whether a database, queue or AI service will meet a need, you can usually stand it up in minutes, try it and tear it down again, paying only for what you used. To get the most out of this:
- Use a sandbox account that is separate from production, with a budget alert so experiments can’t run up a surprise bill.
- Define spike infrastructure as code (Infrastructure as Code) so it can be destroyed cleanly and recreated later if someone needs to revisit the result.
- Timebox it. A spike answers a question; when the question is answered, stop.
- Record the outcome alongside the decision it informed, for example in an architecture decision record.
AI coding assistants make spikes faster again, since a working proof of concept can often be produced in minutes. That makes it even more important to be clear that spike code is for learning, not for shipping.