Skip to content

Tadpole DB HUB(MongoDB) User Guide

suhyunjeon edited this page Sep 4, 2013 · 4 revisions

Tadpole DB HUB(MongoDB) User Guide

Welcome to Tadpole! This is a web-based DB Query tool. You can connect variety DB in web browser and can control function for each users(user or admin or dba and so on). The goal is a DB HUB for all DB.

Homepage : https://github.com/hangum/TadpoleForDBTools/wiki License : Lesser General Public License(LGPL) Donate with paypal itโ€™s easy to give with PayPal for Tadpole. Detail see - https://github.com/hangum/TadpoleForDBTools/wiki/Donor-List Contact : TADPOLE([email protected]) Now we are supporting - Amazon RDS, CUBRID, MarisDB, Oracle, MySQL, MSSQL, PostgreSQL, SQLite, MongoDB. Tadpole lets you creatively focus on your project by simply the amount of work needed for a given task.

List of tested

  • Amazon RDS : aws-java-sdk-1.4.7
  • CUBRID : 8.4.x ~
  • Oracle : 10g ~
  • MySQL : 5.4.x ~
  • MariaDB : 5.5.x ~
  • MSSQL : 2000 ~
  • PostgreSQL : 9.1.x ~
  • SQLite : 3.7.2 ~
  • MongoDB : 2.0.5 ~

Documentation

This is explain for MongoDB.

Agenda

Install

  1. JAVA 1.6.x(Mac 1.7.x)
  2. Linux, Mac, Windows, Tomcat 6.x (If you want to user the other O.S, connect me : [email protected])
  3. Download ๋ฐ›์•„์„œ ์ ๋‹นํ•œ ๋””๋ ‰ํ† ๋ฆฌ์— ์••์ถ•์„ ํ’‰๋‹ˆ๋‹ค.
  4. Reference more

Getting Started

Standalone installation

  1. Execute TadpoleDBHub-1.x.x\tadpole-standalone.exe
  2. After install, automatically run a web-browser(OR you can install the TadpoleForDBToolsStartup by double click). It will happen to you when you first start that you can't find the page to the web-browser cause engine is starting. Don't freak out. Let's click F5(Refresh).
  3. Open the web-browser and start 'http://127.0.0.1:10081/tadpole'

ps) Tadpole DB is TadpoleDBHub-1.x.x/configuration/tadpole/db/tadpole-system.db. Please install new version and backup.

Install Tomcat

  1. Did you have installed Tadpole before? OK. Please backup a apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db file. And delete apache-tomcat-6.x.x/work directory.
  2. Change war name to 'tadpole.war' from 'TadpoleDBHub1.x.x-tadpole.war'.
  3. The WAR file should be in the webapp directory path. And Tomcat should be installed and running.
  4. If the context root is tadpole, start http://127.0.0.1:8080/tadpole/tadpole in the web-browser.
  5. If you upgrade to datas of old data, copy to tadpole-system.db from a backup file(number1. apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db) in same directory.

Login

Login

  1. Test mode window.
  2. Tadpole has Admin, Manager, User(Developer). First DEFAULT USER made.
  1. If you want to try test mode, you don't need to EMAIL ADDRESS, PASSWORD. We supported 'admin login/user login' for test mode. Do you want use to test mode? Click the button.
  2. Add new user : (https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EC%8B%A0%EA%B7%9C-%EC%9C%A0%EC%A0%80-%EB%93%B1%EB%A1%9D)

