SlideShare a Scribd company logo
1 of 11
Download to read offline
.net webservice for mysql
.NET 에서 MySQL 사용하기
2015.08.29 최진혁
1
2
MSSQL 에서의 in/out
XML type 인자로 받아 프로시져 내부에서 Parsing
3
.NET 의 Reflection 활용 Parameter Bind
Parameter 변경시 매번 코딩은 불편, client – web – database (procedure ) 까지 하나의 class로 관리
4
Information_schema 과다 조회?
CBT 이후 information_schema. ROUTINES 조회에 따른 tmp_table 과다 생성 발견
5
Information_schema 과다 조회?
Check Parameters Option
 Check Parameter = True 시 인자의 개수 와 name 만 맞으면 OK.
순서는 중요하지 않음
 하지만 MySQL Connector 가 해당 parameter binding 을 위해
내부적으로 매번 information schema 조회하면서 tmp table 생성 → 성능저하
 Check Parameter = False 로 하여
Parameter 개수는 물론 순서가 맞지 않을 시에는 Exception 이 발생하도록 하자!
6
Information_schema 과다 조회?
Check Parameters Option
7
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
affect_row vs matched_row
 affect_row : CASE WHEN 절의 조건에 포함되어, 실제 Update 가 일어난 row 수
 matched_row : WHERE 절의 조건을 만족하는 row 수
8
affect_row vs matched_row
SUCCESS Case
FAIL Case
의도한 대로 ROW_COUNT() 가 affected_row 로
집계되어, 체크건수와 실제업데이트건수가 맞지
않은 경우 IF 문에 의해실패 처리됨
(실제 2가지의 rune 모두 업데이트 되지 않음 )
on Workbench Connection
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
9
affect_row vs matched_row
의도한 것과 달리,
IF 문 체크가 되지 않아,
Result 는 0 으로 리턴되고 실제 gold 도 증가함
on MySQL Connector .NET
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
10
Unexpected result on ROW_COUNT()
 Connection String option 에 따라 MySQL .NET Connector 에서 실행한 Procedure 내부의
ROW_COUNT() 가 affected_row 또는 matched_row 로 인식될 수 있음
 Default 는
Use Affected Rows=False
matched_row
해당경우에는 UPDATE 후 ROW_COUNT 체크시 주의해야함.
Use Affected Rows=True
affected_row
ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
11

More Related Content

Similar to .NET Webservice for MySQL

[오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC [오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC Ji-Woong Choi
 
Spring mvc
Spring mvcSpring mvc
Spring mvcksain
 
ParameterizedTest 와 ContextCaching.pptx
ParameterizedTest 와 ContextCaching.pptxParameterizedTest 와 ContextCaching.pptx
ParameterizedTest 와 ContextCaching.pptxjunu6
 
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018Amazon Web Services Korea
 
프론트엔드스터디 E03 - Javascript intro.
프론트엔드스터디 E03 - Javascript intro.프론트엔드스터디 E03 - Javascript intro.
프론트엔드스터디 E03 - Javascript intro.Young-Beom Rhee
 
실전 DataSnap!
실전 DataSnap!실전 DataSnap!
실전 DataSnap!Devgear
 
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스정재 전
 
07.실행환경 교육교재(표준프레임워크 세부 적용기준)
07.실행환경 교육교재(표준프레임워크 세부 적용기준)07.실행환경 교육교재(표준프레임워크 세부 적용기준)
07.실행환경 교육교재(표준프레임워크 세부 적용기준)Hankyo
 
Spring MVC
Spring MVCSpring MVC
Spring MVCymtech
 
파이썬 sqlite 이해하기
파이썬 sqlite 이해하기파이썬 sqlite 이해하기
파이썬 sqlite 이해하기Yong Joon Moon
 
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDBI Goo Lee
 
04.실행환경 교육교재(화면처리)
04.실행환경 교육교재(화면처리)04.실행환경 교육교재(화면처리)
04.실행환경 교육교재(화면처리)Hankyo
 
Mvc 패턴
Mvc 패턴Mvc 패턴
Mvc 패턴Seokju Hong
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestI Goo Lee
 
결합도 관점에서 본 VO 문제점
결합도 관점에서 본 VO 문제점결합도 관점에서 본 VO 문제점
결합도 관점에서 본 VO 문제점JavaCommunity.Org
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxNeoClova
 
이펙티브 C++ (7~9)
이펙티브 C++ (7~9)이펙티브 C++ (7~9)
이펙티브 C++ (7~9)익성 조
 

Similar to .NET Webservice for MySQL (17)

[오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC [오픈소스컨설팅]Spring MVC
[오픈소스컨설팅]Spring MVC
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
ParameterizedTest 와 ContextCaching.pptx
ParameterizedTest 와 ContextCaching.pptxParameterizedTest 와 ContextCaching.pptx
ParameterizedTest 와 ContextCaching.pptx
 
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
 
프론트엔드스터디 E03 - Javascript intro.
프론트엔드스터디 E03 - Javascript intro.프론트엔드스터디 E03 - Javascript intro.
프론트엔드스터디 E03 - Javascript intro.
 
실전 DataSnap!
실전 DataSnap!실전 DataSnap!
실전 DataSnap!
 
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
타지키스탄 세관 신고 데이터 기반 위법물 탐지 서비스
 
07.실행환경 교육교재(표준프레임워크 세부 적용기준)
07.실행환경 교육교재(표준프레임워크 세부 적용기준)07.실행환경 교육교재(표준프레임워크 세부 적용기준)
07.실행환경 교육교재(표준프레임워크 세부 적용기준)
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
파이썬 sqlite 이해하기
파이썬 sqlite 이해하기파이썬 sqlite 이해하기
파이썬 sqlite 이해하기
 
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDB
 
04.실행환경 교육교재(화면처리)
04.실행환경 교육교재(화면처리)04.실행환경 교육교재(화면처리)
04.실행환경 교육교재(화면처리)
 
Mvc 패턴
Mvc 패턴Mvc 패턴
Mvc 패턴
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
 
결합도 관점에서 본 VO 문제점
결합도 관점에서 본 VO 문제점결합도 관점에서 본 VO 문제점
결합도 관점에서 본 VO 문제점
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
이펙티브 C++ (7~9)
이펙티브 C++ (7~9)이펙티브 C++ (7~9)
이펙티브 C++ (7~9)
 

More from I Goo Lee

MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항I Goo Lee
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOI Goo Lee
 
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQLI Goo Lee
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기I Goo Lee
 
Backup automation in KAKAO
Backup automation in KAKAO Backup automation in KAKAO
Backup automation in KAKAO I Goo Lee
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축I Goo Lee
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용I Goo Lee
 
MySQL 5.7 NF – Optimizer Improvement
 MySQL 5.7 NF – Optimizer Improvement MySQL 5.7 NF – Optimizer Improvement
MySQL 5.7 NF – Optimizer ImprovementI Goo Lee
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용I Goo Lee
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)I Goo Lee
 
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개I Goo Lee
 
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론I Goo Lee
 
AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분I Goo Lee
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTI Goo Lee
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKI Goo Lee
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKI Goo Lee
 
PostgreSQL 이야기
PostgreSQL 이야기PostgreSQL 이야기
PostgreSQL 이야기I Goo Lee
 
Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)I Goo Lee
 
Binlog Servers 구축사례
Binlog Servers 구축사례Binlog Servers 구축사례
Binlog Servers 구축사례I Goo Lee
 

More from I Goo Lee (20)

MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
 
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQL
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기
 
Backup automation in KAKAO
Backup automation in KAKAO Backup automation in KAKAO
Backup automation in KAKAO
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
MySQL 5.7 NF – Optimizer Improvement
 MySQL 5.7 NF – Optimizer Improvement MySQL 5.7 NF – Optimizer Improvement
MySQL 5.7 NF – Optimizer Improvement
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
 
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
 
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론
 
AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMT
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELK
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
PostgreSQL 이야기
PostgreSQL 이야기PostgreSQL 이야기
PostgreSQL 이야기
 
Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)
 
