Florian Müller
Florian Müller

Reputation: 7795

PHP: Performance PLIST/XML vs. MySQL?

I wantet to ask about the performance of MySQL vs. PLIST (apple XML standard).

I'm realising a localization class for my website. Now, I have two possible variants:

-a file localization.plist, where some labels and texts of the website gets saved, as follows:

<dict>
    <key>testmessage</key>
    <dict>
        <key>en</key>
        <string>Test-message-string</string>
        <key>de</key>
        <string>Test-Nachricht</string>
        <key>fr</key>
        <string>C'est une teste</string>
    </dict>
</dict>

Then, there is the alternative with using MySQL and selecting labels from a database, as follows:

SELECT LABEL FROM LABELS WHERE ID = $id AND LANGUAGE_CODE = 'en';

Now, which one would be better with its performance? MySQL has a connection to establish, which may be a bit a long time, and plist is quite more complex...

Thanks for your inputs :)

Regs, flo

Upvotes: 0

Views: 182

Answers (1)

prodigitalson
prodigitalson

Reputation: 60413

Well i wouldnt use either.. if you want to use something with human readable XML based storage then use XLIFF or TMX. If it doesnt need to be human readable then use gettext.

Also typically you have a file for every language and your key is the phrase in the source language, and your value is the translate phrase to the language of the file in question.

Upvotes: 2

Related Questions