๊ถŒํ•œ

  1. ์–ด๋“œ๋ฏผ์€ ์‹œ์Šคํ…œ์— ๋“ฑ๋ก๋œ ๋ชจ๋“  ๋””๋น„(ํŒจ์Šค์›Œ๋“œ ์ œ์™ธ)์™€ ์‚ฌ์šฉ์ž๋ฅผ ๊ด€๋ฆฌ ํ•ฉ๋‹ˆ๋‹ค.
  2. ๊ด€๋ฆฌ์ž๋Š” ์‚ฌ์šฉ์ž ๊ทธ๋ฃน์„ ๊ด€๋ฆฌ ํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋“ค๊ณผ DB, ๋ฆฌ์†Œ์Šค๋“ฑ์„ ๊ณต์œ ํ•˜๋ฉฐ ํ•จ๊ป˜ ์‚ฌ์šฉ ํ•ฉ๋‹ˆ๋‹ค. ์ฒ˜์Œ ๊ด€๋ฆฌ์ž๋ฅผ ๋งŒ๋“œ์‹ค๋•Œ๋Š” ํ”„๋กœ์ ํŠธ ๊ทธ๋ฃน ์ฒ˜์Œ๋“ฑ๋ก์‹œ ์–ด๋“œ๋ฏผ์˜ ํ—ˆ๋ฝ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. DB๋ฅผ ๋“ฑ๋ก ์‚ญ์ œ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ๋””๋น„๋ฅผ ๋“ฑ๋ก ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
  3. DBA๋Š” ์‚ฌ์šฉ์ž ๋ฆฌ์ŠคํŠธ์™€ ๋””๋น„๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์‚ฌ์šฉ์ž๊ฐ€ ์‹คํ–‰ํ•œ ์ฟผ๋ฆฌ๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  4. ์‚ฌ์šฉ์ž๋Š” ์‹ค์ œ ์‚ฌ์šฉ์ž ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ํŠน์ • ๊ทธ๋ฃน์— ์†Œ์† ๋˜์–ด์•ผ ํ•˜๋ฉฐ ๊ด€๋ฆฌ์ž์˜ ์Šน์ธ ํ›„ ๋กœ๊ทธ์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๊ด€๋ฆฌ์ž๊ฐ€ ๋“ฑ๋กํ•ด ๋†“์€ ๋””๋น„๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ฟผ๋ฆฌ๋“ฑ์„ ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž์™€ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

The whole view of Tadpole

