Implementation strategy: Registering and unregistering entities

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paragpdoke
    New Member
    • Dec 2007
    • 62

    Implementation strategy: Registering and unregistering entities

    Hello Everyone!
    I have to ask about how do I approach this problem. The scenario is explained below.

    We are a QA organization and need to deploy many versions of an application. There are some helper scripts which gather information about the app (version, components, host name, etc) and hit a PHP get URL. This PHP code saves the information inside an XML file.

    While apps regularly get recorded into this XML, there is no mechanism to un-register (the app is deployed on Unixes too, so there is no uninstall code as such, it is simply required to delete the app folders). I would estimate that an app deployed is deleted after around 1 month.

    I am unable to decide when do I check for older entries in the XML.
    - Should I record the date when the entry is made in the XML file and on each execution of the PHP to record a new app, parse the XML to find existing dates and remove those recorded prior to 1 month ?
    - Another line of thought was to try and connect to the app via http (within the PHP code) if it was over a 1 month old. If the app was available, retain else delete. But doing so for each execution (when another record request comes to the PHP) would be time consuming. Is there something like starting a new thread ? (I am a newbie to PHP)
    - My XML is stored on a Unix system (Solaris 10 to be precise). I was also thinking about a daily 1 time cron task.

    Can someone please suggest what approach do I follow ? And if new threads / processes could be spawned from PHP ?

    Thanks in advance,
    Parag Doke
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    You have PHP launch of another application on the server that does this. see the manual of system() and exec() calls.

    Based on the information you gave me, I don't have enough to decide. Don't know any performance metrics other than "time consuming".




    Dan

    Comment

    • paragpdoke
      New Member
      • Dec 2007
      • 62

      #3
      Hello dlite922.
      Apologies for being unable to convey clearly in the 1st attempt. Here is an excerpt of the XML file where the information will be saved in:
      Code:
      <App id="InstanceName@host1"> 
          <Release>R1</Release> 
          <Build>B1</Build> 
          <Component>C1</Component> 
          <Arch>x86</Arch> 
          <OS>2003</OS> 
          <DB>SQLServer</DB> 
          <Host>host1</Host> 
          <Contact>myemail@company.com</Contact> 
          <URL>http://host1:port/webapp</URL> 
      </App>
      There are many such entries (right under the root node) in the file (around 100). When a new entry is to be registered, if I decide to parse the date registered tag (to be introduced if this method is chosen), it might take time to finish the registering. But maybe I am wrong here and it might not have a noticeable effect on the performance as PHP could be fast enough (as I said, I am a newbie to PHP).

      Thank you for the suggestion about system and exec. I will try them and see if those help.

      Regards,
      Parag Doke

      Comment

      Working...