0

So I currently have a server running for an online game, and one of the ObjectBox boxes is for users, which holds things like email address, name etc.

I am just starting on a second game, and I want my users to be able to use the same set of info to log in to this one.

As both backends run on the same server (a VPS) I would love both Java apps, to be able to access the User box at the same time, rather than having duplicate data, which will be out of sync.

Is this possible?

UPDATE:

Both apps are java spark web servers, running in two diff docker containers, so the processes would be diff, and be using diff threads. I know the rough idea behind synchronized but not how to apply it, and not in the case of ObjectBox. Would I synchronise the BoxStore object? Or maybe the Box<T> ?

Russ Wheeler
  • 2,590
  • 5
  • 30
  • 57

1 Answers1

0

Two processes cannot access the same data if they also write data. If only one process is writing, it might work, but I don't believe that limitation will work for your projects.

Another option is using ObjectBox Sync limited to the user entity. Here are some links to get you started:

  • Hi, you are right, both processes would need to read AND write. I saw the objectbox sync stuff, but that looked like an online syncing thing, but I have no need for having the data synced across multiple places, as the data is all on the one Virtual Private Server. If I can't do this, I might have to ditch ObjectBox and use something like an SQL db just for the user data :-( – Russ Wheeler Sep 22 '22 at 10:55
  • You can use ObjectBox Sync as an offline solution too. Host the Sync server within your Virtual Private Server and handle synchronisation there. @RussWheeler – Vahid Nesro Sep 22 '22 at 11:52
  • I still don't think this is applicable. It seems it's a way of keeping multiple dbs in sync with each other. I don't want that, I want one db only. I guess I could use multiple DBs, all in sync, but that feels like a lot more hassle than just having one SQL docker container that both apps can talk to – Russ Wheeler Sep 22 '22 at 12:19