Tadpole part

  1. Toolbar(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%ED%88%B4%EB%B0%94) : Connection DB, save, authority(if it is a 'manager' or an 'admin' user), environment and so on.
  2. Database List(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%AA%A9%EB%A1%9D) : New create DB, delete, shared user's data.
  3. Object Explorer(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EC%98%A4%EB%B8%8C%EC%A0%9D%ED%8A%B8-%ED%83%90%EC%83%89%EA%B8%B0) : Show the Object(Table, View)' list of select to the Database List.
  4. Main UI(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#sql-editor) : Show the DB Query editor, MongoDB profile viewer and main job viewer.

Toolbar

A toolbar is a GUI widget on which on-screen buttons, icons, menus, or other input or output elements are placed. And limited permission. 'Manager' can use all function, 'User' can't create DB, delete, profile functions.

toolbar

  • Show connection DB window.
  • Save data in current SQL Editor.
  • Show SQL Editor selected 'Database List' window.
  • Show ERD Editor selected 'Database List' window.
  • Delete shared resources selected 'Database List' window.
  • Show user, db information.
  • Show query statements history information all DB.
  • Show environment information.
  • Show bug, request issues.(need to Github account)
  • Show system preferences.
  • Close button.(If standalone, program shutdown, or run Tomcat, logout)

Database List

Display DB list which do allow the connections. Managing DB. Use shared connection information to user in same groups.

Add DB and Use

Only Manager permission user can add DB.

Add DB : Toolbar connection-toolbar-btn click.

connection dialog

  1. DB List for connection
  2. System preference to management Tadpole
  • Server type : Input DB of server type
  • Server type -> Production Server : Create management DB. If the database is active, 'user' can't delete Collection.
  • Server type -> Developer Server : This is development DB and you can do all thing for except permission.
  • Server type -> Others Server : This is add other uses of a DB and you can do all thing for except permission.
  • Group : DB group to add each other easier.
  • Name : DB name for Database List.
  1. Input database information selected no.1.
  2. Additional information connected no.2.
  • Readonly Connection : Can't remove, Modify and so on connected DB. Only SELECT statements is possible in SQL Editor.
  • Auto Commit : When the auto-commit mode is enabled, the operation commits the transaction immediately after an INSERT, UPDATE or DELETE operation. When auto-commit is disabled, the transaction must be committed (through the effective SQL session) as required.
  • Table Filters : The filter is hidden and shown in the 'Object Explore'.
  • Profile : Query description, query execution time, monitor, result, and measure your application's SQL statements and stored procedures.
  • Show Tables : Display all of the tables in 'Object Explore'. When single schema has large tables, hide table and it prevent much slow for current status.
  1. Test, Save, Cancel to saved DB.
  • Test Connection : Display the information, when it is possible for a connection to input information of no.2.
  • Confirm : Add input DB connection information.
  • Cancel : Cancel add DB and close job..

Conneccted DB

If you add DB in the 'Database List', display in the group. And open SQL Editor of DB.

connection-2

  1. DB๋Š” 'DB์•„์ด์ฝ˜ [D] ๋“ฑ๋ก์ด๋ฆ„ (๊ฐœ์ •์ •๋ณด)' ํ‘œ์‹œ ๋ฉ๋‹ˆ๋‹ค. DB name tag
  • ์ฒซ ๋ฒˆ์งธ๋Š” DB์˜ ์ข…๋ฅ˜์ž…๋‹ˆ๋‹ค.
  • [D]๋Š” Developer Server์˜ ์•ฝ์–ด์ž…๋‹ˆ๋‹ค. Production Server๋Š” [P]๋กœ ํ‘œ์‹œ๋˜๋ฉด Others Server๋Š” [O]๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • ๋“ฑ๋กํ–ˆ๋˜ ์ด๋ฆ„ ์ž…๋‹ˆ๋‹ค.
  • ๋“ฑ๋กํ–ˆ๋˜ DB์˜ ๊ณ„์ • ์ •๋ณด์ž…๋‹ˆ๋‹ค. (์‚ฌ์šฉ์ž ๊ถŒํ•œ์˜ ์œ ์ €๋Š” ๋ณด์ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค)
  1. DB๋ฅผ ์„ ํƒํ•˜๋ฉด, '์˜ค๋ธŒ์ ํŠธ ํƒ์ƒ‰๊ธฐ'์— Object(์˜ˆ๋ฅผ ๋“ค์–ด. ์„ ํƒ๋œ DB์˜ Collections, Indexes, JavaScript)๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  2. DB๋ฅผ ๋”๋ธ” ํด๋ฆญํ•˜๋ฉด DB์˜ ์ธ์Šคํ„ด์Šค ์ •๋ณด, Collection ์š”์•ฝ, ๋””๋น„ ๋ฝ, ๋ฆฌํ”Œ๋ฆฌ์นด ์…‹, ์ƒค๋”ฉ ์ •๋ณด ์ฐฝ์ด ์—ด๋ฆฝ๋‹ˆ๋‹ค.
  3. DB๋ฅผ ์„ ํƒ ํ›„ ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ์‚ฌ์šฉ์ž ๊ถŒํ•œ์˜ ์—‘์…˜์ด ํ‘œ์‹œ ๋ฉ๋‹ˆ๋‹ค.
  • Refresh : '๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ชฉ๋ก'์ฐฝ์„ ์ตœ์‹  ์ •๋ณด๋กœ ๊ฐฑ์‹ ํ•ฉ๋‹ˆ๋‹ค.
  • ์›น ์ฝ˜์†” : MongoDB WebConsole ์ฐฝ์ด ์—ด๋ฆฝ๋‹ˆ๋‹ค.
  • Server Status : DB ํ”„๋กœ์„ธ์Šค ์‚ฌ์šฉ์ •๋ณด ๋‹ค์ด์–ผ๋กœ๊ทธ๊ฐ€ ๋ณด์—ฌ ์ง‘๋‹ˆ๋‹ค.
  • GridFS : GridFS ๋ช…๋ น์˜ ๊ฒฐ๊ณผ ๋‹ค์ด์–ผ๋กœ๊ทธ๊ฐ€ ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค.
  • Top : DB ์‚ฌ์šฉ ์ •๋ณด ๋‹ค์ด์–ผ๋กœ๊ทธ ์˜คํ”ˆ๋ฉ๋‹ˆ๋‹ค.
  • ERD -> ๋ชจ๋“  ํ…Œ์ด๋ธ” ERD : DB์˜ ๋ชจ๋“  ํ…Œ์ด๋ธ”์˜ ๊ด€๊ณ„๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
  • ERD -> ERD ๊ธฐ๋ณธ์ฐฝ ์ƒ์„ฑ : ERD์„ ๊ทธ๋ฆด ์ˆ˜ ์žˆ๋Š” ์ฐฝ์ด ์ƒ์„ฑ ๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” '์˜ค๋ธŒ์ ํŠธ ํƒ์ƒ‰๊ธฐ'์—์„œ ํ…Œ์ด๋ธ”๋“ค์„ ๊ฐ€์ ธ๋‹ค ๋†“์„์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Administer -> ํ”„๋กœํŒŒ์ผ : DB์—์„œ ์‹คํ–‰ ํ–ˆ๋˜ ์ฟผ๋ฆฌ ์ •๋ณด๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
  • Administer -> ์‚ฌ์šฉ์ž ๊ด€๋ฆฌ : DB ์‚ฌ์šฉ์ž ๊ด€๋ฆฌ ๋‹ค์ด์–ผ๋กœ๊ทธ๊ฐ€ ์˜คํ”ˆ๋ฉ๋‹ˆ๋‹ค.
  • Administer -> DB Information : '์˜ค๋ธŒ์ ํŠธ ํƒ์ƒ‰๊ธฐ'์— Object(์˜ˆ๋ฅผ ๋“ค์–ด. ์„ ํƒ๋œ DB์˜ Collections, Indexes, JavaScript)๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • Administer -> Session List : DB์—์„œ ํ˜„์žฌ ์‹คํ–‰ ์ค‘์ธ Session ๋ชฉ๋ก์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
  • Administer -> ์ž„ํฌํŠธ : ์˜ฌ์ฑ™์ด์— ์—ฐ๊ฒฐ๋œ DB์˜ ๋ฐ์ดํ„ฐ๋ฅผ MongoDB๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
  • Administer -> Delete Database : DB๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋“  ์‚ฌ์šฉ์ž์˜ DB๊ฐ€ ์‚ญ์ œ๋˜๋‹ˆ ์‹ ์ค‘ํ•˜๊ฒŒ ์„ ํƒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ธŒ์ ํŠธ ํƒ์ƒ‰๊ธฐ

'๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ชฉ๋ก'์—์„œ DB๊ฐ€ ์„ ํƒ๋˜๋ฉด, Collections, Indexes, JavaScript๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

mongo object

Filter : Collection์„ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค

  1. Collection์ด ์„ ํƒ๋˜๋ฉด Collection์˜ field์ •๋ณด๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  2. Collection์„ ๋”๋ธ”ํด๋ฆญํ•˜๋ฉด Collection ์กฐํšŒ ์ฐฝ์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.
  3. Collection์„ ์„ ํƒํ•˜๊ณ  ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ํŒ์—… ๋ฉ”๋‰ด๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.
  • Create Collection : Collection์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
  • Drop Collection : Collection์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.
  • Refresh Collection : ํ˜„์žฌ ์ฐฝ์„ ์ตœ์‹  ์ •๋ณด๋กœ ๊ฐฑ์‹  ํ•ฉ๋‹ˆ๋‹ค.
  • Generate Statement : Collection : Collection์— ์ƒˆ๋กœ์šด row๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
  • Rename Collection : Collection ์ด๋ฆ„์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.
  • ReIndex Collection : Connection์˜ ์ธ๋ฑ์Šค๋ฅผ ์ƒˆ๋กญ๊ฒŒ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. Collection์— ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์€ ๊ฒฝ์šฐ ์ฃผ์˜๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

Dataabase Information ์—๋””ํ„ฐ

์—ฐ๊ฒฐ๋œ ๋ชฝ๊ณ ๋””๋น„์˜ ๋ชจ๋“  Collection ์ •๋ณด๋ฅผ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค. ์ด ํ™”๋ฉด์€ Connectection Manager์—์„œ ๋””๋น„๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜์—ฌ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

mongodb all connection

  • Name Filter : Collection ์ด๋ฆ„์„ ๊ธฐ์ค€์œผ๋กœ ํ•„ํ„ฐ๋ง ํ•ฉ๋‹ˆ๋‹ค.
  • Collection์„ ์„ ํƒํ•˜๋ฉด ํ•ด๋‹น Collection์˜ field์ •๋ณด๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.
  • Collection์„ ๋”๋ธ” ํด๋ฆญํ•˜๋ฉด ํ•ด๋‹น Collection์„ ๊ฒ€์ƒ‰ํ•˜๋Š” ์ฐฝ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
  • ํ•˜๋‹จ์—๋Š” DB์˜ summary์ •๋ณด๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.

Find Collection

Collection ์ •๋ณด๋ฅผ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ JSON ์œผ๋กœ ๊ฒ€์ƒ‰ ํ•  ์ˆ˜ ์žˆ๋Š” ์ฐฝ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์ธ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ Tree, Tableํ˜•ํƒœ๋กœ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ์—๋””ํ„ฐ์—์„œ Ctrl + Space๋ฅผ ๋ˆ„๋ฅด๋ฉด Field์ •๋ณด๊ฐ€ ํ‘œ์‹œ ๋ฉ๋‹ˆ๋‹ค.

mongodb find collection

  1. Collection ๊ฒ€์ƒ‰ ์ฐฝ
  • ์กฐ๊ฑด์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. op field ๊ฐ€ query์ธ ํ•ญ๋ชฉ์„ ๊ฒ€์ƒ‰ํ•œ๋‹ค๊ณ  ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. {op : 'query'}
  • Find : ๊ฒ€์ƒ‰ ์ •๋ณด๋ฅผ ์ž…๋ ฅ ํ•ฉ๋‹ˆ๋‹ค ์˜ˆ๋ฅผ ๋“ค์–ด ์œ„์˜ ์บก์ณํ™”๋ฉด์—์„œ๋Š” item_id๊ฐ€ 7์ธ ์ •๋ณด๋ฅผ ๊ฒ€์ƒ‰ํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค.
  • Field : ์œ„์˜ ์บก์ณํ™”๋ฉด์—์„œ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํ•„๋“œ๋ฅผ quantity๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ๋งŒ์•ฝ์— ๋ชจ๋“  Field๋ฅผ ๋ณด์—ฌ์ฃผ๋ ค๋ฉด ์ž…๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • Sort : ์œ„์˜ ์บก์ณํ™”๋ฉด์—์„œ ํ•„๋“œ quantity๋ฅผ ๋‚ด๋ฆผ์ฐจ์ˆœ์œผ๋กœ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค.
  • Skip : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ์ค‘์— Skipํ•ฉ๋‹ˆ๋‹ค.
  • Limit : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ์ค‘์˜ ์กฐ๊ฑด์„ 100๊ฑด ๋งŒ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  1. ์ฟผ๋ฆฌ ํ”Œ๋žœ : ๊ฒ€์ƒ‰ ์กฐ๊ฑด์˜ query explain ์ •๋ณด๋ฅผ ๋‹ค์ด์–ผ๋กœ๊ทธ ํ™”๋ฉด์„ ์˜คํ”ˆํ•ฉ๋‹ˆ๋‹ค.
  • ์„œ๋ฒ„ ๋ฉ”์‹œ์ง€ : ๊ฒ€์ƒ‰ ์ค‘์— ์„œ๋ฒ„์—์„œ ๋ฐœ์ƒํ•œ ๋ฉ”์‹œ์ง€ ๋‹ค์ด์–ผ๋กœ๊ทธ ํ™”๋ฉด์„ ์˜คํ”ˆํ•ฉ๋‹ˆ๋‹ค.
  • ๊ฒ€์ƒ‰ : ๊ฒ€์ƒ‰์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
  1. ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  • Tree View : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ Tree ํ˜•ํƒœ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. Valueํด๋ฆญํ•˜์—ฌ ๊ฐ’์„ ์ˆ˜์ • ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜๋ฉด JSONํ˜•์‹์œผ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • Table View : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ Table ํ˜•ํƒœ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜๋ฉด TREEํ˜•์‹์œผ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • Tadpole Message : ๊ฒ€์ƒ‰ ์‹คํŒจ์‹œ ์ •๋ณด๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  1. ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ์— ๋”ฐ๋ฅธ ๋ช…๋ น์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

GridFS ๊ธฐ๋Šฅ

GridFS์€ ๋ชฝ๊ณ ๋””๋น„์—์„œ ํŒŒ์ผ์„ ์˜ฌ๋ฆฌ๊ฑฐ๋‚˜ ๋‚ด๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

mongodb  gridfs

  1. bucket : ๊ฒ€์ƒ‰ ํ•  bucket ์ด๋ฆ„
  2. File Name : ๊ฒ€์ƒ‰ ํ•  ํŒŒ์ผ ์ด๋ฆ„
  3. Skip : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ skip ์ˆ˜
  4. Limit : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ Limit ์ˆ˜
  5. Search Button : ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ
  6. Insert Button : ์ž…๋ ฅ ๋‹ค์ด์–ผ๋กœ๊ทธ
  7. Delete Button : file ์„ ํƒ ํ›„ ์‚ญ์ œ ๋ฒ„ํŠผ
  8. Download Button : file download

Insert ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ™”๋ฉด์ด ์˜คํ”ˆ ๋ฉ๋‹ˆ๋‹ค.

gridfa insert

  1. Bucket Name : ์ €์žฅ ํ•  bucket ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  2. Select File ๋ฒ„ํŠผ : ์—…๋กœ๋“œ ํ•  ํŒŒ์ผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. Upload ๋ฒ„ํŠผ : Select File์—์„œ ์„ ํƒํ•œ ํŒŒ์ผ์„ ์—…๋กœ๋“œ ํ•ฉ๋‹ˆ๋‹ค.
  4. OK ๋ฒ„ํŠผ : ์ €์žฅ ํ•ฉ๋‹ˆ๋‹ค.

Profiling

๋ชฝ๊ณ ๋””๋น„๋Š” ์‹คํ–‰ํ•œ ์งˆ์˜๋ฅผ ํ”„๋กœํŒŒ์ผ ํ•˜๋Š” ๊ธฐ๋Šฅ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

profiling

  1. Start Profiling ๋ฒ„ํŠผ : ๋ชฝ๊ณ ๋””๋น„์˜ ํ”„๋กœํŒŒ์ผ์„ ํ•œ๋ฒˆ๋„ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด ํด๋ฆญํ•˜์—ฌ ์ฟผ๋ฆฌ์˜ ํ”„๋กœํŒŒ์ผ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
  2. Stop Profiling ๋ฒ„ํŠผ : ๋ชฝ๊ณ ๋””๋น„์˜ ํ”„๋กœํŒŒ์ผ์„ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.
  3. Remove Profile Data ๋ฒ„ํŠผ : ํ”„๋กœํŒŒ์ผ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.
  4. Display ํ…์ŠคํŠธ : ํ™”๋ฉด ๊ฐฑ์‹  ์ฃผ๊ธฐ
  5. Great then(millis) ํ…์ŠคํŠธ : ์ฟผ๋ฆฌ ์ˆ˜ํ–‰ ์†๋„
  6. Limit ํ…์ŠคํŠธ : ์ฟผ๋ฆฌ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํ•œ๋„
  7. Start Refresh : Great then, limit ์กฐ๊ฑด์œผ๋กœ ๊ฒ€์ƒ‰์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
  8. Stop Refresh : ๊ฒ€์ƒ‰์„ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.

Query๊ฐ€ ์žˆ๋Š” ๊ฒ€์ƒ‰ ์กฐ๊ฑด์˜ ๊ฒฝ์šฐ ์ฟผ๋ฆฌ๋ฅผ ํŠœ๋‹ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŠœ๋‹์ด ํ•„์š”ํ•œ ํ–‰์„ ๋”๋ธ” ํด๋ฆญํ•˜๊ฑฐ๋‚˜, Show Detail ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ํŠœ๋‹ ํ™”๋ฉด์ด ์˜คํ”ˆ ๋ฉ๋‹ˆ๋‹ค.

query tuning

ERD

๋ชฝ๊ณ ๋””๋น„์˜ ์ปฌ๋ž™์…˜ ์ •๋ณด๋ฅผ ์ฝ์–ด์„œ ๋‹ค์ด์–ด๊ทธ๋žจ ํ˜•ํƒœ๋กœ ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค. Connection Manager์—์„œ All Table ERD๋ฅผ ํด๋ฆญํ•˜๋ฉด, ๋””๋น„์˜ ๋ชจ๋“  Collection ๋ฅผ diagram์œผ๋กœ ํ‘œํ˜„ ํ•ฉ๋‹ˆ๋‹ค. Create ERD Diagram์„ ํด๋ฆญํ•˜๋ฉด Object Explorer์—์„œ ์‚ฌ์šฉ์ž๊ฐ€ ์›ํ•˜๋Š” Collection๋งŒ ์ถœ๋ ฅ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

mongodb erd

Import

์˜ฌ์ฑ™์ด์— ์—ฐ๊ฒฐ๋œ ๋””๋น„์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ชฝ๊ณ ๋””๋น„๋กœ Importํ•˜๋Š” ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค. ํ…Œ์ด๋ธ”์˜ ์ „์ฒด ํ˜น์€ ์ฟผ๋ฆฌ๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ๋ชฝ๊ณ ๋””๋น„์— ๋ฐ์ดํ„ฐ๋ฅผ importํ•ฉ๋‹ˆ๋‹ค.

ํ…Œ์ด๋ธ” ๋ฐ์ดํ„ฐ๋Š” ๊ฐ€์ ธ์˜ฌ ๋•Œ๋Š” RDB์˜ ํ…Œ์ด๋ธ” ๋ช…์„ ๋ชฝ๊ณ ๋””๋น„ ์—์„œ๋Š” Collection ๋ช…์œผ๋กœ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

import-table

์ฟผ๋ฆฌ ์ •๋ณด๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ž„ํฌํŠธ ํ•ฉ๋‹ˆ๋‹ค

import-query

Session List

  • MariaDB, MySQL์€ Session List๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

session-list

Session List๋Š” DB์—์„œ ์‹คํ–‰ ์ค‘์ธ Session ๋ชฉ๋ก์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์žฅ์‹œ๊ฐ„ ์‹คํ–‰ ์ค‘์ธ ์ฟผ๋ฆฌ๋‚˜ ๋น„์ •์ƒ์ ์ธ ์ฟผ๋ฆฌ๋ฅผ ์ข…๋ฃŒ ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. Session List์—์„œ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ๋ชจ์•„ ๋†“์•˜์Šต๋‹ˆ๋‹ค.
  2. ํ˜„์žฌ์‹คํ–‰ ์ค‘์ธ ์ฟผ๋ฆฌ ๋ชฉ๋ก์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  3. โ‘ก๋ฒˆ์˜ ์ฟผ๋ฆฌ๋ฅผ ์„ ํƒํ•˜๋ฉด, ์–ด๋–ค ์ฟผ๋ฆฌ๊ฐ€ ์‹คํ–‰ ์ค‘์ธ์ง€ ์‹ค์ œ SQL ๋ฌธ์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

User Management

๊ทธ๋ฃน์— ์‚ฌ์šฉ์ž ๋ฆฌ์ŠคํŠธ์™€, DB ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ด€๋ฆฌํ•˜๋ฉฐ ์‚ฌ์šฉ์ž๋ฅผ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜, ์‚ฌ์šฉ์ค‘์ง€ ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ˜น์€, ์‚ฌ์šฉ์ž๊ฐ€ ์‹คํ–‰ ํ–ˆ๋˜ ์ฟผ๋ฆฌ๋ชฉ๋ก์„ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ์ด ๊ธฐ๋Šฅ์€ ๊ด€๋ฆฌ์ž์™€ DBA๋งŒ ์‚ฌ์šฉ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

UserManagement

์ „์ฒด ์‚ฌ์šฉ์ž ๋ฆฌ์ŠคํŠธ๊ฐ€ ํ‘œ์‹œ๋˜๋ฉฐ ์‚ฌ์šฉ์ž๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜๋ฉด 'Executed SQL Management' ํ™”๋ฉด์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ด ํ™”๋ฉด์€ ์‚ฌ์šฉ์ž๊ฐ€ ์‹คํ–‰ํ–ˆ๋˜ ์ฟผ๋ฆฌ๋ฅผ ๋‹ค์‹œ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.