• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Can i configure single Website with multiple domains with multiple databases  RSS feed

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a website which is a forum having only one  database. When i sell to a customer abc then how sho
uld i create abc.mydomain.com pointing to its abc database. If i get another client as test how should i create
test.mydomain.com with test database. Is it posdible ? If yes how can i do it in spring boot java application.

Thanks
Swapna
 
Saloon Keeper
Posts: 5031
134
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting up (sub)domains is the work of DNS, which has nothing to do with Java or Spring. DNS entries are most often set and changed manually, but you may be able to use a library such as DNSJava to automate that with Java code.

You'll also need a way to create databases programmatically, but that's not a big deal.
 
Bartender
Posts: 19955
94
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That kind of depends on how you intend to package and distribute the webapp.

For a demo system based on Spring Boot, I'd recommend using a dynamic DBMS like Apache Derby, which can construct the database on the same machine as the application and do so on initial startup. Thus you'd know where the database was.

For a system that I sold to be deployed in other people's shops, the tasks of setting up the domains and the database would be Their Problem, and at most you might provide an installer program and documentation. And I probably would not use Spring Boot.

For a system that I wanted to host myself, like SalesForce or GitHub do, I would set up internal provisioning using one or more of the extremely evil set of tools I've amassed over the years. If you really used a different database (schema) for each client, you'd almost certainly want to deploy multiple instances of the webapp, with a separate connection pool for each client. Here, again, Spring Boot would not be used.

Finally, for a hosted environment, if you're designing from scratch, it's also possible to design multi-client webapp, where the client ID is used as a secondary key into each non-shared database table and use a single webapp. This is kind of complicated, but it's exactly what one system I supported for many years did.
 
Swapna latha
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:Setting up (sub)domains is the work of DNS, which has nothing to do with Java or Spring. DNS entries are most often set and changed manually, but you may be able to use a library such as DNSJava to automate that with Java code.

You'll also need a way to create databases programmatically, but that's not a big deal.


Thanks Tim, I understood what you said. I will google out to see how to create databases programatically and get back to you for sure.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!