Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
OracleTimesTenIn-MemoryDatabase18.1ScaleoutFunctionality,ArchitectureandPerformance
ChrisJenkinsSeniorDirector,In-MemoryTechnologyTimesTenProductManagement
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
BestIn-MemoryDatabases:ForBothOLTPandAnalytics
Application Application Application
Application Application Application
OracleTimesTen In-MemoryDatabase• Lightweight,highly-availableIMDB• Primaryusecase:ExtremeOLTP• Microsecond responsetime• MillionsofTPSoncommodityhardware
OracleDatabaseIn-MemoryOption• Dual-FormatIn-MemoryDatabase• Primaryusecase:RealTimeAnalytics• BillionsofRows/Sec scanrate• Fastermixed-workloadenterpriseOLTP
Ø Fewerindexesneededtosupportanalytics
In-MemoryforOLTP
In-MemoryforAnalytics
3
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
20+YearsofExtremePerformanceandReliabilityOracleTimesTen– ClassLeadingIn-MemoryDatabase
4
• FirstcommercialIn-MemoryRDBMS
• ReplicationforHA• OnlineUpgrades• Application-tier
CacheforOracleDatabase
• Parallellogmanager• PL/SQLandOCISupport• OracleClusterwareIntegrationforreplicationmanagement• CacheGridforScaleOut• ODP.NETSupport• BLOB,CLOB,NCLOBdatatypes
• ParallelReplication• In-MemoryAnalytics• ColumnarCompression• IndexAdvisor• OracleRSupport• In-MemoryStarJoin• OracleGoldenGateIntegration
• ParalleldataimportfromOracleDatabase
• Paralleldatabaserestart
• Highlyconcurrentrangeindexes
• ParallelReplicationwithcommitorderoptimization
• OracleRACintegration• NationalLanguage
Support• OracleDataTypes
support• SQLDeveloper
Integration• EnterpriseManager
integration
TimesTen 6TimesTen 7
Pre-Oracle acquisition TimesTen 11g11.2.1
TimesTen 11g11.2.2
TimesTen 11.2.2.xEnhancements
1996|
2005
TimesTen 18.1
with Scaleout
• DistributedFault-TolerantIn-MemoryDatabase
• Allactivedatacopies• TransparentdistributedSQLexecution
• ACIDTransactions• GlobalSecondaryIndexes
• Andmore…
2006|
2008
2009|
2011
2012|
2013
2014|
20172018
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
MostWidelyUsedCommercialRelationalIMDBDeployedbythousandsofcompanies
5
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
MultipleDeploymentOptionsOracleTimesTenIn-MemoryDatabaseTimesTenClassic
1. Standalone/ReplicatedRelationalIMDB• Lowlatency/highthroughputapplications• ISV/OEMembeddedsolutions
2. CacheforOracleDatabase• AccelerateOracleDatabaseOLTPapplications• HAoptionviaTimesTenReplication
Microsecondresponsetime,millionsofTPSthroughput
TimesTenScaleout– newin18.1
3. Distributed,SharedNothing,RelationalIMDB• Highthroughoutandstoragecapacity• Transparentdatadistribution• Elasticscalability• Faulttolerant
HundredsofmillionsofTPSthroughput
Application
Application
Application
Application
6
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.| 7
TimesTenScaleoutBenefitsFast&Scalable
…
• Lowlatencyandhighthroughput
• Addelementsonlinetoincreasethroughputandcapacity
FaultTolerant
• Nosinglepointoffailure• Fullypersistent• K-SafetyforHA• Allelementsactiveforreadsandwrites
…
SingleDBimage
• Appearsasasingledatabasetoapplications
• Datalocationtransparency• Connecttoanyelementandaccessalldata
• Noneedtode-normalize
Customers OrdersProducts LineItems
• HighlycompatiblewithOracledatatypes,SQL&PLSQL
• ManylanguagesandAPIs• Monitoringandmanagementfromasinglelocation
• DeployonpremisesorintheCloud
Easytodevelopfor,Easytodeploy
RESTAPIs
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
TimesTenScaleout- DatabaseElements
• Eachdatabaseconsistsofelements• Eachelement storesaportionofdatafromitsdatabase• Eachelement hasitsownsetofcheckpointfilesandtransactionlogfilesforpersistence&recovery• Theelement isthesmallestunitfordatabasepersistence,failurerecoveryandhighavailability
Element<n>
TxLogsCheckpoints
DatabaseElement
8
UnitofPersistenceandRecovery
SingleImageIn-MemoryDatabase
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• Eachelementcontains:– Informationaboutallusers inthedatabase– Theschema oftheentiredatabase– Somerowsofeachtable inthedatabase
9
Element1
CUSTOMER
ORDERS
PRODUCTS
Element2
CUSTOMER
ORDERS
PRODUCTS
TimesTenScaleout- DatabaseElementsA“logical”look
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• DISTRIBUTE largetablesbyconsistenthashØDistributeCUSTOMERrowsonallelementsbyhashofCustomerID
• COLOCATE childtablerowswithparenttablerowtoincreaselocalityofreferenceØPlaceORDERSrowsinsameelementalongwithcorrespondingCUSTOMERrow
• DUPLICATE smallread-mostlytablesonallelementsformaximumlocalityØDuplicatethePRODUCTlistonallelements
10
TimesTenScaleout- DataDistribution
Servers
Element1 ElementN…
CUSTOMER
ORDERS
PRODUCTS
CUSTOMER
ORDERS
PRODUCTS
Distribute
Duplicate
Co-locate Co-locate
Specifiedatthetablelevel
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• Consistenthashalgorithm• Byhashingthedistributionkeycolumn(s)orprimarykeycolumn(s)
• Rowsare“randomly”andevenlydistributedacrosselements
• Thedefaultdistributionmethod• Thereare‘K’copiesofeachrowforHA,where‘K’istheK-safetyfactor
• Appropriateformosttables
CREATE TABLE CUSTOMER (ID NUMBER NOT NULL PRIMARY KEY,NAME VARCHAR2(100)…
) DISTRIBUTE BY HASH;
11
DistributebyHash
Element1 ElementN…
CUSTOMER CUSTOMER
Distributebyhash
1,10,2244,60
2,11,2448,55
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• “Child”rowsarelocatedinthesameelementsas“parent”rows
• Foreignkeysdefine“parents”and“children”
• Appropriatefortablesthat:• Arelogically“children”ofasingle“parent”table
• Parentandchildwilloftenbereferencedtogetherinqueries
• Locatingrelateddatatogetherprovidesbestperformanceprovidedaccessismainlyviathe‘reference’FK
• Multiplelevelssupported
12
DistributebyReferenceCREATE TABLE CUSTOMER (
ID NUMBER NOT NULLPRIMARY KEY,
NAME VARCHAR2(100)...
) DISTRIBUTE BY HASH;
CREATE TABLE ORDERS (ID NUMBER NOT NULL
PRIMARY KEY,CUST_ID NUMBER NOT NULL,...CONSTRAINT FK_CUSTFOREIGN KEY (CUST_ID) REFERENCES CUSTOMER(ID),...
) DISTRIBUTE BY REFERENCE(FK_CUST);
ElementN…
CUSTOMER
ORDERS
Distribute
Co-locate
Element1
CUSTOMER
ORDERSCo-locate
1,10,2244,60 2,11,2448,55
ORDERSforcustomers
1,10,2244,60
ORDERSforcustomers
2,11,2448,55
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• Everyrowispresentineveryelementofthegrid
• Appropriatefortablesthatare:• Relativelysmall• Frequentlyread• Infrequentlymodified
CREATE TABLE PRODUCTS(PROD_ID NUMBER
NOT NULL PRIMARY KEY,
PROD_NAME CHAR(12) ) DUPLICATE;
13
Duplicate
Element1 ElementN…
1,Books2,Food3,Tools4,Toys
PRODUCTSDuplicate
PRODUCTS
1,Books2,Food3,Tools4,Toys
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
TimesTenScaleout- HighAvailability
• Built-inHAviamultiplecopiesofthedata(K-safety)– Automaticallykeptinsync
• All replicasareactive forreadsandwrites– Increasesthecomputecapacity
• Transactionscanbeinitiatedfrom,andexecutedon,anyreplica• Queriesandtransactionscanspanany/allelements
K-safety,AllActive
A’
A
B’
BC
C’
D
D’
14
DataSpaceGroup1
DataSpaceGroup2
ReplicaSet1
ReplicaSet2
ReplicaSet3
ReplicaSet4
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
DatabaseFaultTolerance– NoApplicationDownTimeProvidedonefullcopyofthedatabaseisavailable
• Ifmultipleelementsfail,applicationswillcontinueprovidedthereisonecompletecopyofthedatabase− AutomaticfailoverforC/Sconnections
• Elementsrecoverautomaticallyafterfailure
• Ifanentirereplicasetisdown,thatdataisunavailableuntilitrecovers− Applicationcanexplicitly chooseto
acceptpartialresults
15
B’
A
C
A’
B
C’
D D’
DataSpaceGroup1
DataSpaceGroup2
ReplicaSet1
ReplicaSet2
ReplicaSet3
ReplicaSet4
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
TimesTenScaleout- ElasticScalability
Adding(andremoving)replicasets- Dataredistributedtonewelements- Workloadautomaticallyusesthenewelements
- Connectionswillstarttousenewelements
- Throughputincreasesduetoincreasedcomputeresources
Expandandshrinkthedatabasebasedonbusinessneeds
16
E’E
B’
A
C
A’
B
C’
D D’
ReplicaSet1
ReplicaSet2
ReplicaSet3
ReplicaSet4
ReplicaSet5
DataSpaceGroup1
DataSpaceGroup2
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
CentralizedInstallationandManagement• AllTimesTenScaleoutmanagementandadminoperationsareperformedfromasinglehost– Installingsoftware– Patchingsoftware– Configuration– Databasecreationandmanagement– Backupandrestore– Monitoring– Collectingdiagnostics
• Commandlineinterface• SQLDeveloper(GUI)interface
17
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
RS1_DSG1 RS1_DSG22PC
RS2_DSG1 RS2_DSG2
RS3_DSG1 RS3_DSG2
RS4_DSG1 RS4_DSG2
MGMT1
MGMT2
InternalNetwork
ExternalNetwork
2PC
2PC
2PC
…ZooKeeper
MembershipManagement
SSH&SCP
MOUNT/SCP
SSH
Managementinstances
DatainstancesRepositoryStorageHosts
REPO1
TimesTenScaleoutArchitectureOverview
18
SQL
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
Twomodes,supportedforall APIs(ODBC,OCI,JDBC,ODP.NET,…)TimesTenApplicationConnectivity
19
Host1
DatabaseElement
SharedMemory
App1
App2
AppN
…
Directmode• Appsrunonsamehostasdatabaseelement• Appsdirectlymapdatabasesharedmemory(viaTTengine)• Nocontextswitches,noIPCfordatabaseaccess• Ultralowlatency(inprocessdirectmemoryaccess)
TTServer1
TTServer2
TTServerN
…
Host2
App1
App2
AppN
…
Network
Client/servermode• TCP/IPconnectionsbetweenappandTTserverprocesses• TTServerprocessisamulti-threadeddirectmodeapp• Eachinteractioninvolves1ormoren/wroundtrips• MoreprocessesonDBhost,morecontextswitches• Moreoverhead,higherlatency
Youcanmixandmatchthesemodesasdesiredbasedonyourrequirements.
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.| 20
FactorsinfluencingTimesTenScaleoutperformance
1. Network Networkperformanceisvery important,especiallylatency
2. CPU,RAM,Storage Hardwarecapacityandperformanceisimportant
3. Numberofmachines/VMs One(ormore)Scaleoutinstancespermachine/VM
4. NumberofScaleout instances Onedatabaseelementperinstance
5. Datadistributionchoices Hash,reference,duplicate;distributionkeys
6. Localindexes Fasterdataaccess,slowerDML
7. Globalindexes Muchfasterdataaccess,muchslowerDML
8. Application Design,implementation,connectivitymode,datalocalityoptimisations (routingAPI)
Foragivenschema,datasetandSQLworkload
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.| 21
TimesTenScaleout:UnmatchedTransactionThroughput
5.003.22510.213.637
19.803.43639.244.125
76.167.743
144.211.475
0
20.000.000
40.000.000
60.000.000
80.000.000
100.000.000
120.000.000
140.000.000
160.000.000
0 10 20 30 40 50 60 70
SQLTransactions/secWorkload
• ThebenchmarkisanOLTPworkloadcalledTPTBM
• Mixedworkloadwith80%read /20% update (keybased)
• Directmode• Localityoptimization
Configuration
• OracleBareMetalCloud64xBM.HighIO1.36
• Platform- OracleLinuxx8664-bit• CPU- [email protected]• Network- 10GEthernet• Storage- NVMe DiskStorage
144MillionSQLTransactions/Second
LinearScalability
Numberofdatabaseelements
TransactionsperSecon
d
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.| 22
TimesTenScaleout:UnmatchedReadScalability
39.241.446
78.705.103
154.432.274
308.344.070
616.833.030
1.236.703.781
0
200.000.000
400.000.000
600.000.000
800.000.000
1.000.000.000
1.200.000.000
1.400.000.000
0 10 20 30 40 50 60 70
SQLSelects/secWorkload
• ThebenchmarkisanOLTPworkloadcalledTPTBM
• Workloadis100%read (keybased)
• Directmode• Localityoptimization
Configuration
• OracleBareMetalCloud64xBM.HighIO1.36
• Platform- OracleLinuxx8664-bit• CPU- [email protected]• Network- 10GEthernet• Storage- NVMe DiskStorage
Numberofdatabaseelements
TransactionsperSecon
d
1.2BillionSQLSelects/Second
LinearScalability
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
TimesTenScaleoutSummary
• Extremeperformanceandscalability• Singledatabaseimage,datalocationtransparency• FullSQL,ACIDtransactions,fullconsistency• AutomatichighavailabilityviaK-safety• Elasticscale-outandscale-in• Easytodeployandmanage• Easyapplicationdevelopment• On-premisesorClouddeployment
23
NewfeatureinTimesTen18.1Release
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
TimesTen VelocityScaleBetafeedbackSamsungWithitselasticallyscalablearchitectureandstrongHA,TimesTenScaleoutisaveryattractivesolutionforthenextgenerationofnetworksystems!-- ShinDongKeun,PrincipalEngineer
24
ChinaMobileDuringthebetaweexperiencedthepowerfulcapabilitiesofOracleTimesTenScaleoutwithpleasure.Wefoundittobeuniqueamongstsimilartypesofproductsandare lookingforwardtoitappliedinour nextgeneration distributedrealtime billingsystem.-- ChenZhiheng,BusinessSupportSystemPlanner
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
• End-to-endresponsetime<<200millisecondsviaC/Sconnectionmode
• NewLBS(locationbasedservice)modulewith2000concurrentconnectionsinpeaktime
• Easy,automatichigh-availability• NoapplicationcodechangesmovingfromTimesTen11.2.2toTimesTenScaleout
• Scalabilityforfuturegrowth
WhyTimesTenScaleout?
ChinaMobileMarketingPromotionSystem
• Industry:Telecom•Business:Business&OperationSupportSystem•Application:MarketingPromotionSystem
⁻ PromoteChinaMobileproductstovariouschannelsincludingwebsite,APPS,SMS,WeChat,etc.
⁻ 30milliontargetsubscribers⁻ 15millionpromotionsperday
• Highlyconcurrentmobilelocationsbasedquery⁻ Foreverysubscriberinthemobilecarriernetwork
• Hightransactionthroughputwithconsistentlowlatency⁻ ReadmostlyapplicationwithsmallamountofDMLandDDL
• Scalabilitytoachievehigherthroughputandcapacity
ApplicationOverview
Challenges
Solution•TimesTenScaleoutwithK=2forHighAvailability
ChongqingMobileSubsidiary
MarketingPromotionSystemsupportsover30millionsubscribersanddelivers15milliontargetedmarketingmessagesperday.
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
Wanttolearnmore?• TimesTenOTNPortalhttp://www.oracle.com/technetwork/database/database-technologies/timesten/overview/index.html– ProductInformation• Presentations,usecases,whitepapers,FAQs,…
– SoftwareDownloads– ProductDocumentation– ScaleoutDemo/LearningVirtualBoxVMdownload
• TimesTenQuickStartandScaleoutSampleProgramsonGitHubhttps://github.com/oracle/oracle-timesten-samples
• Contactme:ChrisJenkins([email protected])
26
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|
QA&
27
Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.| 28