Binlog Servers 구축사례
Binlog Servers 구축사례Binlog Servers 구축사례
Binlog Servers 구축사례
 

.NET Webservice for MySQL

  • 1. .net webservice for mysql .NET 에서 MySQL 사용하기 2015.08.29 최진혁 1
  • 2. 2 MSSQL 에서의 in/out XML type 인자로 받아 프로시져 내부에서 Parsing
  • 3. 3 .NET 의 Reflection 활용 Parameter Bind Parameter 변경시 매번 코딩은 불편, client – web – database (procedure ) 까지 하나의 class로 관리
  • 4. 4 Information_schema 과다 조회? CBT 이후 information_schema. ROUTINES 조회에 따른 tmp_table 과다 생성 발견
  • 5. 5 Information_schema 과다 조회? Check Parameters Option  Check Parameter = True 시 인자의 개수 와 name 만 맞으면 OK. 순서는 중요하지 않음  하지만 MySQL Connector 가 해당 parameter binding 을 위해 내부적으로 매번 information schema 조회하면서 tmp table 생성 → 성능저하  Check Parameter = False 로 하여 Parameter 개수는 물론 순서가 맞지 않을 시에는 Exception 이 발생하도록 하자!
  • 7. 7 ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET) affect_row vs matched_row  affect_row : CASE WHEN 절의 조건에 포함되어, 실제 Update 가 일어난 row 수  matched_row : WHERE 절의 조건을 만족하는 row 수
  • 8. 8 affect_row vs matched_row SUCCESS Case FAIL Case 의도한 대로 ROW_COUNT() 가 affected_row 로 집계되어, 체크건수와 실제업데이트건수가 맞지 않은 경우 IF 문에 의해실패 처리됨 (실제 2가지의 rune 모두 업데이트 되지 않음 ) on Workbench Connection ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 9. 9 affect_row vs matched_row 의도한 것과 달리, IF 문 체크가 되지 않아, Result 는 0 으로 리턴되고 실제 gold 도 증가함 on MySQL Connector .NET ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 10. 10 Unexpected result on ROW_COUNT()  Connection String option 에 따라 MySQL .NET Connector 에서 실행한 Procedure 내부의 ROW_COUNT() 가 affected_row 또는 matched_row 로 인식될 수 있음  Default 는 Use Affected Rows=False matched_row 해당경우에는 UPDATE 후 ROW_COUNT 체크시 주의해야함. Use Affected Rows=True affected_row ROW_COUNT() 유의사항 (Workbench Connection vs MySQL Connector .NET)
  • 11. 11