Why is it that if I delete a node in Ratel, I can still query for it?

This is an old situation that comes and goes again and again. Dgraph does not delete system UIDs. Because it is a fixed range, a fixed length address. It expands and there is no way to delete addresses or “jump”. It’s like a RAM(virtual?) memory that allocates more addresses to be used. Previous addresses cannot be deleted. It is also comparable to Blockchain(in a very abstract way), you cannot erase previous blocks(prune). So by design these addresses will exist until the end of the DB’s life. So this design creates nodes that are called “null nodes”.

However, we see that you also have incoming dangling edges. These you really need to clean manually through logic in your code. There are several ways to do this. It’s almost like a manual “garbage collection” control.

Another thing you can do when deleting a node. Instead of letting it become a null node. You can put(after using delete) a predicate(as a label e.g: “deleted”) telling your program (application) that that UID is free to be used elsewhere. It’s a way. But in the end letting null nodes appear is not a problem that you should be worried about too much.

3 Likes