1. I am trying to find the sweet spot between directory access time and the number of levels.
The folders hierarchy will be automatically created on the fly.
I mean if there is only 2374 , so the last user will have folder 2/3/7/4/2374
The same about 2 digits hierarchy, if there is more that million of id's another level will be added automatically.

At that point it's not for specific filesystem, but if the system will grow up I will move it to server with the suitable filesystem.

2.Ok , for now I'm using ext3 but I will move towards something better if needed.

3.Yes , I'm building an facebook/google+ like online community project.
I have already finished one project, it's working fast but when I benchmarked it there was some limitations on fequests per second but the CPU wasn't on 100% and still few gb of free memory...
I think it because of HD I/O limitations.Because of that i want to understand how to make it super fast.

q:Will replies have their own IDs within the 6-digit ID space?
a:yes , the replies will have an uniq id

q:Will replies only be displayed subservient to their parent? Or will they be viewable individually?
a:there will be post->replies structure.
Each post will have a file for it's replies
They won't be viewable individually,but there maybe will be an option to edit or delete the reply .So if the replies for specific post will be stored in the same file , it will need to be rewritten in a case some one want to edit only 1 reply.

q:Are replies to replies possible?
a:no

1-q: already answered .
2-q: I have a good experience with flat files databases, I started to read a book about mysql optimization and at some point I was upset .
It's not that simple as it seems to be. There is many tricks that need to know and that come with experience, to much options that I don't need.
I just afraid that in some point I will get stuck with it or the performance will be poor at some point.

Thanks for the informative post

In reply to Re^2: Design flat files database by AlfaProject
in thread Design flat files database by AlfaProject

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.