-1

I have small home expenses application, that I'm developing in my free time in Java. Now that it is functional, I want to make it portable so I could pass it to friends (non-developers) to try out.

I managed to dockerize the api and the web ui, but the DB is a little tricky. Currently I am using mysql, installed on my machine. But I don't want the user to install and configure a db.

What I need is:

  • Something free of charge
  • On prem (don't want the users to fear their data might be stolen)
  • Low volume and speed requirements. this data is relatively small.
  • Portable. Ideally no installation. Or installation by script with no arguments.
  • Zero maintenance. I don't want users to check health or install patches.
  • Persistency. On memory DB that will loose data if crushes is no good.
  • As I already invested in Spring ORM, I prefer something that will work with my existing code.
user355289
  • 1,100
  • 2
  • 13
  • 23

1 Answers1

0

Basically your options are:

  1. Dockerize also the mysql database (use a ready image) + you might want to use docker compose to start both the db and the app together. If your friends have docker (which seem to be a requirement of your application anyway already, then its probably the easiest approach).

  2. Use another databas which is embeddable into your application. Examples are: SQLLight, Derby, H2. If your queries are simple and "portable enough" this approach can work as well, but you'll have to at least re-check all your queries, since sometimes these DBs can behave different from MySql. As opposed to the approach 1 you won't need another container to run and won't use docker-compose, which is not a big deal anyway, since docker compose is a part of any docker installation these days.

  3. Host a database in some cloud (like AWS) and connect to the cloud from your application. This will probably be slow (should be the slowest approach of these 3) but will save you from the burden of maintaining the database. Of course it won't work if different copies of your app should access the different data (then you'll have to maintain a database per user in the cloud). This also can be costy since you'll have to pay to the cloud provider.

To wrap up I suggest you going with solution 1, if you can't go with 2, and the worst is solution 3 IMO.

Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97
  • Dockered Mysql has crossed mind. but how do I make the data persist on disk? – user355289 Sep 06 '20 at 07:39
  • For that docker has an abstraction of volumes. So basically you can create a volume and and map it to the folder where mysql will store the data internally. It will guarantee that the data won't be erased upon the restart of the docker container. See https://stackoverflow.com/questions/39175194/docker-compose-persistent-data-mysql For general information about docker volumes support see https://docs.docker.com/storage/volumes/ – Mark Bramnik Sep 06 '20 at 07:42