February 15, 2017 GETTING STARTED WITH NUODB The elastic SQL database for hybrid cloud applications
LOGISTICS AND INTRODUCTIONS 2 + All a&endees are muted + Submit ques3ons in the Q&A box on the right + Webinar is being recorded and will be available for replay Boris Bulanov Vice President of Technology Chris&na Wong Director of Product Marke0ng
DATABASE MODERNIZATION LAGS BEHIND Elas3city, scale out, distribu3on, cloud 3
POSSIBLE COMPROMISES Tradi&onal NoSQL Cloud Familiar development (ANSI SQL) Maintain business database of record 4 Other NewSQL StraighLorward to elas3cally scale Fast data access for the app Con3nuous availability Simple migra3on Deployment flexibility
WHAT S NEEDED FOR CLOUD SUCCESS? 5 What everyone wants: Elas&city What they don t want to lose SQL Virtualiza3on, Commodity & Cloud Scale out / in Con3nuous Availability ACID (consistency) Exis3ng SQL skills & code SQL database abstrac3on I want to elas,cally scale my SQL RDBMS to the cloud
NUODB, THE ELASTIC SQL DATABASE 6 Separate the applica0on, transac0ons, and storage for elas0c scalability In- memory transac&ons + Working data set + No shards / explicit par33oning + Scale throughput & clients on- demand One logical database + Both 3ers survive failures and rolling upgrades at any peer + Allocate servers based on workload Redundant, flexible storage + Durable persistence + Automa3cally replicate to mul3ple loca3ons + Storage management independent of performance considera3ons
A WALK THROUGH NUODB COMMUNITY EDITION
TOPICS PROCESS + Introduc3on + Install + Manage + Run + Survive TAKE- AWAYS + Simplicity Dynamic configura3on and management + Capacity on- demand Elas3c scale- out + Resilience No single point of failure
NuoDB ARCHITECTURE IN PRACTICE App App App TE TE TE + Fully redundant + Elas3cally scalable + Con3nuously available + Ac3ve/Ac3ve across single DC or mul3ple AZ s Available host Scale- out adds SM SM NuoDB database SM TE Storage Manager (SM) Transac3on Engine (TE)
CE SAMPLE DEPLOYMENT TOPOLOGY 10 Host- 1 B1 Host- 0 TE1 Host- 4 B4 Host- 2 B2 AP1 TE2 SM1 Journal B3 Archive Host- 3 TE2
1. INSTALL PROVISION HOSTS 11 + Provisioning hosts Prepare Machines are properly networked (for AWS see Appendix A) Install on each host see CE blog at h&p://www.nuodb.com/ce- tech- blog Modify host configura3on $ sudo vi /opt/nuodb/etc/default.properties domainpassword = bird peer = (SEE NEXT SLIDE) Start Brokers $ sudo /opt/nuodb/etc/nuoagent start Check Brokers $ /opt/nuodb/bin/nuodbmgr -broker localhost password bird nuodb [domain] > show domain summary
1. INSTALL CONFIGURE BROKERS 12 Host- 0 Host- 1 peer = B1 Host- 4 B4 Host- 2 peer = host- 1 B2 peer = host- 1 Host- 3 B3 peer = host- 1
1. INSTALL START DATABASE 13 + Start Database Create directory for database archive ex. /home/ubuntu/dbs Start SM nuodb [domain] > start process sm archive /home/ubuntu/dbs host host-4 database hockey initialize true Start TEs nuodb [domain] > start process te host host-1 database hockey options '--dba-user dba --dba-password dba' nuodb [domain] > start process te host host-2 database hockey options '--dba-user dba --dba-password dba' nuodb [domain] > start process te host host-3 database hockey options '--dba-user dba --dba-password dba' Pay a&en3on to non- specified default parameters: Commit local (default) or remote flexible commit protocol Memory 2GB (default) garbage collec3on trigger
1. INSTALL POPULATE DATABASE 14 + Populate Database $ /opt/nuodb/bin/nuosql hockey@localhost --user dba --password dba -- file /opt/nuodb/samples/quickstart/sql/create-db.sql $ /opt/nuodb/bin/nuosql hockey@localhost --user dba --password dba -- file /opt/nuodb/samples/quickstart/sql/teams.sql $ /opt/nuodb/bin/nuosql hockey@localhost --user dba --password dba -- file /opt/nuodb/samples/quickstart/sql/players.sql $ /opt/nuodb/bin/nuosql hockey@localhost --user dba --password dba -- file /opt/nuodb/samples/quickstart/sql/scoring.sql
1. INSTALL PROVISIONED DATABASE 15 Host- 1 B1 Host- 0 TE1 Host- 4 B4 Host- 2 B2 TE2 SM1 Journal B3 Archive Host- 3 TE3
2. MANAGE DOMAIN AND SYSTEM 16 + DOMAIN - NuoDB Manager U3lity $ /opt/nuodb/bin/nuodbmgr -broker localhost password bird nuodb [domain] > show domain health nuodb [domain] > show host properties host localhost + SYSTEM - NuoSQL client $ /opt/nuodb/bin/nuosql hockey -user dba -password dba SQL> select sqlstring, connid, nodeid from system.connections where handle = 1; SQL> select id, address, type, triptime from system.nodes;
2. MANAGE ENGINES AND SQL 17 + ENGINES Monitoring $ /opt/nuodb/bin/nuodbmgr -broker localhost --password bird --command "monitor domain" + SQL Monitoring $ /opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "log database hockey categories sql-statements"
3. RUN 18 Host- 1 B1 Host- 0 TE1 Host- 4 B4 Host- 2 B2 AP1 TE2 SM1 Journal B3 Archive Host- 3 TE3
3. RUN JAVA CLIENT 19 + Java Client Program
3. RUN COMPILE AND START 20 + Compile $ javac -cp /opt/nuodb/jar/nuodbjdbc.jar SimpleDriver.java + Run $ java -cp./:/opt/nuodb/jar/nuodbjdbc.jar SimpleDriver -url jdbc:com.nuodb://localhost/hockey -user dba -password dba -threads 3 -time 60 -report 5 -batch 10 Feb:12:19:37:14; Feb:12:19:37:19; Feb:12:19:37:24; Feb:12:19:37:29; Feb:12:19:37:34; Feb:12:19:37:39; work=1282.01op/s; time=4999.97; ave latency=2.05ms; ave tx=22.14ms work=1302.05op/s; time=10007.28; ave latency=2.04ms; ave tx=21.82ms work=1315.21op/s; time=15001.44; ave latency=2.02ms; ave tx=21.61ms work=1316.48op/s; time=20007.94; ave latency=2.03ms; ave tx=21.59ms work=1320.34op/s; time=25008.73; ave latency=2.02ms; ave tx=21.54ms work=1322.23op/s; time=30009.95; ave latency=2.02ms; ave tx=21.50ms Feb:12:19:37:44; work=1322.23op/s; time=30009.95; ave latency=2.02ms; ave tx=21.50ms Feb:12:19:37:44; Total statements=39,680; elapsed=30009.95ms (sleep=1404.909ms); rows=0; rate=1322.23op/s; ave latency=2.02ms; ave tx=21.50ms;
4. SURVIVE - THE FAILURE SCENARIO 21 Host- 1 B1 Host- 0 TE1 Host- 4 B4 Host- 2 B2 AP1 TE2 SM1 Journal B3 Archive Host- 3 TE3
4. SURVIVE - START + 2. Check connec3ons $ /opt/nuodb/bin/nuosql hockey -user dba - password dba + 1. Check Domain $ /opt/nuodb/bin/nuodbmgr -broker localhost password bird nuodb [domain] > show domain summary Database: hockey, (unmanaged), processes [3 TE, 1 SM], ACTIVE [TE]172.31.19.9:48005 [ pid = 6495 ] [ nodeid = 9 ] RUNNING [TE]172.31.26.217:48005 [ pid = 7232 ] [ nodeid = 11 ] RUNNING [SM]127.0.0.1:48005 [ pid = 1917 ] [ nodeid = 1 ] RUNNING [TE]172.31.29.177:48005 [ pid = 7609 ] [ nodeid = 8 ] RUNNING + 3. Kill TE nuodb [domain] > shutdown process Host: host-2 Process ID: 6495 Process shutdown cleanly SQL> select sqlstring, nodeid, connid from system.connections; SQLSTRING NODEID CONNID ------------------------------------------- ------- ------- SELECT * from User.Teams WHERE year <? 9 22 SELECT * from User.Teams WHERE year <? 9 23 9 24 select sqlstring, nodeid, connid from 9 25 SELECT * from User.Teams WHERE year <? 11 9 11 10 11 11 11 12 8 25 SELECT * from User.Teams WHERE year <? 8 26 22 8 27
4. SURVIVE - CONTINUE 23 + 4. Observe Client Applica3on (change 3me parameter) $ java -cp./:/opt/nuodb/jar/nuodbjdbc.jar SimpleDriver -url jdbc:com.nuodb://localhost/hockey -user dba -password dba -threads 3 -time 1000 -report 5 -batch 10 INFO: Feb:10:16:17:14; INFO: Feb:10:16:17:19; INFO: Feb:10:16:17:24; INFO: Feb:10:16:17:29; INFO: Feb:10:16:17:34; work=1342.00op/s; ave latency=2.12ms work=1342.00op/s; ave latency=2.12ms work=1342.00op/s; ave latency=2.12ms work=1343.00op/s; ave latency=2.12ms work=1344.00op/s; ave latency=2.11ms INFO: Feb:10:16:17:37; Communication failed with TE failing over... java.sql.sqltransientconnectionexception: End of stream reached INFO: Feb:10:16:17:37; Communication failed with TE failing over... java.sql.sqltransientconnectionexception: End of stream reached INFO: Feb:10:16:17:37; Communication failed with TE failing over java.sql.sqltransientconnectionexception: End of stream reached INFO: Feb:10:16:17:39; INFO: Feb:10:16:17:44; INFO: Feb:10:16:17:49; work=1344.00op/s; ave latency=2.11ms work=1342.00op/s; ave latency=2.12ms work=1341.00op/s; ave latency=2.12ms + 5. Check connec3ons $ /opt/nuodb/bin/nuosql hockey -user dba -password dba SQL> select sqlstring, nodeid, connid from system.connections; SQLSTRING NODEID CONNID ----------------------------------------- ------- ------- select sqlstring, nodeid, connid from system 8 28 8 29 SELECT * from User.Teams WHERE year <? 8 30 8 31 SELECT * from User.Teams WHERE year <? 8 32 8 33 11 13 11 14 11 15 SELECT * from User.Teams WHERE year <? 11 16 11 17
SUMMARY PROCESS + Install + Manage + Run + Survive TAKE- AWAYS + Simplicity Dynamic configura3on and management + Capacity on- demand Elas3c scale- out + Resilience No single point of failure
QUESTIONS & NEXT STEPS 25 + Get started! These Slides To be sent following webinar TechBlog Post w/installa3on details www.nuodb.com/ce- tech- blog GitHub Repository with samples www.nuodb.com/github- gerng- started + Upgrade for more robust features! Jump Start program (for start- ups) Free, fully redundant development database (2 TEs : 2 SMs) www.nuodb.com/jump- start Request evalua3on www.nuodb.com/evalua3ng- nuodb Upgrade to Professional or Enterprise Edi3on www.nuodb.com/contact- sales
APPENDIX A AWS CONFIGURATION 26 + Recommended EC2 types t2.micro brokers only, experimen3ng t2.large development, func3onal test r4.xlarge for TE performance benchmarking with best memory per $ r3.xlarge for SM performance benchmarking with best SSD per $ r4.xlarge/r3.xlarge and higher produc3on systems + Open ports in Security Groups NuoDB default port range 48004 49000 Example: