Development and Live Databases

Hello Everyone… :slight_smile:

So in Bubble you have two environments: Development and Live. Each has its own Bubble equivalent of the php file structure and its own database. In Bubble you develop your app in Development, and then with a simple button click choose to publish your updates to Live.

How is a similar environment best managed in Wappler?

I’ve found this post on the topic…

Should this do what I am looking for?

Best wishes,
Antony.

For now I would just focus on your local(development) environment. Staging and Live/production are questions for later. There are so many options.

2 Likes

Thanks for your reply @JonL… but it is important for me to get this big picture over the next couple of weeks! I will play around with the previously mentioned posts to get a flavour for how it works… :slight_smile:

You can set multiple targets in wappler, by default you have local which is your local settings, generally on your own machine.

I generally have a second set which points to my local server which can be on your own machine (localhost) or on a server on your network if you have one. This is effectively your test machine

I then have another target pointing to the live server.

You can just develop on your local server then publish to your remote when ready. The only manual part is syncing database structures if necessary, an easy enough process

In addition, if your server is docker deployment enabled you can use Docker as your local development server and then just publish to live via docker deployment

Hi Antony,

My preference is to make sure my workflow for production and staging pushes is very different from dev changes, so I have only one target in Wappler. It would be far too easy to inadvertently develop on production.

That one dev target can be Docker our local or a remote server. All three are very fast.

When time to push, I turn to git. I have a single remote in Wappler git which is github. I push to github when I have a release for production.

From this point on I leave Wappler, again so it is clear I am changing production code. I ssh to the server I want to update, be it staging or production, and perform a git pull from github down to the server. I don’t script the process as I want to deliberately enter my github credentials.

Someday I will get a similar process in place for dB schema updates, but for now I manually execute sql scripts.

—Ken

6 Likes

For what is worth I use Ken’s exact approach.

Hey everyone, thanks for all your input! :slight_smile:

I appreciate you taking time to document them for me and all other Bubblers who follow. I will have a play with those methods later on in the week…

I’ve read mulitple things about Docker and still feel very confused about its role in web based app development, but I’ll keep reading and watching so the Docker aspect of your proposal makes more sense, Ken!

8 posts were split to a new topic: A Docker analogy

Hey folks…

So I’m getting ready to go!

First off, I’m going to install a local environment on my PC. Would Xampp be the most straightforward option to go for?

Nope. Docker Desktop.
You should check the docker guides parts 1 to 4 here in the forum.

1 Like

I found docker ridiculously simple in comparison to trying to work out a web server etc

Coming from bubble aswell

4 Likes

Thanks for all the input folks! :slight_smile:

I’ve downloaded the Docker desktop and will install it shortly.

I’m working my way through Git videos and will be on the case of that.

So now my mind turns to the database…

So in Bubble, you define data types and fields once and they are reflected in both development and live databases.

Clearly in Wappler if you work outside of Docker and have local and remote/live databases, they are completely separate. In this case, what is the best way to sync the data structures in those as your development progresses? Or do you recommend having two code bases but only one database?

And with Docker… Can you sync the entire local database to the remote/live version in some way or is the issue the same as described above?

Since many people like me coming from Bubble have never managed all this stuff before in our lives, these are big questions with scary consequences if we get it wrong!

You are not going to like my answer. As I already mentioned this before but…

Focus on the local development and leave production for the future. Your focus should be building and learning Wappler.

I actually dare you to decide your deployment and data migration methods today and stick to them when the day comes. I double dare you. You won’t.

There are dozens of ways you can migrate a project to production including what Wappler provides and outside of Wappler. By the time you are ready two or three additional ones will be there waiting for you to take a decision. You can even hire people to do that for you if you don’t feel confident when the time comes.

You are tying to eat the elephant in one bite :slight_smile:

You are not going to get the deployment and data migration wrong as long as you get your local app right. Just make sure your local backup procedure is solid because losing data is the only scary thing out there.

Hi there @JonL

(you may not like my answer either! :slight_smile: )

