Abstract:The center of urban rail network needs to collect the data of all the urban rail lines and the size of table records will reach billions. The data query on urban rail network will need too much time and the system efficient is very low. We propose the program to optimize the system architecture by database cluster and middleware, which improves query efficiency because of more powerful storage and parallel processing capacity than that of a single database. An sharding method that divide the data horizontally by lines to avoid the expensive table joins crossing databases and the new rail line can be easily extended just by adding more database nodes. Serveral technologies, such as table partitioning, index, materialized view and SQL etc. are used also to optimize the reaction time when standalone inquiring. A special light-weight database access middleware used in the system architecture is designed to solved some key problems such as SQL parsing, route inquiring and result data merging etc.. The experiments are carrieded out on data from Guangzhou Metro as verifying the scheme of this paper. The results show that the reaction time of all types of queries is reduced 90% at least.