How To on connecting to a hosted SQL Server Express database


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Jeff,



ES can definitely connect to any number of databases, just like you can have any number of data sources which connect to the various BOs. I'm currently using it to connect to an app database and a security database. I change both of these on the fly (to switch between dev, test and prod database sets). I also change between direct connections and ES connections. It is really flexible.



First, take a looks that the "Configuring DataSources.config" (Enterprise Server > Deploying the Enterprise Server) in the help file. There is an example that shows three data sources being configured. You'd have a datasource for every database available (i.e. lots of them). Then you would need to create the appropriate ES data source items in SetDataSources of AppMain.vb (program.cs). Here you would map the BO key to the ES key. In that same help topic, the EnterpriseDataSourceItem constructor parameters are explained.



Now in your case, I'm guessing you'd need to map a group of users (e.g. by client) to the appropriate enterprise data source. Then you'd dynamically build the EnterpriseDataSource based on the client. This could get complicated because you won't know who the user is yet (login happens later if you are using SF RBS). However, if you used a common security db, which included the table(s) that did the mapping, you could set the security up in SetDataSources and then setup the app db after they logged in, but before any UI is presented.



My understanding of licensing is that you get a license for every user that will access data via ES. Last I checked, you could also increase to more licenses as needed. If you have 50 users spread across 10 clients, you'd need 50 licenses to use SF. I believe when you hit around a 100, it just goes unlimited. Check the SF store for prices. The prices are yearly fees. ES doesn't really care how many data sources you're using, just how many users are using it. This is of course not the "official" word on it, just my understanding. I've been using ES for a couple of years now. Love it.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Greg,

Thanks for the opinion on separate databases.  I also felt it would be better to have separate databases for each customer for the same reasons you said.

However, I am not sure you are correct on the ES setup.  See Post# 24301.  As you can see, Trent states that a single ES Setup/Instance is configured for a single database.   So according to Trent, for all practical purposes, I really can't have different clients connect through a single instance of ES to different databases attached to a single SQL Server hosted on the internet. 

If I am still confused about how ES works and its licensing, could someone please explain to me in detail what exactly I can do with ES when it comes to having different groups of clients connect over the internet to different databases attached to a single SQL Server hosted on the internet and in my case hosted by WebHost4Life.com?  And how ES licensing works in this scenario?

Also, let me say this to help clarify my scenario.  Each group of clients will be given a dedicated database.  In other words, a group of clients will only be setup to connect to one database.  This group of clients will NOT have the option to connect to another database.  Again, all of the databases for different groups of clients will be attached to a single SQL Server hosted on the internet.  I hope this helps explain better what I want to do with ES.

If I am not explaining my scenario in terms that SF understands, please let me know and I will attempt to explain it in a different way.  Better yet, is there someone I can call to discuss this in detail? 

Thanks,

Jeff

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Jeff,



I'm not sure if you are asking about the databases because your concerned that ES can only connect to a single database or because of licensing issues with a hosting service (i.e. they'd charge per database). There are no technical issues with ES. You can use a single ES installation to connect to N number of databases. I.e. you could have one ES server/instance and connect to 100s of databases through it. Assuming the ES server and the database server(s) are on the LAN together, and that the ES server could handle all the requests (I pretty sure it can be clustered to scale if needed), this would work well.



In general, I'd leave the databases separate if I could. While you have some increased effort when deploying database changes with separate databases, this is negligible when using DDT. You also have better control of what gets upgraded with multiple databases. Situations such as if a client doesn't want to upgrade? Or you have one that needs a critical fix NOW, but you don't want to rush it out to everyone else just yet.



If you have a single master database, this increases the complexity of the app/db. Now every table, BO and browse dialog needs to be client aware. You'll spend more time optimizing queries/views/sprocs. Also, if a database becomes corrupt, all your clients go down while you fix it for the one. If you get a huge client that needs there own server, you'll have more work to do get their data out of the master, etc. In general the master database is just a PIA.



Having said that, I use the master database concept, though in a different situation. In my case the partitions are on "projects" which are in the context of a single business (consulting), so I have to have all the projects in a single database.



Hope that provides some insight into what you might get into going the master database route. I'd be interested in what others think on this matter.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Trent,

That's great news. 

I do have a question that I would like your opinion on.  Right now I am maintaining a separate database for each customer who will connect 2-4 client licenses to it.  On the average, each database will contain up to 500,000 records.  In my mind and based on my limited knowledge of SQL Server, it seemed like a good idea by keeping a clear separation of the customer databases from one another.  Based on my last email and the ES licensing cost issues I was facing, I was considering modifying my database and code so that all of the customer databases can reside in a single master database.  Although this requires a lot of work in reconfiguring the database and refactoring of my code, I felt that in the long run it would be worth it to be able to use ES so that I can host the database on the internet.  In fact, one of the main reasons why I decided to use SF on this project was because when I was in the training class last year you covered the benefits of ES.  I knew at some point I would want to be able to host the database(s) on the internet while at the same time keep my app in Windows Forms with the ability to load thousands of records and not have to redesign it to run as an ASP.NET app.   ES was the perfect solution.

