Every once in a while there will be an article about the database performance description of the hype, often appear 50W qps,100w QPS such large numbers, minus thousands of words to explain, the core content is a top-level configuration of the server and for the test-specific configuration, Most of the systems are not going to buy a server that does not know where to sell, most developers will not toss out which heap configuration, and change the default configuration often introduces new issues. What kind of database testing is the most real, reflecting the actual operating capacity of the system? [Email protected] Demo platform can be used as a reference, here write two code, test concurrent 10 connections, each connection read 10,000 data on iboxdb and MySQL need time, the less time, the better performance.
Look at the MySQL test code first
Public Integer Call () throws Exception { ResultSet rs = c.createstatement () executeQuery ("Select ' id ', ' value ', ' Msg ' from test '); int l = 0; while (Rs.next ()) { if (rs.getstring (3). StartsWith ( integer.tostring (Rs.getint (1))) { L + = rs.getint (2) ; } } return l;}
The content of this code is read from the test table id,value,msg, the first to the MSG content of the legitimate detection, the content conforms to the Vlaue added to the check code L. The content of MSG is created as "id.tostring () + text".
Look at Iboxdb's test code, because it's NoSQL, the code is easier to read.
Public Long Call () throws Exception { long l = 0; For (map<string, object> map:c.select ("from Test")) { if (Map.get ("msg"). ToString (). StartsWith ( Map.get ("id"). toString ())) { L + = (Long) map.get ("value");} } return l;}
After launching the [email protected] Demo platform, after several clicks of the test, MySQL is above 100ms, while Iboxdb is mostly near 50ms, the less time it takes, the better the performance.
The performance test on the demo platform can reflect the actual operation effect of the system, which 100W QPS test results are impossible to achieve in the current system of 99%.
[email protected] test code address, online demo address
Iboxdb NoSQL Database
Iboxdb NoSQL and MySQL performance test on the GIT demo platform