Presentation is loading. Please wait.

Presentation is loading. Please wait.

Designing a Middleware Server for Abstract Database Connection.

Similar presentations


Presentation on theme: "Designing a Middleware Server for Abstract Database Connection."— Presentation transcript:

1 Designing a Middleware Server for Abstract Database Connection

2 Key Concepts  Abstraction of the database connection layer.  Encryption of client – server communication.  Compression of data sent from server to client.  Hiding the underlying implementation from the client by providing an easy to use interface.  Remote controlling the server. Modifying Server parameters without the need to stop it. Modifying Server parameters without the need to stop it.

3 Design Stages  Designing the Server Side.  Designing the Client Side.  Developing a common communication protocol.

4 Designing the Server Side  Designing easily replaceable modules and increasing reusability.  Providing flexible server configuration.  Finding the Right Adapter to serve the client.  Providing telnet based remote control.  Using a profiler to increase efficiency.

5 Main Server Modules  The Server Adapter  The Server Worker Thread  The Adapters Manager  The Connection Pool  Encryption Streams

6 Server Modules Functionality  The Server TCP Adapter - Provide an open server socket for connecting clients - Provide 2-way decryption / encryption of client- server connection - Spawn a Server Thread for every accepted connection  The Server Worker Thread - Check if loop conditions are encountered - Find the Right Adapter to serve the specific Client - Interrogate the found Adapter with Client’s queries - Compress and send query results back to client

7  TCP Adapter - Is used by a DBAbstract Server to connect to another server of the same kind in order to solve client’s request. - Can use different Encryption keys/algorithms for incoming/outgoing connection streams - Provides a permanent connection through which queries can be issued and results can be obtained  DB Adapter - Resolves a client request to a specific database - Loads a specific driver for the permanent database connection - Provides a pooled connection to the client - Solving client’s SQL queries from the database  Adapter Manager - Holds all available adapter types for a server.

8 Server Modules Design Server Thread Adapter Manager Server TCP Adapter Encryption/Decryption Stream Ask For Right Adapter Spawn a Thread Encrypt/Decrypt Connection Streams

9 Connection Pool Modules  Connection Manager Broker -Provides means to obtain a connection from the pool. -Has a worker thread which keeps pooled connections alive and closes unused connections to minimum from time to time.  Connection Manager -Manages a list of all available pools. -Provides a way to globally address all connection pools.  Connection Pool -Manages a list of pooled connections.  Pooled Connection -A reusable connection to the database

10 Designing a Connection Pool Connection Manager Broker Connection Pool Pool Cleaner Thread Connection Manager Connection Pool Pooled Connection Vendor Specific Database Clean and refresh all pools Returns connectio n Reusable Database Connection Manages all pools

11 Encryption  Stream Encryption Key -An interface providing a key and functions designed for fast encryption / decryption of a byte stream.  Decrypted Input Stream -A filter input stream designed to provide decryption to an underlying byte input stream  Encrypted Output Stream -A filter output stream designed to provide encryption to an underlying byte output stream

12 Database DB Server DB Adapter Server Thread TCP Adapter Encryption/Decryption Stream To other Server To TCP Client Can be more than one type Loads appropriate db driver, finds available pool connection Adapter Manager TCP Properties TCP Connection Properties Finds right adapter DB Properties

13 Designing the Client Side  Using a Client Adapter to provide access to the DBAbstract Server.  Providing means to generate an encryption key for the connection automatically.  Using wrapper classes to hide the underlying connection from the client by implementing the java jdbc interfaces.  Providing deployment for the Client jar Driver.

14 Connect to Server Encryption/Decryption Stream TCPD Adapter JDBC Wrapper classes Can be used by Clients

15 Distributed Architecture Criteria  Allowing server to server connections to find the needed database.  Allowing load balancing by providing a connection limit to one server and redirecting clients when limit exceeded.  Allowing redirection from client to server closest to data source.

16 Client – Database Indirect Connection DBAbstract Server 1 DBAbstract Server 2 DBAbstract Server n Database Server Client

17 Client – Database Redirection DBAbstract Server 1 DBAbstract Server 2 DBAbstract Server n Database Server Client

18 THE END (finally)


Download ppt "Designing a Middleware Server for Abstract Database Connection."

Similar presentations


Ads by Google