How to handle hybrid storage from external libraries #81
|
Hello, I really appreciate your article and have been trying to implement the approach as it makes a lot of sense. I also watched the Brian Ketelsen talk that referred to it as well. Where I am struggling right now is when a library uses a hybrid approach to storage. For example, I am using the https://github.com/alexedwards/scs library for session with redis as a backend storage. So this is using a combination of http cookies and redis for tracking the session. I create a session interface in my domain type package But where do I handle the implementation for this? Do I handle it in the |
Replies: 1 comment
If you're only managing sessions in the If you are managing sessions outside the |
If you're only managing sessions in the
httplayer then I think you can avoid a service interface definition entirely and just use thescslibrary internally in thehttppackage.If you are managing sessions outside the
httplayer, then it doesn't matter too much about which package you place it into so long as its accessible. The main benefit to having theSessionServiceinterface would be to have swappable implementations but that's not typical fo…