user-generated data in netfortris – connect silicon valley 2017

18
John Kong NetFortris Inc.

Upload: couchbase

Post on 21-Jan-2018

77 views

Category:

Technology


1 download

TRANSCRIPT

John Kong

NetFortris Inc.

• Netfortris provides an integrated phone, chat and text messaging system

• Chat, Team/Group chat, Call, Conference, Call center.

• HUD has the “remote control” – a fairly complex web/mobile app

• Users generate huge volumes of chat and call data Chat and call data (include chat/call event) Peak during work hours

• Need to support different queries for user generated data

Per users, per conversation, per chat/call

• A user’s configuration “state” is shared with all users of that customerUser, conference, extension, device …Support all many different queries.

Controllers

Services

Dispatch Event

Daos

Message Queue

RDMS

• Bad user experience Slow response time - over 60 seconds to load page

• User generated data is too big to manipulate efficiently in a single RDBMS instance

Weekly, sometime daily production issues due to data overload Difficult (if not impossible) to partition RDMS

• Difficult to scale as user base grows Customer Support Issues for larger customers

Controllers

Services

Dispatch Event

Daos

CouchbaseMessage Queue

RDMS

• Move user generated data from RDBMs to Couchbase with Java SDK

• Get auto data partition, HA, Cache• Flexible in data definition, no need schema change when data

model change.• Create two buckets for chat and calls• Create views to query user generated data

function (doc, meta) {if(doc.doc_type =='CL'){

emit([doc.owner_user_d, doc.iver], null)}

}

• Store user generated data and as much customer/user management data in Couchbase as possible with Go SDK (Go with Couchbase gets superior performance over Java)

• Use N1QL to manipulate data in Couchbase• CREATE INDEX `index_session_id` ON

`chat_messages`(`session_id`) WHERE (`doc_type` = `CM`) USING GSI

• Select `chat_messages`.* from `chat_messages` where sesssion_id = 111

SDK/N1QL Sample

• Define N1QL query statement:• querySettings = gocb.NewN1qlQuery("select `fon_user`.*

from 'fon_user` where owner = ? and ownerType = ? and customerId = ? and clientType = ? and docType = ?")

• Run go to query:

• bucket := this.CbPool.Borrow()qParams := []interface{}{userId, "USER", customerId, clientType,

"settings"}• vResults, err := bucket.ExecuteN1qlQuery(querySettings,

qParams)

Couchbase

RDMS

Daos query/cache

Query all objects of the

same type of a customer

o Response time – from over 60 seconds to sub-1 secondo User generated data – from too big to under controlo Weekly production issues – no more!o Scaling issues – no more!o Releases resources to new projects

• Eventually consistency issueo Define the view in separate design doc to reduce indexing

duration.• Return key only by view query instead of full doc.• Use N1QL for new projects.

• Bulk operation for data structureo Insert the whole map/listo Retrieve range of elements of map or list.