Bad programmers worry about the code. Good programmers worry about data structures and their relationships. - Linus Torvalds
10 more Rules that will help you write secure, scalable and adaptable programs:
Selecting everything in a query is prone to break things when the table structure changes and it transfers unneeded data. Don't use wildcards when selecting or inserting data.
It consists of eliminating synchronous calls between fault isolation domains, limiting asynchronous calls and handling synchronous call failure, and eliminating the sharing of services and data between swimlanes.
Strive for active/active rather than active/passive solutions. Use load balancers to balance traffic across instances of a service. Use control services with active/passive instances for patterns that require singletons.
Avoid adding components to your system that are connected in series. When necessary to do so add multiple versions of that component so that if one fails others are available to take its place.
Develop shared libraries to allow automatic or on-demand enabling and disabling of services. Implement Wire On/Wire Off Frameworks. Work to develop shared libraries that can be reused to lower the cost of future implementation.
Choose stateless implementations whenever possible. If stateful implementations are warranted for business reasons, always push back on the need for a state in any system. Use business metrics and multivariate (or A/B) testing to determine whether state in an application truly results in the expected user behavior and business value.
Using cookies to store session data is a common approach and has advantages in terms of ease of scale but also has some drawbacks. Note that unsecured cookies can easily be captured and used to log into people’s accounts.
Many web servers or languages offer simple server-based session management but are often fraught with the problem of user affiliation with specific servers. Implementing a distributed cache allows you to store session data in your system and continue to scale.
Use asynchronous communication techniques to ensure that each service and tier is as independent as possible. This allows the system to scale much farther than if all components are closely coupled together.
Message busses can fail from demand like any other physical or logical system. They need to be scaled. Treat message busses like any other critical component of your system. Scale them ahead of demand.
The earlier 30 rules: Link
Thanks for reading this.
If you have an idea and want to build your product around it, schedule a call with me.
If you want to learn more about DevOps and Backend space, follow me.