Of course, being able to purchase an affordable licensing for my current scenario is the easy way to go.  However, I am willing to make this effort if you see some major benefits for me to have a single master database hosted on one web site.

What is your opinion?

Thanks,

Jeff

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Sorry....you can call the sales line or email him at wjtaylor@micro4.com.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Jeff,



If you will contact Jay Taylor we have a model that you can purchase that is fewer than the 25+ listed on the website which will be more palatable for these smaller installs. We can most likely work something out for both 5 and 10 user models.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Trent,

Now I understand the licensing for ES.  Purchasing smaller host cals seems to be not a problem as far as I can tell at this point. However, based on your ES licensing as I understand it, I will need to purchase an ES license per hostname/database.  In my scenario, each one of my customers will have their own database and 2-4 client licenses connected to it.  Unfortunately for me, the licensing cost $995.00/year for ES per hostname/database for 2-4 client licenses per customer is not affordable.  There is no way the customers are going to pay for this.  It is certainly cost effective and affordable when you have 20+ users connecting to a single database hosted on the internet. 

As all programmers sometime have to do with programs they create, I am going to have to come up with a created, effective way of delivering large number of records to my windows program that will be acceptable to my customers.

Thank you for your help!

Jeff

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Does this seem to be a reasonable thing to do?




Sounds good to me.



Also, I am sorry, but I guess I am still not sure how the ES Licensing works. Let me explain what I want to do this way. All of the clients will be running the same exe, which I believe they will ALL then have the same data source key. However, each client will need to connect to their own database, BUT all of the databases are attached to the same SQL Server hosted by WebHost4Life site. How does the ES licensing work in this scenario?




Well, the issue is that the database that is used gets configured on the ES side. When the connection string is established within the config file, you specify the database. So it would be better to purchase smaller hosting CALs and then setup an ES site for each client that will have a different database name. That would be the most simple solution. Trying to change the database on the fly on the ES side could be more overhead and a lot more work.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Trent,

Thanks for the info.  Right now I do have the logic to check for new versions by reading the Version Number in a table in the database.  If they are different, the application shells out and runs the update from a predetermine location.  Right now I am in the test phase of my system and I am running all of this on a local network.  But for my production system, I will need to host the database on the internet.  I am going to have a lot of databases hosted on the internet and did not want have to update each database with the new version number. So some how I want all of the clients to receive a version number from a single source by querying the it from a web page or web service to determine whether or not they need to run an update.  Then if different, then have the client app automatically download and install the update exe from the website.  Does this seem to be a reasonable thing to do?

Also, I am sorry, but I guess I am still not sure how the ES Licensing works.  Let me explain what I want to do this way.  All of the clients will be running the same exe, which I believe they will ALL then have the same data source key.  However, each client will need to connect to their own database, BUT all of the databases are attached to the same SQL Server hosted by WebHost4Life site.  How does the ES licensing work in this scenario?

Thanks,

Jeff

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
As you mention for setting up ES, is this the directory I upload the ES Zip file and extract it into this directory? Also, once I extract this zip file, where do I add the license file?




Yes, just extract to the destination. The license file will go in the "bin" folder.



Being new to all of this, do you recommend I rename the folder "site1" to something else or create a subfolder to keep the ES web service separate from my main official ProspectHelper.com site which I am going to create later? Just looking for best practices here.




This is really up to you. Generally I give it a meaningful name.



Also you mention in another post, it would be easy for me to setup a way for my app to check a version via a web service and have my app automatically download and install the latest version from this site if they have permissions. How do I accomplish this?




Well, this is a pretty loaded question Wink You still have to write the logic, but in short you have to create the version that to which your application will query. In suprt-short explanation, I get the version from the local assembly, then query the Version table to see if they match. If not, then I will download from a pre-determined location OR pull the downhload location of the new build from the same version table (i.e. a VarChar field containing the URL for that version).



When using ES, I believe I can have different clients connected to different hosted databases. The only limitation would be the number ES licenses I have purchased determines the number of client machines that can connect to different databases using ES. Is this correct?




Well, if you are going to use different databases and then each of those databases have a different DataSourceKey on the BO, then yes (same applicaiton but more than one database being accessed within the application). The data source key on the client and the ES server must match. If you are going to use the same BOs and then want to redirect them to different databases (i.e. 2 different clients with the same data source key names) then this will not work and you will need to have a separate ES site for each database. If your application already handles different clients with the same database, then this is not an issue.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search