B
B
BitRouter2017-01-25 23:17:33
PHP
BitRouter, 2017-01-25 23:17:33

What is the method/format for storing data when used infrequently?

Good day!

/*----------
немного вводной части:
--- web приложение, ООП, MVC, шаблонизатор Smarty
--- БД - MySQL
--- Apache 2.4
--- PHP 7.0
----------*/

Please help me solve a difficult situation...
There are a number of arrays:
$continents = [];
$country = [];
$currency = [];
$lang = [];
$iso = [];
...

In total, the amount of data is relatively small (1,500-2,000 lines)
So! These data will not be requested every day .. Yes, and they will not be edited ... (perhaps 1-2 times a year).
With all this, in response from requests to the Database of the above arrays, not all data arrives to the user, but during standard work 1 record, with a curious array with a volume of up to 20 values ​​..
Even with such a rare need to use data, a lot depends on them ...
Options that I considered:
- PHP (now implemented by storing and processing arrays in a separate class)
----! everything works, fast, but somehow not beautiful ... Why? All data is sorted (the main volumes, of course, in MySQL)
-JSON - considered, but 1. All the same, for a long time .. 2. Well, the difference is if PHP stores in the same way and does not bay)))
- MySQL - this option sympathizes with the aesthetics of the application)) but nothing more
- put it in config files Smarty (nothing like that here, only Smarty stores arrays in the config via crutches,
----! so I look at it from this side: why pull something that is not adapted to this ...
- cURL - I thought it was a sinful thing to throw it on a separate server, such data and let it lie around like that ... in any form and are processed, including And the user in the application will have exactly the same end result ...

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
ThunderCat, 2017-01-26
@BitRouter

Chet I did not understand -

now implemented precisely by storing and processing arrays
- store data in php? In files? or ... It's not clear in short.
In any case, I see a database (muscle, as the most common, for example) with separate tables for your arrays, PHP is not bad for this as a backend, if you need something to work mega-fast - cache in radish. This is a fairly standard bunch, I see no reason to invent something new.

E
Eugene Volf, 2017-01-25
@Wolfnsex

SQLite3 is the perfect choice for you, in my opinion. Or rather, almost any language, incl. PHP + SQLite3. It is supported in PHP, Python, and for sure, in almost everything else.

T
tvelforce, 2017-01-26
@tvelforce

And if you store data in an xml file?

D
Draconian, 2017-01-26
@Draconian

If your application already works with MySql, why not create such directories there? It will be easier to make changes, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question