The exact design of the train has to be stored in the neo4j and then its reference would be stored in the respective train present in the postgresql.