Arch Forum 2023-04-13¶
Participants: Johan D, Liangxiong, Thani, Victor and Zakarya
Agenda¶
- Databases & SQL
Notes¶
The overall theme of this meeting was the (SQL)database
Handling of Stored Procedure sql scripts: Liangxiong brought up that the way we do change scripts for SPs (stored procedures) make it difficult to see their history, for example when doing code reviews of PRs. We could quickly conclude that this is a shared problem. However, its a problem that requires a bit of research for a solution.
Usage of SPs vs other: Victor asked why we use SPs at all for DB access. Apparently Roman had a negative view of them, until he tried a solution without SPs in one project in Rebtel and then got convinced of their advantages from a previous architect. It seems like there is different view about their usage within tech now as well..
Bad (DB) patterns: In general we try to limit the logic put in SPs, but at the same time we should not become lazy and think through how the code handle currency. One example we looked at was TemporaryPasswordService.Inactivate() which splits the inactivate function into two (or more) db calls. This is bad both for performance and for concurrency. However, we believe that most agree on how to write "good" code when pointed out.
Continuous cleanup: The previous topic, bad code, led to a broader question: When and how should we fix sub-optimal code we find in our daily work. Everyone including Johan thinks that smaller fixes or a half day or so can just be included in the daily work routine.
If you find something that doesnt look right, and you think it can be fixed relatively easily (like the Inactivate example above) then go ahead and do it! Depending on the exact issue it can either be included in the jira ticket already ongoing, or you can create a new ticket for the cleanup with the benefit that its very clear during standup etc whats happening. To ensure we dont feel afraid of cleaning up, Johan will also bring it up for everyone.
An idea to automate cleanup ticket creation somehow was also brought up, to help streamline the experience.