Advice on retrieving data from SQL database

520
2
Jump to solution
02-18-2020 07:05 AM
FranklinAlexander
Occasional Contributor III

I have been tasked with migrating an R Shiny App to Web AppBuilder and the data for the app is located on an SQL server and is currently being accessed through a open source api.

Question one is: do I need to locate the application on the same server that the api is located on in order to prevent a cross-origin domain error? I ask because this is exactly what happened when trying to make a ajax request from a different domain than that of the api. 

Question two is: Which is the best route to go for this? Continue to use the third party api to connect to the data, or create views to the database tables in ArcMap and publish a new REST service. It seems there are advantages and disadvantages to both. My thinking is that creating the new REST service, while being a little more work at first, would save time and effort in the long run because there would be a lot less custom coding querying the data ( I should be able to use out-of-the-box widgets). Unless I am wrong, If I access the data using the third party api, it would require a lot of custom coding on the back end when trying to query the data.   

 

Thanks for any comments and advice

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Franklin.

1. Yes that would be by far the easiest way to avoid cross domain issue.

2. I personally would stick with the api for accessing the data. I do this on my end an prefer it as limiting access to my data is preferred and custom coding is my cup of tea. Just using the esriRequest class to make the api calls is pretty simple.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Franklin.

1. Yes that would be by far the easiest way to avoid cross domain issue.

2. I personally would stick with the api for accessing the data. I do this on my end an prefer it as limiting access to my data is preferred and custom coding is my cup of tea. Just using the esriRequest class to make the api calls is pretty simple.

FranklinAlexander
Occasional Contributor III

Thanks Robert. That helps a lot as I still have a lot to learn when it comes to the server side of things and you haven't steered me wrong yet! 

0 Kudos