开发者

Looking for generic library for SQL script execution (a.k.a. RDBMS benchmarking library)

I wonder if there's a library that abstracts the following DBMS operations:

  1. Load data (a bunch of CSV files or SQL insert statements)
  2. Execute a bunch of queries
  3. Get measurements for the above (throughput, latency, etc)
  4. Report generation (graphs, etc.) based on the above.

I have a bunch of DDL/DML files for different databases (for example TPC-H, SSB, etc) and I want to be able to load the data and run queries to many DBMSs without having to worry about the particularities of the specific DBMS (MySQL,SQLServer,Oracle, etc).

The closes thing I've found so far are these. The problem with them is that they’re specific for a given workload (TPC in most of the cases) in the sense that the domain specific objects are modeled as classes (Java or C++). What开发者_如何学JAVA I'm looking for is domain-independent and DBMS-agnostic.


This could be done with the combination of DbUnit and JMeter.

DbUnit is DBMS independent (as far as possible) and can be used to load CSV files into the database.

JMeter can run SQL Statements against any DBMS that has a JDBC driver and can be used to measure the performance of each statement.


I think here it would be best to use an ORM. Something like Ruby's ActiveRecord, Perl's Class:DBI or DBIx::Class or even java's Hibernate .

Ruby's ActiveRecord already offers builtin support for working with MySQL, PostgreSQL, SQLite, Oracle, SQLServer, and DB2, while hibernate seems to work with much more DBs (Hibernate Supported Databases )

Working with an ORM, you have a unified way of working with the DBs. Of course, the queries will have to be written in ORMs language (Ruby, Perl, Python, Java, etc) and not in SQL. But in this way, you also obtain the certainty that equivalent operations are executed in all DB engines and you only have to maintain one file of 'DDL/DML' instructions, for all DBs.

Hope this helps


OLTPBench fits the bill for all stated requirements:

Benchmarking is incredibly useful, yet endlessly painful. This benchmark suite is the result of a group of Phd/post-docs/professors getting together and combining their workloads/frameworks/experiences/efforts. We hope this will save other people's time, and will provide an extensible platform, that can be grown in an open-source fashion.

OLTPBenchmark is a multi-threaded load generator. The framework is designed to be able to produce variable rate, variable mixture load against any JDBC-enabled relational database. The framework also provides data collection features, e.g., per-transaction-type latency and throughput logs.

Together with the framework we provide the following OLTP/Web benchmarks:

  • TPC-C
  • Wikipedia
  • Synthetic Resource Stresser
  • Twitter
  • Epinions.com
  • TATP
  • AuctionMark
  • SEATS
  • YCSB
  • JPAB (Hibernate)
  • CH-benCHmark
  • Voter (Japanese "American Idol")
  • SIBench (Snapshot Isolation)
  • SmallBank
  • LinkBench
  • CH-benCHmark

This framework is design to allow easy extension, we provide stub code that a contributor can use to include a new benchmark, leveraging all the system features (logging, controlled speed, controlled mixture, etc.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