Approach to repeatedly save the scene on server?

I need to save the gltf on the server and I would like to discuss how could this be achieved.

  1. Client is loading a GLTF file. It is a large scene. Like 100-200MB in a glb file and 3GB when loaded.
  2. Client changes one property of the scene. Like a name of a node.
  3. Client selects save.

We must save the scene on the server so when the users refresh the browser they see the new scene.

I could think of several options

  1. Exporting the scene again and sending it to the server - this is will take a lot of time as the file is large.
  2. Sending only the metadata to the server. For this scene the metadata of the gltf is about 300K and all the geometries are in .bin files. So technically if I could export only the gltf “metadata” and leave the .bin as they are on the same locations.
  3. Run a node server on the server, load the scene on both places and just execute the “rename” on both places.
  4. Something else…?

How could this problem be approached?


@kmitov I haven’t tried this but maybe instead use a json format like .babylon internally then, while a file is being edited, save small, granular json patches to the server/db using something like fast-json-patch - npm . Once a file is no longer being edited, patches could be merged back into main json ready for next time. You could still satisfy the client requirement to import and export gltf format but internally just use json files and patches.

I was thinking about something like this. GLTF is json format so it might work. I would have to save 3G scene in a 200 mb file than a second 3G scene in another 200mb and then compare them to produce the diff.

Do you know of a way to save only the “metadata” for the scene, not the geometry. As the geometry of the objects is heavy on size and it stays on different urls that .bin files while the metadata is not?

No sorry I don’t know, but that’s why I suggested using .babylon format at least internally - that way the geometry, scene, metadata, everything is json and all you’d be doing is saving small, incremental patches.