AhnSeongHyun / exs4j

open api search engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

  1. get data from open api
  2. save StoringCache.
  3. RUN StoreCmdProc by main thread.
  4. get data from StoringCahe
  5. save db and save CS index.