php - Which database to use and how to speed up -



php - Which database to use and how to speed up -

i've project store , process expenses of user. there 2 operations on database: insert , select. database may contain millions of entries per day (depending on no. of users or if user company etc.).

common queries:

show expenses date x date y. (mostly) applying filters on query (1). show expenses on particular item till date. (queries throughout table) show expenses till date. (rarely)

1: i'm confused in database utilize this: sql or nosql or sql , nosql combinely (how in case?). need comparing based on speed while querying big amount of data.

2: since per day may contain millions of records, millions of rows resulted query need transferred server client. (in case there 1 more overhead. database server remote web server. result need transferred database server web server , client.) how create faster?

4: if take mysql, better: a: dumping whole info in 1 big sql table. b: creating table each day (with date table name) contain smaller amounts of data. (i thought (b) faster while giving date range since know table select instead of looking in big table , querying specific date.)

3: i'm trying mysql. (the test info there. using python script parse info , dump in mysql. can edit script , create work type of database.) tried query (4) mentioned above. result database server, web-server/client (since i'm testing, web server client now.) kind of hanged while around 13 1000000 of rows result of query beingness transferred database server. used loop in php code limit query 1000 rows @ time sample below:

(loop until getting info database){ i=0; select * <table> limit i, 1000; i+=1000; }

it's still slow, scheme not hanging during transfer. limit here work like, 1st 1000 records (while i=0), 2nd 1000 records (while i=1000) , on. or it'll 1st 1000 records (while i=0), start 0 1 time again skip 1st 1000 records , 2nd 1000 records (while i=1000)and on much slower obviously. (i searched online know mechanism of limit everywhere saying limit order not how page wise info limit , impact on performance it.)

p.s. i'm not database pro. beginner. asking experts' suggestions before starting project.

if have millions entries per day think should go nosql database. more faster , efficient @ handling big data. suggest elasticsearch you perform insert , select functions on huge amount of data. has documentation , easy plenty use. think serve well.

php mysql database performance database-design

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -