Hi Guys, I will be deploy an app, ee want t...

(Marco Silvio Jäggi) #1

Hi Guys,

I will be deploy an app, ee want to distribute this app to our customers.

Our customer have their data in a MySql database.

What is the best way to distribute the APP, considering how each customer needs to refer to their database?

Thanks

(Bellave Jayaram) #2

@Marco_Silvio_Jaggi can you say how the app data sources are now configured? I am not sure it is possible to set up the app so that it dynamically hooks up to a specific MySQL database source for each customer. From what I understand, you can set up “views” for each customer’s own records within a single MySQL database. @RezaRaoofi may be able to clarify.

(Marco Silvio Jäggi) #3

@Bellave_Jayaram

Thanks Bellave, The databases have the same structure and we control the access.

My question is about the better mode to distribute the APP.

E.g. I can copy the APP and create a link with the “new” database? I have to copy the APP for each costumer?

Thanks for your answer

(Marco Silvio Jäggi) #4

Yes, I realize that it is not clear.

I’m sorry.

When we delivery our APP to our clients, the APP has to refer to client’s google sheets and tables mysql.

First time. How can I link the APP to the client’s data?

After first time, when we deploy a new APP release, how we can distribute the new APP release without restore all the data links?

(Reza Raoofi) #5

Yes, if you are using a separate set of tables for each client regardless of using spreadsheets or MySQL databases, then in each new app release you will have to go to app design and manually change the data source in each table from the development app’s database/spreadsheet name to client’s live database/spreadsheet name.

There are 2 alternatives though:

  1. Keep all clients’ data in one database, and consider a column in each table named Client ID, then in your app use Security Filters for all tables and filter only clients’ own data; this way you can save some time on future release’s work at the cost of worse database design/privacy by keeping everybody’s data in one large database.

  2. You can take advantage of data partitioning which is one of AppSheet’s new features and it is still in Beta; data partitioning will allow your app to connect to different data sources for the same table in your app, based on a specific variable that you define (e.g. Client ID); however this feature is only available for Corporate plans; check out the article below for more details: https://intercom.help/appsheet/performance-scale-reliability/scaling-to-large-data-sets/scaling-using-data-partitions

(Marco Silvio Jäggi) #6

@RezaRaoofi

Dear Reza,

Thank you for your suggestion, we have forwarded the application for a Corporate Plans.

However, we hope this is the solution to create and maintain APP that can refer to different databases, one for each customer. Please reassure me about this.

The first solution proposed by you: “Keep all clients’ data in one database”, is not exploitable even for legal reasons.

Anyway, how can I “change the data source in each table”? I didn’t found where is this capability.

(Reza Raoofi) #7

@Marco_Silvio_Jaggi It is in the same link I sent you about data partitioning; it is the very last paragraph with this title: Data partitioning: multiple spreadsheets, but instead of using multiple spreadsheets option, you can use multiple databases, because each MySQL database is added as a new data source to your AppSheet account just like the way you can add a new spreadsheet, so when you build a new database for new client, you just need to adjust the definition of the table to be able to connect to the identical table in a different data source based on the variable you define for Client ID.

Just play around with the data partitioning option inside your table’s properties, and you will get a hang of it.

(Marco Silvio Jäggi) #8

@RezaRaoofi

Thanks Reza,

the “partition” configuration does. Now I start with test, I keep you in touch.

Could you help me about this error message:

Table ‘appUsers’ has an invalid partition definition ‘SWITCH(LOOKUP(USEREMAIL(), “shtAccessAdm”, “UserEmail”, “Client”), “Georgia”, “Table=appUsers_in_jem_crm_data_mktgeorgia__appUsers”, “Table=appUsers_in_jem_crm_data_mktgeorgia__appUsers”)’. Unable to find table ‘shtAccessAdm’, did you mean ‘shtAccessAdm’?

Only for a better comprehension: shtAccessAdm is a Google sheet.

(Reza Raoofi) #9

I can’t troubleshoot that. I suggest to add a new separate post in community and ask for help with the LOOKUP expression you have entered in data partitioning and the error; someone from AppSheet team might need to look into the app for you.

(Bellave Jayaram) #10

Yes, currently I do not know a way other than to copy the app for each new database.

(Marco Silvio Jäggi) #11

@Bellave_Jayaram

Ok - That means I have to copy always the new release for each database?

(Bellave Jayaram) #12

Yes, once you make a copy, if you need to make a change in the app, you have to do it in all the apps.

(Reza Raoofi) #13

@Marco_Silvio_Jaggi If you control the access and you own the MySQL server, I believe the best practice is to copy a separate new database from the same structure template for each customer, and then each new copy of the app would have to be adjusted to connect to the same table names but in a separate database. This would work the best if you are also keeping the apps in your AppSheet account, and you are not transferring apps to customer’s AppSheet account.

In other words, your MySQL instance will be a multi-tenant database server.

(Marco Silvio Jäggi) #14

@RezaRaoofi

@Bellave_Jayaram

Thanks guys.

Happy new year

(Reza Raoofi) #15

@Marco_Silvio_Jaggi you’re welcome, and happy new year! :tada: :slight_smile:

(Marco Silvio Jäggi) #16

@RezaRaoofi

Dear Reza,

Thank you for your greetings and answers.

Now, we are very unconfortable if, always we change something in our APP, we have to restore all the link with the tables, it does not matter if those are google sheets or mySql tables.

Is this the only solution to deploy an APP?

(Reza Raoofi) #17

@Marco_Silvio_Jaggi You are welcome!

What do you mean by: “we have to restore all the link with the tables” ?