Most commonly asked questions about Dapr
Tags: microservices, go, cloud
Published: 2020-06-24 12:09:18

[Dapr](https://dapr.io/) is "An event-driven, portable runtime for building microservices on cloud and edge." Being an exciting open source project, it attracts a lot of developers and with them, lots of questions :)

I thought it might be helpful to answer (or provide pointers) to some of them here. I have seen/heard these (in different forms) at various places including conferences/webinars, Dapr Gitter, Twitter DMs or one-one conversations (oh yes those exist too!) etc. 

![](https://media.giphy.com/media/d1E1YlkOTe4IfdNC/giphy.gif)

### Is Dapr a Service mesh, what's the difference ?

> Or sometimes, this is phrased as, "Can I use Dapr with Service mesh?"

Good news is that this has already being covered in one of the Dapr community calls - ["Introduction to Dapr and Service Meshes. How they relate, when to use one verses the other...."](https://www.youtube.com/watch?v=xxU68ewRmz8)

**TL;DR**

- Service meshes are closer to infrastructure layer and operator concerns
- Dapr is closer to applications layer which developers are reponsible for
- There is an *overlap* between Dapr and Service meshes ...
- ... but, you *can* use them together as well - see a demo of Dapr and [Linkerd](https://linkerd.io/) working together

{% youtube xxU68ewRmz8 %}

### Dapr is a "runtime" - what does that mean?

I thought about this as well, when I first started exploring Dapr. In my specific case (Java middleware background), "runtime" was an application server which provided a "managed environment" (concurrency, security etc.) to my code (WAR, EAR etc.)

That's not the case with Dapr. It is a "Runtime" that operates along with your application using a **sidecar** architecture - your application does *not* run "inside it". In standalone mode, Dapr simply runs as a different process and in Kubernetes, it runs as a (sidecar) container in the same `Pod` as your application

![](https://dev-to-uploads.s3.amazonaws.com/i/cwygokzefyqhz4f6vd6o.png)

### (Myth) Dapr depends on Docker

Guess what, this was also covered in one of the community calls, which showcased Dapr working in standalone mode on an AWS EC2 instance

**TL;DR**

- "Dapr needs docker" == false
- In standalone mode, Dapr runs as a process
- In Kubernetes, there is some magic going on - one of them being the sidecar injection which is taken care of by the `dapr-sidecar-injector` Pod (check out the [implementation here](https://github.com/dapr/dapr/tree/master/pkg/injector))

> [Use this link](https://youtu.be/NLWukkHEwGA?t=1325) if you want to jump straight to the demo

{% youtube NLWukkHEwGA %}

### What about Docker Compose support?

Right now, with the Dapr CLI, `dapr init` will start Dapr (using Docker) and you can then start your app along with Dapr using `dapr run`. But a common use case is to run treat these as a single unit, and Docker Compose helps with that

The answer? Of course it is! 

Check out: 

- Docker Compose sample - https://github.com/dapr/samples/tree/master/10.hello-docker-compose
- and this [Extend mDNS to support custom host](https://github.com/dapr/dapr/issues/1506) enhancement which made this possible

... and this demo on yet another awesome Dapr community calls!

> [Use this link](https://youtu.be/7fP-0Ixmi-w?t=1388
) if you want to jump straight to the demo

{% youtube 7fP-0Ixmi-w %}

### Pub/sub and Bindings - what's the difference?

With [Bindings](https://github.com/dapr/docs/tree/master/concepts/bindings), you can interact with external systems:

- Input bindings: trigger your app with events coming in from external systems
- Output bindings: invoke external systems

[Pub/Sub](https://github.com/dapr/docs/tree/master/concepts/publish-subscribe-messaging) on the other hand is for Dapr apps to communicate amongst themselves (inter-app messaging) in a decoupled and asynchronous manner.

## That's it.. for now!

But I do want to leave you with a few handy resources:

- You're most welcome to join the community call which I referred to so many times! https://github.com/dapr/dapr#community-call
- Get started https://github.com/dapr/docs/tree/master/getting-started
- Try out the sample apps https://github.com/dapr/samples
- Connect, follow, ask questions! https://github.com/dapr/dapr#contact-us
- Contribute! https://github.com/dapr/dapr/blob/master/docs/development

Until next time!

![](https://media.giphy.com/media/1C8bHHJturSx2/giphy.gif)