Issue #3 - Where goes my business logic
I listened to an old devops paradox episode about API-first development. They advocate this even for personal projects, where only 1 developer will maintain the entire codebase for most of the product lifecycle, and I completely agree with them. I always enthusiastically start with the APIs first, but it starts to slog in the middle when I try to figure out where does the business logic go.
This problem isn’t specific to API-first development. Some languages like Java and PHP have a paradigm called the “service layer”, which sits between the API controller and the data models.
Here’s a video where this guy adopts the service layer paradigm to Django.
I found it both convincing and useful. The views layer solely works on creating a response for a request and dispatching it. Another perspective is to put all this stuff in the model manager. This is specific to Django and YMMV depending on your framework.
The other day, I read about a streaming platform called wrapstream and how it compares with Kafka. It reads more like the “Sqlite of Kafka”. BTW, if you don’t have an idea about what Kafka does and how it compares with a database, this gem would be the most succinct explanation I’ve found from the deep dark caves of HN comments. No marketing fluff, not too technical either. Just what the doctor ordred.
I’ve been dabbling with Tekton at work to build a simple pipeline. Slowly, this requirement grew wings and I kind of regret choosing Tekton for this. IMO, Tekton is good for simple stuff, but not a full blown CD solution. For instance, it doesn’t support clickops fully. There’s a Tekton dashboard, but then we can’t bind any workspace to a Tekton task or a pipeline via the UI. What I’d ideally want is something like Tekton, but with more CD features, like recipes, UI/clickops as a first-class citizen, authentication and RBAC for running and managing different projects, reporting, events etc. There have been some stuff built on top of Tekton, but we have to duct tape all of that. This will have to be built eventually so that we can transit from the tool which nobody likes but everyone uses :)