Migrating from a free web host that uses mysql and phpmyadmin to Coronium

Hi,

Yes, I was thinking of suggesting something like that as well. All that is needed is to store the coordinates on the User object:

[lua]

coronium:createUser({email=“me@here.com”,password=“1234”, lng = 36.0, lat = -57.0})

[/lua]

You can use any of the Mongo “operators” in a query (except geo-related due to Lua array handling).

I’ll write up a little sample query in a bit.

Cheers.

Hey guys,

To start off, I would like to thank you for replying, your posts have clarified a lot for me! @develephant, I’m not sure what you mean by corona test application, if you mean the sample applications that come with the sdk, then no, I’m working on a personal project (started from scratch). I feel silly now, because what was causing me the most confusion was the fact that I had no idea where to create my relational database… I actually had already gone through everything (I think) in the coronium docs before. I now found the database tabs in the coronium instance, either the MySQL one or MongoDB. I noticed from the code you posted of the User module, it’s not pointing to any specific database? Also, you mention that to use MySQL we need to use cloud code to query the database, does this mean we cannot use php scripts? (I know that’s stupid to ask, considering there is a php directory in the instance, but just making sure)

That being said, is there any benefits/disadvantages of using one or the other (MySQL vs MongoDB)? Or is there one that is recommended to use when working with coronium? I know this probably boils down to personal preference, but I just want to know, just in case, so I wouldn’t find myself in the future having to rewrite everything once more.

Adding on to what @Rob Miracle (thanks for filling in for me! I was in class all day) said, from what you explained, can I assume It’s also possible for users (in my app) to set up a meet up location amongst them?

Thanks!

Hi,

The idea behind Coronium was to abstract away as much of the “busy” work into the core API. So, for instance, the User module uses MongoDB, but it already has a prepared database (including sessions, etc), so you just use the API calls, and the datastore manipulation is handled behind the scenes. Data Objects are stored in Mongo as well in their own namespace. You don’t “create” anything.

As far as MySQL, it’s provided mostly due to its popularity. PHP as well, is a “bridging” function and not really meant to be used as the core of your Coronium app. You will have to experiment to see what works, and what won’t in PHP land.

I have to ask, but what is keeping you from using your current setup? Do you have a particular need to use Coronium? It sounds like you already have most of your functionality handled. Wouldn’t it be easier to move to a host like DigitalOcean and use a prebuilt LAMP instance or something? I’m not trying to deter you from Coronium (I’d love for you to adopt it!), but I also think that any developer should work with the tools that they are most comfortable with. No need to bring in extra complication if you already have a working base.

Coronium tends to be easier to adopt if you have little or no previous server/database knowledge. Actually knowing how to work with the PHP/MySQL combo will most likely leave you scratching your head, because what you are used to dealing with has been abstracted away as much as possible in Coronium. As far as development is concerned, the preference is LuaJit/MongoDB over PHP/MySQL.

Hope some of that helps. 

Cheers.

Hey @develephant,

To be completely honest with you, I’m not really sure. it all started off with me finding this tutorial while doing some searches in google, which consisted of using Parse server to make a simple chat application using corona. So looking at the tutorial, it all just seemed really simple, and it made me think that there was a RIGHT way of doing mobile apps, using the RIGHT backend. So that lead to me asking on a different topic about picking a backend/backend service, to which @Rob Miracle recommended using coronium.

The other kind of big reason why I thought I would need something like coronium was because of the functionality i wanted to implement to my app: Giving the users ability to set up meetings amongst themselves, so user-to-user interaction, which from what I understood, required push notifications, something that I thought only services like coronium could do. A bit after that, Rob again clarified that php can actually handle push notifications.

I’m actually fairly well versed with mysql, but a little less with php (took database management last semester), enough to handle or be able to figure out what I need.

So to sum it up, I really don’t know anymore if I should stick to coronium now, from what you just told me. I guess as long as I figure out how to handle push notifications from a normal amp server i wouldn’t have to switch over (finish switching over).

I appreciate your honesty though!

Hi,

There is no doubt that a PHP/MySQL combo can handle everything you need. I spent years in that space as well. Coronium was an opportunity to explore some other technologies, and simplify some of the whole “stack” work for others who would rather not get too involved in the ops side, but still maintain control of their content/data.

In either case, good luck with your app adventures. :slight_smile:

Cheers.