# How to use namespace in v25

**URL:** <https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008>\
**Category:** Dgraph\
**Tags:** kind:question\
**Created:** [October 11, 2025, 2:51pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008 "2025-10-11T14:51:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnium](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vnium](https://discuss.dgraph.io/u/vnium)\
**Post date:** [October 11, 2025, 2:51pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008/1 "2025-10-11T14:51:07Z")

</div>

How can namespaces be used in Dgraph v25? I’m creating a dgraph client in Golang like this: `dgraphClient, err := dgo.NewClient(endpoint, dgo.WithNamespace(2))`, but when I then later on do queries or mutations the default namespace (`0`) is still used.

---

<div class="post-metadata">

**Author:** ![matthewmcneely](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/matthewmcneely/32/4774_2.png) [@matthewmcneely](https://discuss.dgraph.io/u/matthewmcneely)\
**Post date:** [October 11, 2025, 4:07pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008/2 "2025-10-11T16:07:15Z")

</div>

The namespace must already exist. And you’ll need to login that user via the client. See: [Multi-Tenancy - Dgraph](https://docs.hypermode.com/dgraph/enterprise/multitenancy#multi-tenancy)

and

> <https://github.com/hypermodeinc/dgo/blob/1ce3fe0eac9085b5b433e241af0689090db072b6/client.go#L152>

---

<div class="post-metadata">

**Author:** ![vnium](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vnium](https://discuss.dgraph.io/u/vnium)\
**Post date:** [October 11, 2025, 4:21pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008/3 "2025-10-11T16:21:45Z")

</div>

So namespaces can only be used with ACL?

---

<div class="post-metadata">

**Author:** ![matthewmcneely](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/matthewmcneely/32/4774_2.png) [@matthewmcneely](https://discuss.dgraph.io/u/matthewmcneely)\
**Post date:** [October 13, 2025, 3:30pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008/4 "2025-10-13T15:30:04Z")

</div>

Practically, yes. Technically, no.

Over gRPC, you _could_ attach outgoing metadata `(namespace: <int>)` and queries and mutations would run in a non-ACL cluster. If all you’re doing is using gRPC, then fine. But of course, practically, other (non-gRPC) access to the cluster is probably desired (HTTP, Ratel, etc) which do not share the outgoing metadata mechanism that gRPC uses.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [October 14, 2025, 3:30pm UTC](https://discuss.dgraph.io/t/how-to-use-namespace-in-v25/20008/5 "2025-10-14T15:30:50Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
