CodeFutures offers an effective sharding solution with our product, dbShards. Our customers have used dbShards to achieve unprecedented performance, in the scope of hundreds of millions of reads and millions of writes every day.
The Java DAO Design Pattern
The Java Data Access Object (Java DAO) is an important component in business applications. Business applications almost always need access to data from relational or object databases and the Java platform offers many techniques for accessingthis data. The oldest and most mature technique is to use the Java Database Connectivity (JDBC)API, which provides the capability to execute SQL queries against a databaseand then fetch the results, one column at a time. Although this API provideseverything a developer needs to access data and to persist application state,it is a cumbersome API to develop against - which makes a Java DAO code generator particularly useful.
Java 2 Enterprise Edition (J2EE) offers a newer persistence framework in theform of Entity Beans, a subset of the Enterprise JavaBean (EJB) framework. Although there have been many improvements in the more recent EJB 2.0 specification, many developers are nowlooking to alternative persistence frameworks for their Data Access Objects, such as Java Persistence API (JPA) and Hibernate.
The Benefits of Java DAO
The Data Access Object design pattern provides a technique for separating object persistence and data access logic from any particular persistencemechanism or API. There are clear benefits to this approach from anarchitectural perspective. The Java DAO approach provides flexibility to change anapplication's persistence mechanism over time without the need to re-engineerapplication logic that interacts with the Data Access Object tier. For example, there may beperformance benefits in changing an application's performance mechanism fromusing Entity Beans to using direct JDBC calls from a session bean, or even amove to an alternative persistence framework, such as Hibernate. Without a Java DAO tierin place, this sort of transition would require extensive re-engineering ofexisting code.
The Data Access Object design pattern also provides a simple, consistent API for data accessthat does not require knowledge of JDBC, EJB, Hibernate, or Spring interfaces. A typical Java DAOinterface is shown below.
public interface CustomerDAO
public void insert(Customer customer)
public void update(CustomerPK pk, Customer customer)
public void delete(CustomerPK pk)
public Customer findAll()
public Customer findByPrimaryKey(String email)
public Customer findByCompany(int companyId)
It is important to note that Java DAO does not just apply to simple mappings of one object to one relational table, but also allows complex queries to be performed and allows for stored procedures and database views to be mappedinto Java data structures.
Minimizing the Impact of Moving to Data Access Objects
CodeFutures' objective is to minimize the importance of the main argumentagainst using Data Access Objects: the fact that it requires a significant amount ofrepetitive source code to be produced for no immediate advantage over usingJDBC or EJB directly. For many developers, this disadvantage is goodenough reason to ignore the long-term benefits of using a framework-neutralAPI, especially where there are strict project deadlines. Without the codegeneration advantages of FireStorm/DAO, it is not easy to justify to a projectmanager or project sponsor the time and cost of manually writing DAO code,regardless of any future benefits they may see.
Data Access Object Code Generation
CodeFutures' solution to the manual coding problem is to automate theproduction of a Data Access Object tier, as well as automating the actual implementation logicfor whichever persistence framework is deemed appropriate for an application.This approach is easy to adopt because almost all databases use a standardlanguage for defining their structure (SQL).
CodeFutures provides a free program to analyze the performance of your MySQL database.
Read about how Database Sharding helps many major companies to linearly scale their database applications.
dbShards economically scales large, high transaction volume databases using Database Sharding.