Search code examples
opa

Scaling with the built in database


If you use the built in database that comes with Opa and create a single executable how is it possible to scale to multiple instances? For example, you compile your app and you get myapp.exe, as I understand it that exe contains the database. So if you want to run multiple instances of myapp.exe how do I synchronize the multiple instances of the database contained in each exe?


Solution

  • To run several instances of myapp.exe, start an opa-db-server(installed by Opa package) with the --db-local dbname option. Then run all your instances of myapp.exe with --db-remote:dbname host to connect to it.

    If you need more in term of scalability, you can use the mongodb backend.

    For further information, read https://github.com/MLstate/opalang/wiki/The-database