# \#discussion

**URL:** https://discuss.dgraph.io/tag/discussion/21.md

[Latest](https://discuss.dgraph.io/latest.md) · [Categories](https://discuss.dgraph.io/categories.md) · [Tags](https://discuss.dgraph.io/tags.md)

---

## [Best practice for NodeJS client development?](https://discuss.dgraph.io/t/best-practice-for-nodejs-client-development/3022)

<div class="topic-metadata">

**Author:** [@erlendoverby](https://discuss.dgraph.io/u/erlendoverby)\
**Replies:** 5\
**Last updated:** [March 1, 2025, 2:41pm UTC](https://discuss.dgraph.io/t/best-practice-for-nodejs-client-development/3022 "2025-03-01T14:41:19Z")

</div>

I’m trying do develope a VUE JS app, and would like to use DGraph for my data. In earlier projects I used NEO4J and Express/Apollo for communication between my client and the NEO4J database. I tried to use the dgraph-js…

---

## [Best Practices for Dgraph Microservices?](https://discuss.dgraph.io/t/best-practices-for-dgraph-microservices/10666)

<div class="topic-metadata">

**Author:** [@gja](https://discuss.dgraph.io/u/gja)\
**Replies:** 9\
**Last updated:** [January 3, 2022, 10:48pm UTC](https://discuss.dgraph.io/t/best-practices-for-dgraph-microservices/10666 "2022-01-03T22:48:22Z")

</div>

Hey All, Are there any best practices for using dgraph in a microservices architecture? Usually in microservices arch, you would not have two different services talking to the same datastore (https://dzone.com/articles/…

---

## [Suggestions to Improve GroupBy](https://discuss.dgraph.io/t/suggestions-to-improve-groupby/4630)

<div class="topic-metadata">

**Author:** [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Replies:** 6\
**Last updated:** [December 10, 2021, 6:47pm UTC](https://discuss.dgraph.io/t/suggestions-to-improve-groupby/4630 "2021-12-10T18:47:28Z")

</div>

Related discussions How to groupby date - #7 by labs20 - Dgraph - Discuss Dgraph Running total (cumulative sum) by date - #4 by MichelDiz - Dgraph - Discuss Dgraph What is the technical reason we can't store variable…

---

## [Why does custom dql not support mutation?](https://discuss.dgraph.io/t/why-does-custom-dql-not-support-mutation/10366)

<div class="topic-metadata">

**Author:** [@asuka](https://discuss.dgraph.io/u/asuka)\
**Replies:** 9\
**Last updated:** [November 13, 2021, 6:31am UTC](https://discuss.dgraph.io/t/why-does-custom-dql-not-support-mutation/10366 "2021-11-13T06:31:29Z")

</div>

I want to delete through custom dql: type Mutation { deleteEntityById(id: String!): Entity @custom(dql: """ upsert { query q($id: string) { E as var(func: type(Entity)) @filter(eq(Entity.id, …

---

## [Redis Alternative](https://discuss.dgraph.io/t/redis-alternative/14910)

<div class="topic-metadata">

**Author:** [@auror](https://discuss.dgraph.io/u/auror)\
**Replies:** 0\
**Last updated:** [July 11, 2021, 3:28pm UTC](https://discuss.dgraph.io/t/redis-alternative/14910 "2021-07-11T15:28:56Z")

</div>

Hi All, We’ve been using Redis as the distributed cache and would want to optimize the cost of Redis using DRAM & the costly network call for each request. We’ve been looking at the embedded databases which runs on SSD…

---

## [GraphQL Generated Schema Ergonomics](https://discuss.dgraph.io/t/graphql-generated-schema-ergonomics/14101)

<div class="topic-metadata">

**Author:** [@dpeek](https://discuss.dgraph.io/u/dpeek)\
**Replies:** 7\
**Last updated:** [May 13, 2021, 3:21am UTC](https://discuss.dgraph.io/t/graphql-generated-schema-ergonomics/14101 "2021-05-13T03:21:02Z")

</div>

This topic describes possible improvements to the schema generated by the Dgraph GraphQL endpoint. The changes are focused on the ergonomics of type safe GraphQL clients (ie. TypeScript GraphQL Codegen) and minimising re…

---

## [How to improve the write throughput of the dgraph cluster?](https://discuss.dgraph.io/t/how-to-improve-the-write-throughput-of-the-dgraph-cluster/14035)

<div class="topic-metadata">

**Author:** [@cangchen8180](https://discuss.dgraph.io/u/cangchen8180)\
**Replies:** 4\
**Last updated:** [May 6, 2021, 1:28pm UTC](https://discuss.dgraph.io/t/how-to-improve-the-write-throughput-of-the-dgraph-cluster/14035 "2021-05-06T13:28:16Z")

</div>

What I want to do when i read docments. i saw the follow content. " Sharding Dgraph colocates data per predicate (\* P \*, in RDF terminology), thus the smallest unit of data is one predicate. To shard the graph, one or…

---

## [Expected behaviour for sort queries](https://discuss.dgraph.io/t/expected-behaviour-for-sort-queries/7157)

<div class="topic-metadata">

**Author:** [@Anurag](https://discuss.dgraph.io/u/Anurag)\
**Replies:** 16\
**Last updated:** [March 25, 2021, 10:31pm UTC](https://discuss.dgraph.io/t/expected-behaviour-for-sort-queries/7157 "2021-03-25T22:31:39Z")

</div>

Going through some of the previous questions asked on the forum, I have come across some issues when using sort queries. Using the following data to help in reproducing. \<1\> \<name\> "A" . \<1\> \<uuid\> "a" . \<1\> \<dgr…

---

## [GraphQL + gPRC](https://discuss.dgraph.io/t/graphql-gprc/12407)

<div class="topic-metadata">

**Author:** [@oising](https://discuss.dgraph.io/u/oising)\
**Replies:** 1\
**Last updated:** [January 22, 2021, 6:26pm UTC](https://discuss.dgraph.io/t/graphql-gprc/12407 "2021-01-22T18:26:17Z")

</div>

For the next generation of @custom, it would be nice to support gRPC calls/messages over http/2. More efficient/performant I’d say - and coherent with respect to dgraph itself.

---

## [Hacky way to find distance (number of hops) from one node to other nodes](https://discuss.dgraph.io/t/hacky-way-to-find-distance-number-of-hops-from-one-node-to-other-nodes/12338)

<div class="topic-metadata">

**Author:** [@Anurag](https://discuss.dgraph.io/u/Anurag)\
**Replies:** 1\
**Last updated:** [January 18, 2021, 1:35am UTC](https://discuss.dgraph.io/t/hacky-way-to-find-distance-number-of-hops-from-one-node-to-other-nodes/12338 "2021-01-18T01:35:43Z")

</div>

Schema: name: string @index(exact) . age: int . city: string . knows: \[uid\] . I Want to Do Find friends (connected via knows) up to three hops away and also return the distance in the query. Example: Anurag -\> …

---

## [How to model time series data](https://discuss.dgraph.io/t/how-to-model-time-series-data/12327)

<div class="topic-metadata">

**Author:** [@hyprnick](https://discuss.dgraph.io/u/hyprnick)\
**Replies:** 1\
**Last updated:** [January 16, 2021, 6:32pm UTC](https://discuss.dgraph.io/t/how-to-model-time-series-data/12327 "2021-01-16T18:32:46Z")

</div>

What is the best way to model time series data in Dgraph? I would like to store tags about a series as well as the time+value pairs. Searching should be fast for tags as well as by time ranges. Is this possible? Can a dg…

---

## [So this recursive query, it takes 2 to 8 seconds, did I write it wrong?Or what can I do to make the query faster, how can I index it？](https://discuss.dgraph.io/t/so-this-recursive-query-it-takes-2-to-8-seconds-did-i-write-it-wrong-or-what-can-i-do-to-make-the-query-faster-how-can-i-index-it/12199)

<div class="topic-metadata">

**Author:** [@llooper-dev](https://discuss.dgraph.io/u/llooper-dev)\
**Replies:** 7\
**Last updated:** [January 6, 2021, 10:18am UTC](https://discuss.dgraph.io/t/so-this-recursive-query-it-takes-2-to-8-seconds-did-i-write-it-wrong-or-what-can-i-do-to-make-the-query-faster-how-can-i-index-it/12199 "2021-01-06T10:18:52Z")

</div>

So this recursive query, it takes 2 to 8 seconds, did I write it wrong?Or what can I do to make the query faster, how can I index it？ Tablets (14) ugcId1.7GB ugcUid1.2GB rootUgcId1.1GB forwardFrom1.0GB forwardCount0.9GB…

---

## [Beginner question: Connecting to Dgraph directly from the front-end](https://discuss.dgraph.io/t/beginner-question-connecting-to-dgraph-directly-from-the-front-end/11374)

<div class="topic-metadata">

**Author:** [@minitauros](https://discuss.dgraph.io/u/minitauros)\
**Replies:** 7\
**Last updated:** [November 14, 2020, 4:16pm UTC](https://discuss.dgraph.io/t/beginner-question-connecting-to-dgraph-directly-from-the-front-end/11374 "2020-11-14T16:16:37Z")

</div>

Hello there. I’m not so new to the overall concept of GraphQL, but I’ve never hosted my own. I came across Dgraph and Slash, and it looks amazing to me. I would like to experiment with it a bit. There are just a few ques…

---

## [Required property not signified as required in typeRef schema is not a bug](https://discuss.dgraph.io/t/required-property-not-signified-as-required-in-typeref-schema-is-not-a-bug/11083)

<div class="topic-metadata">

**Author:** [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Replies:** 0\
**Last updated:** [October 22, 2020, 6:09pm UTC](https://discuss.dgraph.io/t/required-property-not-signified-as-required-in-typeref-schema-is-not-a-bug/11083 "2020-10-22T18:09:12Z")

</div>

I should not have spent so much time on this issue if I would have thought more about it first. This is not a bug report but hopefully a help to anyone who comes across this. In my schema I have a edge to another type s…

---

## [Dgraph missing mutations in Ludicrous mode (post mortem)](https://discuss.dgraph.io/t/dgraph-missing-mutations-in-ludicrous-mode-post-mortem/11019)

<div class="topic-metadata">

**Author:** [@Rahul](https://discuss.dgraph.io/u/Rahul)\
**Replies:** 0\
**Last updated:** [October 19, 2020, 9:08am UTC](https://discuss.dgraph.io/t/dgraph-missing-mutations-in-ludicrous-mode-post-mortem/11019 "2020-10-19T09:08:12Z")

</div>

Problem When running Dgraph in ludicrous mode, Dgraph overrides sequential upserts on any attribute. For example, for the following schema: name: string @index(exact) . email: string @index(exact) . friends: \[string\]…

---

## [Pre-processing DBpedia dataset for Dgraph](https://discuss.dgraph.io/t/pre-processing-dbpedia-dataset-for-dgraph/10779)

<div class="topic-metadata">

**Author:** [@EnricoMi](https://discuss.dgraph.io/u/EnricoMi)\
**Replies:** 0\
**Last updated:** [October 5, 2020, 2:51pm UTC](https://discuss.dgraph.io/t/pre-processing-dbpedia-dataset-for-dgraph/10779 "2020-10-05T14:51:02Z")

</div>

I was looking for a large real-world graph dataset to load into a Dgraph cluster to ultimately test my spark-dgraph-connector. I want to share the dataset that met my requirements, together with all processing steps nee…

---

## [Best practice for modularizing a Dgraph GraphQL schema](https://discuss.dgraph.io/t/best-practice-for-modularizing-a-dgraph-graphql-schema/10535)

<div class="topic-metadata">

**Author:** [@Eloitious](https://discuss.dgraph.io/u/Eloitious)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 12:39pm UTC](https://discuss.dgraph.io/t/best-practice-for-modularizing-a-dgraph-graphql-schema/10535 "2020-10-08T12:39:37Z")

</div>

Hello, Any recommendations regarding best practice for modularizing a growing Dgraph GraphQL schema definition? Been doing !/bin/bash FILES=../schema/\*.graphql for f in $FILES do echo "Processing $f file..."…

---

## [Discussion: Wikipedia backed by DGraph](https://discuss.dgraph.io/t/discussion-wikipedia-backed-by-dgraph/8640)

<div class="topic-metadata">

**Author:** [@soneymathew](https://discuss.dgraph.io/u/soneymathew)\
**Replies:** 10\
**Last updated:** [October 5, 2020, 4:37pm UTC](https://discuss.dgraph.io/t/discussion-wikipedia-backed-by-dgraph/8640 "2020-10-05T16:37:34Z")

</div>

I am interested to learn if someone attempted to load wikipedia datadump into DGraph? How will a wikipedia site built on top of DGraph perform? Is DGraph a good fit for solving this problem? Can loading up this data …

---

## [Better practice... Google TLS ingress to non-encrypted backend vs. TLS to Dgraph](https://discuss.dgraph.io/t/better-practice-google-tls-ingress-to-non-encrypted-backend-vs-tls-to-dgraph/10695)

<div class="topic-metadata">

**Author:** [@tommo](https://discuss.dgraph.io/u/tommo)\
**Replies:** 3\
**Last updated:** [October 2, 2020, 1:04pm UTC](https://discuss.dgraph.io/t/better-practice-google-tls-ingress-to-non-encrypted-backend-vs-tls-to-dgraph/10695 "2020-10-02T13:04:30Z")

</div>

Hi all - I’m in the process of moving our graph solution from neo4j to DGraph. We intend to run this on GKE and have a test environment running now. The next bit on my todo list is to put together a strategy for secu…

---

## [Discus Find "feature" is rather pathetic](https://discuss.dgraph.io/t/discus-find-feature-is-rather-pathetic/10316)

<div class="topic-metadata">

**Author:** [@gotjoshua](https://discuss.dgraph.io/u/gotjoshua)\
**Replies:** 5\
**Last updated:** [September 14, 2020, 12:16am UTC](https://discuss.dgraph.io/t/discus-find-feature-is-rather-pathetic/10316 "2020-09-14T00:16:51Z")

</div>

The Discus “feature” for catching CMD&F and offering find in this thread, is seriously bad. Chrome’s find has 15 matches (and is convenient to use) while discus has No results found.

---

## [Best practices on handling images?](https://discuss.dgraph.io/t/best-practices-on-handling-images/10162)

<div class="topic-metadata">

**Author:** [@freeGraph](https://discuss.dgraph.io/u/freeGraph)\
**Replies:** 4\
**Last updated:** [September 10, 2020, 3:46am UTC](https://discuss.dgraph.io/t/best-practices-on-handling-images/10162 "2020-09-10T03:46:11Z")

</div>

The recent tutorials on how to get authentication and authorization working in Slash GraphQL using auth0 have been fantastic! I look forward to more of these which cover the realities encountered when building an app. A…

---

## [Transitioning from a Relational DB to a Graph DB](https://discuss.dgraph.io/t/transitioning-from-a-relational-db-to-a-graph-db/10059)

<div class="topic-metadata">

**Author:** [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Replies:** 4\
**Last updated:** [September 8, 2020, 1:28pm UTC](https://discuss.dgraph.io/t/transitioning-from-a-relational-db-to-a-graph-db/10059 "2020-09-08T13:28:23Z")

</div>

Well, we made probably one of the most difficult choices halfway through Developing our Application, but it ended up being an easy decision. Here is our (somewhat) short story of making the transition from a Relational D…

---

## [Considering dgraph, have some newbie questions on if it makes sense for this use case](https://discuss.dgraph.io/t/considering-dgraph-have-some-newbie-questions-on-if-it-makes-sense-for-this-use-case/9949)

<div class="topic-metadata">

**Author:** [@smga3000](https://discuss.dgraph.io/u/smga3000)\
**Replies:** 8\
**Last updated:** [September 2, 2020, 2:39am UTC](https://discuss.dgraph.io/t/considering-dgraph-have-some-newbie-questions-on-if-it-makes-sense-for-this-use-case/9949 "2020-09-02T02:39:54Z")

</div>

I find graph databases fascinating, but they are still a kind of unnatural way for me to approach a problem, so I’m not sure if it makes the most sense for what I am going to be building. This is essentially an insurance…

---

## [Best practice for DgraphClientStub, DgraphClient lifetime](https://discuss.dgraph.io/t/best-practice-for-dgraphclientstub-dgraphclient-lifetime/9738)

<div class="topic-metadata">

**Author:** [@clintwood](https://discuss.dgraph.io/u/clintwood)\
**Replies:** 4\
**Last updated:** [September 1, 2020, 8:32am UTC](https://discuss.dgraph.io/t/best-practice-for-dgraphclientstub-dgraphclient-lifetime/9738 "2020-09-01T08:32:45Z")

</div>

I’ve not been able to find any guidance on a best practice for a request lifetime with respect to DgraphClientStub, DgraphClient within the context of a server process. Given a node server with a module that implements …

---

## [Understanding Dgraph mutation](https://discuss.dgraph.io/t/understanding-dgraph-mutation/9921)

<div class="topic-metadata">

**Author:** [@maubertin](https://discuss.dgraph.io/u/maubertin)\
**Replies:** 2\
**Last updated:** [September 1, 2020, 2:57am UTC](https://discuss.dgraph.io/t/understanding-dgraph-mutation/9921 "2020-09-01T02:57:53Z")

</div>

Hello, Not sure if this is the good topic category, hope it’s good. I had build the following graph: BP -- p --\> Actions -- p --\> delete -- p --\> step BP -- p --\> Actions -- p --\> stop BP -- p --\> Notifications -- p -…

---

## [Best Practices of Streaming into Dgraph](https://discuss.dgraph.io/t/best-practices-of-streaming-into-dgraph/9459)

<div class="topic-metadata">

**Author:** [@anand](https://discuss.dgraph.io/u/anand)\
**Replies:** 1\
**Last updated:** [August 17, 2020, 6:19pm UTC](https://discuss.dgraph.io/t/best-practices-of-streaming-into-dgraph/9459 "2020-08-17T18:19:24Z")

</div>

Here are some suggestions: Conflict Exceptions and Retry Loops Given enough retries and spacing, a transaction which is facing conflict exception (\>1 transaction modifying the same node in Dgraph), will eventually suc…

---

## [FOREACH func in DQL (loops in Bulk Upsert)](https://discuss.dgraph.io/t/foreach-func-in-dql-loops-in-bulk-upsert/5533)

<div class="topic-metadata">

**Author:** [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Replies:** 8\
**Last updated:** [July 9, 2020, 11:43pm UTC](https://discuss.dgraph.io/t/foreach-func-in-dql-loops-in-bulk-upsert/5533 "2020-07-09T23:43:33Z")

</div>

Ref of a DB doing something similar to it: Before starting see an example in the next comment block. Example with Bulk Upsert upsert { query { source as var(func: has(linkto)) { v0 as uid LK as linkt…

---

## [Best practice for node types still \_name?](https://discuss.dgraph.io/t/best-practice-for-node-types-still-name/4650)

<div class="topic-metadata">

**Author:** [@emhagman](https://discuss.dgraph.io/u/emhagman)\
**Replies:** 1\
**Last updated:** [June 21, 2019, 6:39pm UTC](https://discuss.dgraph.io/t/best-practice-for-node-types-still-name/4650 "2019-06-21T18:39:26Z")

</div>

Hey, We’ve been using Dgraph since 1.0. For a long type it’s been said that the best way to add “types” to nodes are to use an empty \_node predicate where node is the type. However, in the newest blog post https://blog.…

---

## [Custom Block - Discussion](https://discuss.dgraph.io/t/custom-block-discussion/4023)

<div class="topic-metadata">

**Author:** [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Replies:** 1\
**Last updated:** [February 12, 2019, 6:39pm UTC](https://discuss.dgraph.io/t/custom-block-discussion/4023 "2019-02-12T18:39:33Z")

</div>

PS. Some people may think that GraphQL Vars would be the same as a custom block at some level. But it is not possible to re-sign a G. Vars. Something that would be necessary to be reused in other blocks. One of the inte…

---

## [Best practices for closing badger db](https://discuss.dgraph.io/t/best-practices-for-closing-badger-db/3948)

<div class="topic-metadata">

**Author:** [@jackmiller334](https://discuss.dgraph.io/u/jackmiller334)\
**Replies:** 2\
**Last updated:** [January 29, 2019, 10:55pm UTC](https://discuss.dgraph.io/t/best-practices-for-closing-badger-db/3948 "2019-01-29T22:55:53Z")

</div>

Hi all. I’m wondering if there is a best practice when using badger db on a long running instance when it comes to closing the database. Ideally I think we want to close the db before program exit, even with badger bei…

[Next page](https://discuss.dgraph.io/tag/discussion/21.md?match_all_tags=true&page=1&tags%5B%5D=discussion)
