High-Performance MySQL front-end Vtocc bitsCN.com
Vtocc is the first available product of vitess. as the front-end of MySQL, it provides an RPC Interface to receive and convert SQL statements. It provides efficient multi-channel large-scale database operation requests with concurrent processing capability of over 10 k. At the same time, an SQL parser is provided to allow the server to understand and intelligently optimize queries.
Vtocc has been used in a large-scale product environment and is the core of YouTube's new MySQL service architecture.
Sample code:
From vtdb import vt_occ2 as db
Conn = db. connect ('localhost: 6510 ', timeout = 5, dbname = 'mydb ')
Curs = conn. cursor ()
Curs.exe cute ('select * from mytable limit 5 ',{})
Print curs. description
For v in curs:
Print v
Print curs. rowcount
Main functions:
- A Python DBAPI 2.0 compatible client interface (vt_occ2.py)
- Understand various HTTP and TCP-based protocols
- Query variables and query cache are supported to avoid repeated SQL parsing and reuse of query plans.
- Connection pool
- Transaction Management, which can limit the number of concurrent transactions and manage transaction failures
- DML annotation: each DML is overwritten and contains a comment field at the end to identify the modified row record.
- Built-in fault insurance
- Query merge: The ability to reuse the results of an in-flight query to any subsequent requests that were committed ed while the query was still executing.
- Limit the number of query results. if the number exceeds the limit, an error is returned.
- You can delete some ultra-long transactions.
- You can delete some queries that are too long.
- Automatically clear idle connections
Vtocc module:
Method for getting Source code:Hg clone httphotoshop/target = _ blank class = infotextkey> ps: // code.google.com/p/vitess/
BitsCN.com