Jump to content

etrader

Members
  • Posts

    315
  • Joined

  • Last visited

    Never

Posts posted by etrader

  1. No, I'm not on a shared server; but since this system uses very low amount of resources, I host many domains on the same server. I am thinking of shifting from ex3 to ex4; but I prefer to do so on a fresh server (maybe later).

     

    SQLite seems to be an excellent choice, but I was unable to find some statistics comparing its speed with other systems. I just worry about RAM usage for concurrent visitors as SQLite does not have server (of course, my knowledge is very little about this).

  2. I have a very simple system (few files) having simple articles (only title and a paragraph description) stored in single text files. I catch the data by

     

    $data=file('article1.txt');
    $title=$data[0];
    $description=$data[1];

     

    This simple system works perfectly, but the problem appears when increasing the number of files (e.g. more than 10,000 articles). This is a problem connected with the OS behavior for handling huge number of files. My first question: Is there theoretically a faster system (e.g. database-based) for retrieving data, comparing with retrieving from plain text file?

     

    Second question: what can be an alternative for this very simple system (no search query or additional field)?

     

    1. XML: It has the same problem if storing in different files.

    2. Mysql: It is very advanced for this system.

    3. SQLite:I am thinking of this, but it still have advanced structure of SQL.

    4. DB Berkeley: I am not familiar with Oracle at all, and I need to install something new on my server. Is it really worth of trying?

    5. Anything else?

     

    In general, I just need fast reading the data. I have no idea how much the speed of these systems are different to determine which is worth of consideration. Thanks for sharing your idea.

  3. It should be something like agent and getting information about visitors. When my script is accessed through an iframe (here facebook) there should be a difference with the case that the page is directly accessed. I think in the iframe case, facebook is accessing my page, and I should be able to detect facebook as a something like agent.

  4. Yes, I use append method to add new data as a new line.

     

    The problem is that when I read the file to get the last line, php walks across the entire file. Since this repeats regularly, it is necessary to avoid heavy task.

     

    I already use memcache (on nginx). Another way is to use mysql database. But the problem is that we regularly read and write data. Indexing mysql is good for the first one and bad for the latter.

  5. I want to save live data into file. My script fetch the data (one by one) and save it into file by amend method. The live data is not regular and every time it must be checked if the value has been updated or it is still the last value. One way to do so is to read the last line of the file and compare it with the fetched value. But in this case, I need to read the file for every check.

     

    Is there a way to remember the last value and compare it with the coming value? to write only new value into the file.

  6. Where is the best to store the list of categories and menu? Obviously it is better to reduce mysql queries. From a plain list in file, we can create desirable list (menu) from an array. This is quite faster (though SELECT from an indexed table is fast too; but I do know if it is as fast as reading from a php file). Any idea how to code this to create the menu faster ?

  7. Thanks PaulRyan,

     

    I want to include everything that is really needed. If I include 10 files (instead of one), this is because of the fact that another page may onlye need file2 and file7 to be included. This is the reason that I asked this question.

  8. We regularly use 'include file' to include general codes. But does it really identical to writing the code in the current php file? I mean does it take time to read an external file (comparing to the case that the code are simple writing in the processing file?). I am asking this question to know if there is a time difference between a single php file or include 20 external files (the same php code, just put on other files)?

  9. To me it is logical to store config data such as site name, meta, etc in a php file rather than storing ina  table in mysql database. This will reduce the number of calls to the mysql database, as these are key parameters and needed in every page.

     

    But, a well-developed CMS like Wordpress uses a mysql table to store such basic data. What is your idea? Ain't it better to reduce mysql loads?

  10. I have a tag column in the table of posts. I store tags as "tag1,tag2,tag3,...". When displaying tags in the post, I explode to have an array. Everything is OK, but I cannot create a tags cloud; as I need to have the occurrence of each tag to increase the font. What is a practical trick to create tag clouds?

     

    I think the common method is to build a table for post tags and store each single tag in a separate cell. But I hope to keep my database tidy.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.