[Flask] SQLAlchemy - One Class - Several Tables

John Robson John.Robson at usp.br
Fri Jul 22 11:27:08 EDT 2016


Thank you for your excellent suggestion. This DB is for study purposes 
and PostgreSQL has some No-SQL features.

I wonder if this what is the best approach for this "dynamic" tables:

https://gist.github.com/munro/3686e3b060c2cd7959350ea8bf77ff2c

or

http://docs.sqlalchemy.org/en/latest/orm/inheritance.html#single-table-inheritance

or another thing...

On 07/22/2016 05:05 AM, Ioannis Pinakoulakis wrote:
>
> If you plan for huge load why don't you consider some nosql database?
>
> Here you can find most of them.
>
> http://nosql-database.org/
>
> 22 juli 2016, 10:26, ο/η John Robson
> <John.Robson at usp.br
> <mailto:John.Robson at usp.br>> έγραψε:
>
>> Is not "early optimization", I'm more comfortable with multiple
>> tables, furthermore, I have plans to expand to thousands of stocks and
>> high-frequency operations with more than 10K events per second (for
>> some stocks). Maybe store/read hundreds of thousands of rows per second.
>>
>> But my question is just, what's is the best approach to do CRUD with
>> multiple (dynamic) tables. (one class to map multiple tables)
>>
>> Thank you for helping.
>> John
>>
>> On 07/22/2016 01:57 AM, Andrea D'Amore wrote:
>>> On 22 July 2016 at 02:14, John Robson <John.Robson at usp.br
>>> <mailto:John.Robson at usp.br>> wrote:
>>>> I want to store the minute price of all 500 stocks from S&P 500.
>>>>  This means
>>>> more than 500 million of rows + almost 200K updates per day +
>>>> (sometimes)
>>>> past values must be updated (to adjust ex-dividend, splits).
>>>
>>>> Instead of creating a BIG table, I would like to create 500 tables
>>>> (one for
>>>> each stock). They have the same structure/columns (open, high, low,
>>>> close,
>>>> volume).
>>>
>>> Why? Did you hit some limit or performance issue already or is it a
>>> case of early optimization?
>>>
>>> Even sqlite3 should be able to handle that.
>>>
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org <mailto:Flask at python.org>
>> https://mail.python.org/mailman/listinfo/flask
>
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>



More information about the Flask mailing list