Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Multiple database usage in same Links SQL? - Suggestion

Quote Reply
Multiple database usage in same Links SQL? - Suggestion
Multiple database usage within the same Links SQL was discussed several times in the forums, but I did not find clear opinion of Alex, if the developers would like to implement this...

Let me show you, what features I mean by the "Multiple database usage":

  • create new "links databases" from admin interface

  • a new "links database" can be created 2 optional ways:

    1. a) by changing the table prefix, so several "links databases" can be created within the same MySQL database.
      E.g: we have MySQL database "mysite", and we create new "links databases" using different table prefixes which will look like "lsql_category" or "faq_category" or "news_category" or using anything other prefix.
      b) by creating new MySQL database (or if the user already created a new database, then only by creating the new tables in the selected database)
  • each "links database" has its own config files & tables as showed above

  • having a downdrop menu at the top-left of admin screen to select the actual "links database" we are working on

  • the dynamic page display scripts like page.cgi should have posted a "db" argument in the url like this:
    E.g:
    http://www.site.com/cgi-bin/page.cgi?g=Computers/Video&db=faq
    or
    http://www.site.com/cgi-bin/page.cgi?g=Computers/Video&db=news



  • Reasons, why the "Multiple database usage" feature would be fine:
  • separate backupability of the "links databases".

  • Just imagine that a faq database does not need so frequent backups like a links or news database. So if you have faq, news & links, then it's logical to store them in separate "links databases" not in just one.
  • speed & efficiency: having these databases separately the speed can be increase if e.g: both links & news is a big database.
    A website having several services with high traffic using dynamic page display, may slow down because of locks. Using separate tables or databases, much higher traffic is possible per service.

  • more safety(?)


  • Well, in overall, there are quite a few places where the "multiple database" feature needs modification, but I think it's not a very difficult job. However requires many similar modifications across many dynamic cgi files, some in the admin interface, and maybe some in a few other .pm files.

    Modifications required:
  • modifications in admin.cgi and some files which is used by admin interface

  • modifications in page.cgi, add.cgi, jump.cgi, etc... dynamic pages to treat the "db" argument

  • Links/Config.pm - is the default config file, which is base config when creating new databases.

  • Links/Config_news.pm or Links/Config_faq.pm or Links/Config_links.pm - will be the config of the actual database.

  • Links/ConfigData.pm - is the default which is base config of new databases.

  • Links/ConfigData_news.pm or Links/ConfigData_faq.pm or Links/ConfigData_links.pm - will be the config of the actual database.

  • some other files, templates(?)


  • The lists above are not quite complete. There is possible that some more modifications are needed and maybe there are some more reasons why the feature would be useful...

    I planned to implement this feature, but if Alex decide to implement it into Links SQL in the future, then I will wait until that release.

    Alex, let me know your opinion...

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

    Last edited by:

    webmaster33: Feb 4, 2002, 8:40 PM
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Just bringing to top.

    Alex, did you read it?
    I would be really curious, what is your opinion.

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Alex, could you post your standpoint about this suggestion?

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Obviously I am not Alex and this is a really simple answer to a very complex question.

    One of the constraints GT faces in writing scripts is that a sizable portion of the customer base utilizes shared hosting accounts and not dedicated or virtual servers. Many hosting companies only allow one mySQL database per account in the format of yournamebd.

    While the multiple databases you suggest have a variety of benefits, structuring GT scripts to require multiple databases would effectively exclude much of GT's existing customer base from using these scripts.

    Thats probably the short answer as to why GT scripts are set up to use only one database. Addressing the issue of adding an option for the support for multiple databases to GT scripts, however, is well beyond my range of techical expertise.
    --
    Rob

    SW Montana's Online Community
    Modular Model Railroading
    Quote Reply
    Re: [vanderen] Multiple database usage in same Links SQL? - Suggestion In reply to
    Hi vanderen,

    Let me show you what I mean. Read the answers after the quotes...
    In Reply To:
    Many hosting companies only allow one mySQL database per account in the format of yournamedb.
    Yes, this is true. But read my original post again.
    I suggested, that the database could be created in 2 optional ways (the keyword here is the optional):
    a) by changing the table prefix: This allows to use just 1 database and to have somekind of many "virtual links databases", just by changing the prefix of the table names we use. This way we can have almost unlimited number of LinksSQL databases on the same homepage.
    b) by creating new MySQL database: This is true, you must have the right to create new database. It is only possible, if your hosting company allows it.
    But if you don't have the right, just use the option a), which will just create new tables in the same database. Easy solution, eh?

    In Reply To:
    While the multiple databases you suggest have a variety of benefits, structuring GT scripts to require multiple databases would effectively exclude much of GT's existing customer base from using these scripts.
    It is not a question, if it would be useful, or not. It could expand flexibility of Links SQL (which we have paid for), and it would not require nothing special for current or future users. Is it clear, isn't?

    The only question is, if Alex wants or not to implement this feature. It is not a very difficult development, and depends only on will of Alex. I watched replies of Alex in similar feature requests, and I did not see any clear replies of him, if he want to implement this or not.
    Check this post to see what I mean: Re: [fmp] NEED help Alex....(multiple database LSQL)

    Alex recommends to buy so many LinksSQL licences, as many Links directories do you want to start.
    So I think, this is mainly a business & money question. If a site should buy 2-5 licences for his site, then the income of Gossamer inc. will 2-5 times more. But why to spend 2-5 times more, when the software could be able to treat more Links SQL services within the same website.

    I just wanted to know what is the opinion of Alex, because if he doesn't want to implement this (many times requested) feature, then I will do the modification for myself.
    But if it's this feature is planned to be implemented in the near future, it is unnecessary for me to start developing it.

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Hi,

    Sorry about the late reply! This is quite different from the other post (I think). The original post was asking for a single Category table, but multiple Links table.

    This seems to be asking for just multiple databases in one installation (i.e. separate category/links table for each category).

    You could accomplish this with a little programming. Basically you would want to modify sub init() and init_user() in Links.pm and have it load a different defs path and config file based on form input. It would not be a simple one line change, but could be done quite a bit easier then the original request.

    As to whether this is something we would include in a future release? Possibly. However, not in the near future.

    Cheers,

    Alex
    --
    Gossamer Threads Inc.
    Quote Reply
    Re: [Alex] Multiple database usage in same Links SQL? - Suggestion In reply to
    Hi Alex,

    In Reply To:
    Sorry about the late reply!
    No problem. I just thought you missed my post.

    In Reply To:
    seems to be asking for just multiple databases in one installation (i.e. separate category/links table for each category).
    Yep, a feature to be able using multiple databases on same site in one installation.

    Thanks for your helping idea how & where to do this modification.

    In Reply To:
    As to whether this is something we would include in a future release? Possibly. However, not in the near future.
    If I will have enough time, I will do this development (if you did not implemented yet until that time).
    Alex, I will notify you, if I finished completely this Multiple database mod (including the admin interface for it).

    Another question:
    Could be possible to solve the multiple database problem by creating a plugin for that, or it anyways require modification in Links SQL itself?

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Quote:
    Another question: Could be possible to solve the multiple database problem by creating a plugin for that, or it anyways require modification in Links SQL itself?
    --
    Gossamer Threads Inc.
    Quote Reply
    Re: [Alex] Multiple database usage in same Links SQL? - Suggestion In reply to
    I don't understand. You mean plugin is not possible?

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [webmaster33] Multiple database usage in same Links SQL? - Suggestion In reply to
    Hmm, answering too many posts. Lost the bottom half of the paragraph. =)

    No, I don't think it is possible as it would mean creating a plugin hook in Links::init(), however you can't do this easily as you have not initilized all your Links SQL variables yet.

    Cheers,

    Alex
    --
    Gossamer Threads Inc.
    Quote Reply
    Re: [Alex] Multiple database usage in same Links SQL? - Suggestion In reply to
    I am not sure if this is the same request as made in this thread, but I would like to run 2 completely separate databases so that I do not have to use my live data for testing and development of plugins.

    So...
    Is there a way to setup a 2nd "development" database with one GLinks 3.0 license?
    In other words...
    Can I do a 2nd install in say a 'dev' directory using completely separate everything?

    Thanks,
    Chris
    RGB World, Inc. - Software & Web Development.
    rgbworld.com
    Quote Reply
    Re: [Alex] Multiple database usage in same Links SQL? - Suggestion In reply to
    I just want to bring this topic up again because I'm still highly interested in a multiple database solution, too.

    What I need is not having all LSQL-tables in every database.
    I want to use multiple databases to store multiple LSQL-Link tables.

    Coming to the point:

    I'm importing lots of product datafeeds of different online-shops into my LSQL-db.

    I want to have a Links-Database for each shop but all the rest in the main db.
    While building the directory all data should be merged into one single directory
    (all Links-tables should have the same structure).

    I need this in reason of speeding up the directory and reducing the size of the links-table(s).
    Actually I am limited in importing all datafeeds because of the reasons mentioned above.

    If I would import all my datafeeds, my actual links-table would have more than 10 million rows.
    So I think it's clear to everyone, that dealing with multiple db's with just 150.000 to 500.000 rows (a db for each datafeed) would be much better.

    Regards,
    Manu

    Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.

    Last edited by:

    ManuGermany: Dec 1, 2005, 12:36 AM
    Quote Reply
    Re: [ManuGermany] Multiple database usage in same Links SQL? - Suggestion In reply to
    The idea is not forgotten, just I'm pretty busy with other tasks & developments.
    Glad to say, I did my exams, got the diploma, so I have one less problem now Cool

    Unfortunately I have no idea, when will have time for the LSQL Multiple Database development.
    I will also surely need it for my website, so I will develop it when I can't live without it.

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
    Quote Reply
    Re: [ManuGermany] Multiple database usage in same Links SQL? - Suggestion In reply to
    Started a few tests about using multiple links tables within one LSQL.
    No final results yet, but I hope I will be able to create this Multiple Links Table mod.
    Please be patient, I will post news, if I will have any success with it.

    Best regards,
    Webmaster33


    Paid Support
    from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
    Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...