#Leverage Building Blocks inside a pluggable component

1 messages ยท Page 1 of 1 (latest)

arctic gate
#

Hey folks, Just wanted to chat about this freely and let it sit in the back of the minds of the maintainers/contributors.

On my journey of building a pluggable state store, I keep wanting to reach for other Building Block capabilities inside my pluggable state store implementation.

For example, it would be super useful to have my pluggable state store implementation also Subscribe to a PubSub Topic. Nothing special here, just a plain old subscriber. (as drawing is attached)

Another example, I would like to use the Distributed Lock API inside my pluggable state store, as a way of co-ordinating operations that can't occur concurrently across many instances of the deployed pluggable component.

I know there is probably no nice way to light this is up, as Building Blocks are utilised in what we would call a 'dapr-ised App', but equally, I know you guys come up with creative ways of making things happen, and this could be one of them ๐Ÿ™‚

Anyway, not essential I can work around it, but certainly would be a nice to have! ๐Ÿ™‚

So... thinking out loud, would it be feasible to treat the 'pluggable component' as a traditional dapr-ised app? and would it be feasible for the dapr sidecar to assume the identity of both the traditional app, and the pluggable component 'app' ? I suspect it would be highly complex... but its just a thought, something to ponder about and move on from ๐Ÿ™‚

merry kelp
#

Technically you can have a sidecar for your pluggable component that itself loads apps. Just make sure to scope that app such that pluggable component would not be loaded by its own sidecar.

Your real app then has a sidecar which loads all components plus the pluggable component.

I would never want to recommend or encourage that as it becomes a troubleshooting and supportability nightmare.

Can it be done? Yes. Is that a good idea? Not really.
It is best if each component is completely detached from anything Dapr related as that makes troubleshooting much more straightforward.