UUID/GUID field and shards I am planning on using UUID field for storing items which can have a parent item. I am using PostgreSQL 9.5. I imagine there will be 3-4 levels at most. The design is to hold a structure such as Corporations-&gt;sub-companies-&gt;stores/shops So perhaps +/- 2 levels.

Now if I have the item and parent on same table wouldnt it be a problem in future if I want to divide data into multiple databases? What would be the best way to proceed?

                 uuid                 |             parent_uuid              
--------------------------------------+--------------------------------------
 89b4052a-fd9a-43d3-b5f7-c69ee6ea9f5b |                                      
 c569ae30-87af-6bcf-fdd1-8143e3bae27a | 89b4052a-fd9a-43d3-b5f7-c69ee6ea9f5b 
 d7460788-ff07-e82d-83ed-5a0182ae2fbf | 89b4052a-fd9a-43d3-b5f7-c69ee6ea9f5b
There is no elegant way to proceed. If the hierarchy has an unknown amount of levels, you can't serialize it into fixed relations. But partitioning it is probably a bad idea. Perhaps you want a Graph Database?