Storing images, fonts, binaries

Is there any limitation or a good practice how to store a binary file in Dgraph? We are wondering if storing Fonts inside Dgraph makes any sense. Also right now we store images in Cassandra (Walmart use case), but I wonder if we cannot use Dgraph for the same thing.

Currently we are storing JSONs (encoded as Base64) but this is a different case.

Any advice?

Hi @lukaszlenart
Dgraph autonomously rebalances shards based on disk usage. When using binary files, such as images, the rebalance my not be appropriate due to the expected difference of disk sizes between an image size and text based data in an average record. You might want to put a long interval for rebalancing or keep a close eye on it.
Details on shard Rebalancing: https://dgraph.io/docs/deploy/cluster-setup/#shard-rebalancing
The rebalance flag on zero:
--rebalance_interval duration Interval for trying a predicate move. (default 8m0s)

Thanks @anand!

Just one question: isn’t this just a case for Dgraphs with more than one group? If I have 3x Alphas which form 1 group everything should be in-balance, right?

I suppose you are going to run zero with replicas=3, so that 3 alphas become one group. By default, writes do get distributed across the alphas, so I would say yes.

Right, thank you. Also I can split large files in 2 or 4MB chunks for faster rebalancing. Any thanks!