Storing Data
AhnSeongHyun opened this issue · comments
use mysql? sqlite3?
use NOSQL?
if use sql database, must use mybatis.
Use DB and use mybatis.
two tables
- tb_request : store request info
- tb_search_result : store response info according to request info
CREATE TABLE tb_request
(
requestCode
INT(10) NOT NULL AUTO_INCREMENT,
masterKeyword
VARCHAR(50) NOT NULL,
from
VARCHAR(10) NOT NULL,
reqDate
DATETIME NOT NULL,
PRIMARY KEY (requestCode
)
CREATE TABLE tb_request
(
requestCode
INT(10) NOT NULL AUTO_INCREMENT,
masterKeyword
VARCHAR(50) NOT NULL,
from
VARCHAR(10) NOT NULL,
reqDate
DATETIME NOT NULL,
PRIMARY KEY (requestCode
)
use mybatis,
mybatisConfig.xml : do not modify
mapper.xml : do not modify
db.propertise.xml : do not modify
db.properties
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/exs4j
username=root
password=root
real time storing? bgsave(redis) bulk storing using background process?
seim-realtime processing.
Storing process.
- get data from open api
- save StoringCache.
- RUN StoreCmdProc by main thread.
- get data from StoringCahe
- save db and save CS index.