Download - Csql Cache Presentation

Transcript
Page 1: Csql Cache Presentation

CSQL DATABASE CACHE

Bijaya Kumar Sahu

Database Developer

Lakshya Solutions Pvt Ltd

[email protected]

Page 2: Csql Cache Presentation

What Is Next…

CSQL Cache Functionalities

CSQL Cache Configuration

Cache Tools

Information About :

Page 3: Csql Cache Presentation

What is CSQL Cache ?

CSQL Cache is a client side caching mechanism for any disk-based database

which increase the throughput of existing applications without requiring any

application changes.

Page 4: Csql Cache Presentation

CSQL Cache Functionalities

Updateable Cache Tables

Bi-Directional Updates

Synchronous and Asynchronous update propagation

Cont…

Page 5: Csql Cache Presentation

CSQL Cache Functionalities

Partial cache Updates

Multiple cache granularity

Recovery for cached tables

Cont…

Page 6: Csql Cache Presentation

CSQL Cache Functionalities

Tools to validate the coherence of cache

Transparent access to non-cached tables

Horizontally Scalable

Transparent Fail over

Page 7: Csql Cache Presentation

CSQL Cache Configuration

CACHE_TABLE

CACHE_ID

DSN

ENABLE_BIDIRECTIONAL_CACHE

CACHE_RECEIVER_WAIT_SECS

TABLE_CONFIG_FILE

For CSQL Cache Configuration , Following flag need to be set which is present in “ csql.conf ” file.

Page 8: Csql Cache Presentation

Unidirectional Cache Configuration

CACHE_TABLE = true

CACHE_ID = 1

DSN = <Dsn name of target database>*

ENABLE_BIDIRECTIONAL_CACHE = false

CACHE_RECEIVER_WAIT_SECS = 10

TABLE_CONFIG_FILE = <path of table configure file>**

For Unidirectional Caching, Set flags as below

Cont…

Page 9: Csql Cache Presentation

Unidirectional Cache Configuration

For Unidirectional Caching, Be sure that

CSQL server and target database is running.

Isql tool for target database working properly.

Use cache tool to cache table to Cache node.

Page 10: Csql Cache Presentation

Bi-Directional Cache Configuration

For Bi-Directional Caching, Set flags as below

CACHE_TABLE = true

CACHE_ID = 1

DSN = <Dsn name of target database>*

ENABLE_BIDIRECTIONAL_CACHE = true

CACHE_RECEIVER_WAIT_SECS = 10

TABLE_CONFIG_FILE = <path of table configure file>**

Cont…* For MySql := myodbc3, For Postgres : = psql etc.

** By default path /tmp/csql/csqltable.conf

Page 11: Csql Cache Presentation

Bi-Directional Cache Configuration

Create log table in target database.

For MySql :

create table csql_log_int ( tablename char(64), pkid int, operation int , cacheid int, id int not null unique auto_increment) engine=‘innodb’ ;

For Postgres :

create table csql_log_int( tablename varchar(64), pkid int, operation int,cacheid int);

alter table csql_log_int add id serial;

Cont…

Page 12: Csql Cache Presentation

Bi-Directional Cache Configuration

For Bi-directional Caching,

Run Trigger on key field of cached table.

Configure Isql tool for target database

Be sure CSQL server and target database server are running

Use cache tool to cache table to Cache node.

Page 13: Csql Cache Presentation

Multiple Cache Node Configuration

For Multiple Cache Node Configuration Change CACHE_ID in the csql.conf file as unique id for different cache

node.

Configure as per Bi-directional Cache Node.

Be sure CSQL server in each node and target database server are running.

Use cache tool to cache table into each Cache Node .

Make appropriate changes in trigger file.

Page 14: Csql Cache Presentation

Cache Tools

CSQL Cache have following Cache tools.

cachetable

cacheverify

Cont…

Page 15: Csql Cache Presentation

Cache Tools (cachetable)

Full Caching

Partial Caching ( Record based & Field based )

Caching with Direct Updates

CSQL supports three ways of caching mode

Cont…

To cache table from target database to cache node.

Page 16: Csql Cache Presentation

Cache Tools (cachetable)

Usage

cachetable [-U username] [-P password] -t tablename [-D]

-c "condition" -f "selected field names" -p fieldname [-R]

[-s] [-r]

username -> username to connect with csql.

password -> password for the above username to connect with csql.

tablename -> table name to be cached in csql from target db.

Cont…

Page 17: Csql Cache Presentation

Cache Tools (cachetable)

fieldname -> field name to be specified for the bidirectional caching

on which trigger to be run .

R -> Recover all cached tables from the target database.

s -> Load only the records from target db. Assumes table is

already created in csql

r -> Reload the table. get the latest image of table from target db

Cont…

Page 18: Csql Cache Presentation

Cache Tools (cachetable)

u -> Unload the table. if used with -s option, removes only

records and preserves the schema

D -> Enable direct option. For any non select SQL statement

directly interact with target database.

no option -> Get table definition and records from target db and

create in csql.

Page 19: Csql Cache Presentation

Cache Tools (cacheverify)

Usage

cacheverify [-U username] [-P password] -t tablename [-p] [-f]

username -> username to connect with csql.

password -> password for the above username to connect with csql.

Display the consistency in the specified cached table in between cache node and target database.

Cont…

Page 20: Csql Cache Presentation

Cache Tools (cacheverify)

tablename -> cached table name in csql from target db.

p -> verification at primary key field level

f -> verification at record level

?-> help

Page 21: Csql Cache Presentation

For More Information

Visit… http://sourceforge.net/projects/csql/

http://www.csqlcache.com/

http://www.csqldb.com/