scenario
say have website or app has tons of traffic. , database connection pool, performance taking real hit (the site/app may crashing) because there many concurrent connections.
question
what someone's options dealing problem?
my thoughts
i thinking problem create multiple databases (possibly on different machines although i'm not sure that's necessary), each same information , updated @ same time, grant multiple of original number of connections single database. if database large doesn't seem viable solution.
the stem not specific enough give firm suggestion, complete list of done follow:
- database cluster: suitable situations don't want change application layer , database touch. there's limit on how can out of database cluster. if request volume keeps on growing, solution fail eventually. news you've got functionality you've had in ordinary single-instance mysql.
- sharding: since question tagged mysql, , not support sharding on own, if want use solution need implement in application layer. in solution you'll scatter data on multiple databases (preferably in multiple mysql instances on separate hardware) logically. responsibility find appropriate database holding designated data. it's 1 of effective solutions ever it's not feasible. biggest flaw data scattered among 2 or more databases can not included within transaction.
- replication: depending on scenario might able incorporate database replication , have copies of data on them. way can connect them instead of master database , reduce load on it. default replication definition master/slave scenario in data flow 1 way, master slave. changes might make on slave while applied on salve, won't affecting master. there master/master replication configuration in data flow in both ways. yet can not assume atomic integrity concurrent data changes among both masters. in end solution effective if plan use in master/slave mode , using slaves read-only access.
- caching: perhaps solution should not included here since stem not reject it, here goes. 1 of ways reduce database load cache data once extracted. solution can beneficial specially if extracting data expensive. there many cache servers out there, memcached or redis. way can omit many of database connections extraction of data.
- other storage engines: can switch more performant engines if current 1 not provide need. of course feasible if needs allow to. nowadays there nosql engines, more performant rdbms, support sharding natively , can scale them linearly minimum effort. there lucene based solutions out there powerful full-text search capabilities providing same automatic sharding. in fact reason why should using traditional rdbms atomic behavior of transactions. if transactions not must, there better solutions rdbms.
Comments
Post a Comment