Jump to content

Main Domain for CMS, subdomain for application?


Recommended Posts


I'm trying to figure out what might be the best approach when using PW for your CMS, but needing access custom tables. I know you can query your custom tables, so that's not my question here. What I'm trying to figure out is if I should separate an application from PW.

Out of the box, the application I will be using has its' own tables and the app is built towards using those tables, so I don't want to rewrite the app to use PW, seems too much work.

I do however want to use PW for the CMS and frontend where my users can add/update rows in those custom tables. Now the app itself can be connected from various devices on a handful of ports, so I'm expecting a high volume of requests to the app to a point where I'm seriously considering a dedicated server for this project.

Would it be beneficial to create a whole subdomain just for the app and use PW to query the db? Or should I keep the 2 in the same db? Pros/Cons would be great here.


Link to comment
Share on other sites

  • 2 weeks later...

So I've been working on a special class for the app interacting with the app's db tables.  I've went and added 2 tables onto here.

  1. pwusers - This is where I store just the id of PW users (since the app has its' own users table as well)
  2. users_pwusers - A relationship table connecting pwusers to the existing users table of the app.

The idea is when a new user is created in PW, I would simply:

  1. Add that id to the pwusers table
  2. Create the user in the users table in the app
  3. Add the 2 ids into the relationship field.

From there, I have a way to retrieve information from the app associated with the user created in PW.

I believe this is the focal point between the app and PW. Setting up this way will allow me to keep the the front end and the app separate in case I ever want to move the app to somewhere like AWS or Rackspace and utilize their database services for high volume.

My only concern that's in the back of my mind is synced backups and restores.

It's still in early development phase so there's still a lot of room for pivotal changes if anyone has a better approach.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By humanafterall
      I'm looking at how I might achieve the following with Processwire:
      A low-bandwidth version of a website, on a subdomain (eg text.mydomain.com), where the content/database is exactly the same as the top level domain, but a new set of templates is used so the site is stripped back to just very simple CSS/low quality images.
      I'm looking and trying to work out what might be best — is it multi-site from the same database? Multi-instance? API? 
      Any guidance or experience of a similar setup would be much appreciated.
    • By ivineet9
      My client has a specific need where they need the website to be hosted in a subdirectory in the root domain; but need the admin panel to be accessible only via subdomain.
      They say this is for the security purpose.
      Frontend: https://example.com/app/
      Backend: https://appadmin.example.com
      Anyway I can quickly achieve this?
      Thanks a lot.
    • By JeevanisM
      Hello All,
      Recently I have read a series of articles about some new terms like Headless CMS, Hybrid CMS and Digital Experience Platforms ( DXP). I cannot get a clear picture of these but I could understand that these are different from the traditional CMS as we use now, at least in theoretical level. Does any one here have any better understanding on these topics ? may be what / how we can apply these on the processwire CMS ?
      just for the talk
    • By ttttim
      I'm working on a website where in the back-end in one template i have multiple page reference fields using the same conditions (parent and template). Is there a way if i selected a page in field A it won't show up anymore in the list of field B or field C etc?
      I was looking at creating a custom string but i couldn't wrap my head around it.
    • By MischaK
      I'm someone who has been developing websites for a while, mostly doing full stack .NET development and ASP scripting before that, while using Silverstripe and some other PHP frameworks for some smaller projects which worked well enough for quite some time. 
      Now I have some time on my hands and decided to evaluate some different CMS options. 
      Diving in as a newbie into: 
      After a short while I decided that Wordpress was out while I'm still evaluating Craft and Processwire. 
      My question is, is there any interest here in reading about my experiences in trying to get the feature set I want up and running, with these other systems?
  • Create New...