Generate nested namespaced keys for key-value databases.