Thanks for your reply… but I have to say that in my opinion, that kind of answer is going to turn away someone coming from Bubble with my kind of background. In my view:

The opportunity with Wappler is the freedom of choice and flexibility.
but also…
The challenge with Wappler is the confusion of choice and flexibility.

Especially when it involves a whole new world of tools and terminology you are not used to.

And as you will have seen with the response from @ChadWyatt, we only have so much patience in looking to move to another platform before we decide it isn’t worth the effort. And in that evaluation process, we want to feel safe that we understand the big picture and all will be okay. For me, being told how I should approach my learning and that I should just trust something will be okay is a big turn off. I personally need to know and trust in how this will all integrate together before I am willing to make the leap.

So please, I would ask again if someone is able to answer my question… and while there may be a wealth of different answers, point me towards one or two possible solutions, and especially ones that are not too complex and maybe most easily relate to my existing knowledge of how Bubble works. And if the answer is “this will all be really simple when we have a database manager product” then an overview of how that may work and some kind of timeframe for its expected delivery would be really helpful!

Best wishes,
Antony.

The simple answer is that Wappler will migrate your app and data “automagically” via docker engine to your production environment thus my recommendation on using docker desktop instead of WAMP/MAMP/XAMPP.

Oh, that is fab news… so it sounds like:

  1. It will be easiest to use Docker?
  2. I will probably be best to use a hosting service that supports Docker then, like Digital Ocean?

… but how does that work when my users have live data in my remote production environment database and I have test data in my local test database?

  1. In this Docker scenario, will I have one database or two?
    If two:

  2. Will the updates made to the local database structure be replicated to the remote one “automagically”?

  3. Will actual data be synchronised in some way?

  4. Is all this explained in some Docker or Wappler documentation you can point me to somewhere?

And what would be wonderful would be a nice @Hyperbytes video that explains all this stuff!

Thanks for your help @JonL and for your rapid replies…

Antony.

Hello @Antony
Even if you are not using docker on your hosting, you can just export an sql dump, when you finish working on your testing server. Then, on your hosting you import the dump - and you just change your site target and database connection details to point to your server.

Thanks for your input @Teodor… and that helps me when I am in pure development mode…

… but right now with my app in Bubble, I am developing new features in the development database and I have two beta site users working with their real clients in the live/production database… so I need a facility as Bubble offers to be able to reflect my newly developed data structures from the development to live/production database, while maintaining my users’ actual live data…

… so I guess what Bubble does is a sync of database structure without transferring any actual data… which seems to work really well!

Today? Yes.

Absolutely.

That would be the minimum yes. But that is a Bubble limit…and bad practice.

Why not three? Bubble should have added a 3rd environment long time ago but they refuse.
Dev(Local), Test/QA/Staging and Production

Today? No. Automagic only works for the first deployment or at least the initial deployments where you don’t have live data. You will need to learn how to migrate manually as the new schema(db structure) will differ from your live one that has data based on your previous schema.

Tomorrow? I believe database migrations are on the roadmap.

Just one comment here. In Bubble you had to look in their docs to learn how to do these type of things. With Wappler you can use Google for that.

Look for mysql schema migrations and mysql dumps. A tool like MYSQL Workbench will be also useful.

1 Like

But really…AGAIN…all this will just mess your head and learning path.

In Bubble you had to ask if something was possible as it’s a closed platform.
In “our world” and by “our world” I mean the coding world EVERYTHING is possible. I was actually going to say except sending rockets to Mars but you can do that also with the right knowledge.

Wappler facilitates every single week(except when they decide to go watch football) that we can do anything we want without coding. But you can actually always resort to coding which is a great skill to learn.

You just need to have some faith in the people that know. Deployments and data migrations are NOT something to worry about now. And with all the respect of the world I can try conveying to you…you are just losing your time worrying about that.

I am pretty sure that by the time you finished your app either Wappler has integrated fully database management and migrations or you have learned how to do all that manually just by reading the forum.

1 Like