2
15 Comments

Need advice for implementing a Simple Database

Hi Guys,

I am developing a cross-platform desktop app for designing state machines which I plan to release in a month. I've built the app on top of the Qt framework(Essentially C++).

Now that I'm almost done with the app, I am entering unchartered territory of hosting the website and database of user information on the server. I've stitched together the landing page. However, I am not very acquainted with the backend world involving database, etc.

I am looking for solution wherein I can maintain a simple database of basic user information like name, type of user, expiry date, etc. and I should be able to access this database from c++ app and basic javascript in case of the website.

I had studied Django a while back but I think that would be overkill as I will have to merge the current bootstrap website with Django and then run into all kinds of Django deployment issues, choose a powerful enough hosting service, etc. I have a feeling all this could be averted with a simple solution.

Can somebody please suggest a path of less friction as I'm having trouble finding one.

Cheers!

on June 21, 2020
  1. 4

    Try firebase 😁

    1. 1

      Strongly second Firebase, you can get up and running super fast and the documentation is pretty good. Just need to be careful about quantity of reads and writes by designing your data well. I've used it a lot recently so if you need any help getting started (especially with the javascript side of things) I'm happy to help.

      1. 1

        Firebase is good to bootstrap, but I would not completely buy into it. It has its cons and getting off Firebase can be a pain.

  2. 3

    Like others I too suggest Firebase.
    The only thing you need to worry about is,

    • Pricing: They charge based on per request. Free quota is very good.
    • NoSql db's in general are very bad for complex queries.

    If you want to host your own db and app server, I suggest you have a look at http://appwrite.io/

  3. 2

    Check out Firebase, easy learning curve so you will be able to pick up relatively fast. Firebase also has a bunch of other features which may be of interest: auth, serverless functions etc.

  4. 2

    Auth0 does this (identity management). If you license the application using signed certificates, you can treat the certificate as the identity from the client-side.

  5. 1

    There are plenty of C++ web frameworks you can use such as drogon, lithium, cutelyst, wt, and treefrog.

  6. 1

    Depending on how many users u expect you could go postgresql or sqlite. You cant really beat sqlite in performance and maintenance but if you need to write a lot by different threads (which I guess you don't) then it is not the right choice and you should use postgre.

  7. 1

    Check out https://appwrite.io

    feel free to join our community if you have any questions :)

    https://discord.gg/GSeTUeA

  8. 1

    hi! just saying hi and thanks for the follow!

  9. 1

    Hey man, I would be happy to have a call and help you out if you want

    You can schedule a call over here https://getadvice.github.io/adriano.galello.html

  10. 1

    The easiest, friction-free option I've seen is Hasura.io. It will let you create the database via a GUI, and access it using GraphQL from your c++ app.

    I have hasura in production for CoderNotes.io, and I recommend it for simple use cases.

    The only complication will be combining whatever your current user authentication is with it. How are you handling user auth now?

  11. 1

    Try lowdb, it is a super light weight database that let you store datas in simple json format... https://github.com/typicode/lowdb

  12. 1

    I would suggest postgresql with a thin ruby/php/python/go layer in front to do authentication and to convert between JSON and SQL. Costs around $5 monthly to host on Hetzner or Linode. It'll be fast enough until you hit roughly 20gb in storage. And since it only uses standard tech, you can then easily move to Amazon RDS and ec2. Since it's your own website that you fully control, integrating with Stripe etc. will also be easy.

  13. 1

    You could use sqlite, it has clients in all languages. Is extremely lightweight, you can even run it from a file and will do everything you want. The advantage is that it's just SQL so you can always switch it out to something else if you have to.