![Page 2: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/2.jpg)
MONGO DB @ NEOTERIC
![Page 3: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/3.jpg)
Server
INITIALLY (MULTIPLE SERVERS)
Service A (.deb)
Server B
MongoDB (.deb)
Server C
Backup
Service B (.deb)
Service C (.deb)
Database ABC
Server DSome old stuff for monitoring no one
remembers now
![Page 4: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/4.jpg)
![Page 5: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/5.jpg)
VM 1
LATER (CLOUD)
Service A
VM 3,4,5
MongoDB
VM 6
ELK
Database A
Database B
Database CVM 2
Service B
Service C
Amazon S3
![Page 6: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/6.jpg)
![Page 7: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/7.jpg)
NOW (CONTAINERS + SERVICE)
Database Service
Database A
Database B
Database CContainer 3 Service C
Container 1 Service A
Container 2 Service B
![Page 8: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/8.jpg)
![Page 9: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/9.jpg)
HOSTING MONGO DB - OPTIONS
![Page 10: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/10.jpg)
DATABASE HOSTING
own server
server lease
cloud
dockerDatabase-as-a-
service
self hosting cloud platform/serviceDBMShardwareadminmonitoringbackup
DBMSadminmonitoringbackup
DBMS (kind of)
![Page 11: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/11.jpg)
ALL BY MYYYY SELF…<background singing>
![Page 12: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/12.jpg)
SELF-HOSTING: COMPONENTS
database server
monitoring server
storage server
logs & metrics
backup backup
single mongodb server
ELK stack
file storage
![Page 13: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/13.jpg)
SELF-HOSTING: ESTIMATES
1GB 10GB 100GB
database server 150,00 zł 150,00 zł 450,00 zł
1 * monit service (ELK) 150,00 zł 150,00 zł 150,00 zł
1 * backup server 150,00 zł 150,00 zł 150,00 zł
admin 6 000,00 zł 6 000,00 zł 12 000,00 zł
total 6 450,00 zł 6 450,00 zł 12 750,00 zł
![Page 14: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/14.jpg)
SELF-HOSTING: PROS & CONS
CONSPROSusually/sometimes works expensive
requires highly skilled personnel
large backup granularity
scales terribly
poor data safety
lengthy setup & recovery
no API
![Page 15: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/15.jpg)
EVERYONE THINKS THEY'RE GOOGLE
![Page 16: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/16.jpg)
CLOUD: COMPONENTS
VM1 monitoring service
logs & metrics
backup
VM2
VM3
backup
Amazon S3
ELK stackmongodb replica set
durable storage service
![Page 17: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/17.jpg)
CLOUD: ESTIMATES
1GB 10GB 100GB
3 * database VM (DO) 250,00 zł 500,00 zł 1 700,00 zł
1 * monit service (ELK) 150,00 zł 150,00 zł 150,00 zł
backup (Amazon S3) 2,00 zł 20,00 zł 300,00 zł
admin 6 000,00 zł 6 000,00 zł 6 000,00 zł
total 6 402,00 zł 6 670,00 zł 8 150,00 zł
![Page 18: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/18.jpg)
CLOUD: PROS & CONS
CONSPROSscales well requires skilled personnel
large backup granularity
no API for databasegood data safety
lengthy setup & recovery
not suitable for some sensitive data
![Page 19: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/19.jpg)
DELEGATE…
![Page 20: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/20.jpg)
DBAAS: COMPONENTS
DATABASE SERVICE
![Page 21: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/21.jpg)
DBAAS: ESTIMATES
1GB 10GB 100GB
compose.io MongoDB 130,00 zł 850,00 zł 7 700,00 zł
mongodb.com Atlas 260,00 zł 700,00 zł 6 700,00 zł
avg 195,00 zł 775,00 zł 7 200,00 zł
![Page 22: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/22.jpg)
CLOUD: PROS & CONS
CONSPROSscales extremely well not suitable for some
sensitive data
no need for additional admin personal
API for db operations
Includes backup & monitoring
UI is sometimes slow
![Page 23: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/23.jpg)
COMPARISON
![Page 24: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/24.jpg)
MONTLY COST
0
3 500
7 000
10 500
14 000
1GB 10GB 100GB
self-hosted cloud dbaas
you get heavy discounts at this point
extremely hight initial
costyou don’t need
an army for bigger
deployments
16MB = content of „Pride & Prejudice”
![Page 25: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/25.jpg)
SETUP TIME
0
10
20
30
40
SETUP TIME [HOURS]
self-hosted cloud dbaas
![Page 26: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/26.jpg)
BIG PICTURE
![Page 27: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/27.jpg)
DBAAS IS NOT JUST DATABASE
DATABASE SERVICE
API
Alerts
Monitoring
Ops Tools
JenkinsDev Env Deploy Test Env Deploy Prod Env Deploy
1. [delete database]2. create database3. create user
1. backup db2. migrate & test
1. backup db2. migrate
![Page 28: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/28.jpg)
API #1 (CREATE TOKEN)
![Page 29: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/29.jpg)
API #2 (SAVE IT)
Have fun! It’s already revoked ;)
![Page 30: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/30.jpg)
API #2 (SAVE IT)
curl -X GET "https://api.compose.io/deployments/$ACCOUNT/$DEPLOYMENT" \ -H 'Content-Type: application/json' \ -H 'Accept-Version: 2014-06' \ -H "Authorization: Bearer $TOKEN"
Get info about deployment
{ "id":"5679533f06babf0f35000fa5", "name":"development", "current_primary":"lamppost.16.mongolayer.com:10396", "version":"2.6.9", "members":[ "lamppost.16.mongolayer.com:10396", "lamppost.17.mongolayer.com:10368" ], "ignored_members":[
], "allow_multiple_databases":true, "status":"running", "location":"aws:eu-west-1", "databases":[ { "id":"5679533f3cf38a677f00006a", "name":"development", "deprovision_date":null, "status":"running", "deployment_id":"5679533f06babf0f35000fa5", "plan":"mongohq:elastic" } ], "plan":"mongohq:elastic", "type":"mongodb" }
![Page 31: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/31.jpg)
API #2 (SAVE IT)
curl -X POST "https://api.compose.io/deployments/$ACCOUNT/$DEPLOYMENT/mongodb/$DB_NAME/collections" \ -H 'Content-Type: application/json' \ -H 'Accept-Version: 2014-06' \ -H "Authorization: Bearer $TOKEN" \ -d "{\"name\":\"${DB_NAME}_init\"}"
Create DB and collections
{"error":"collection already exists"}
{"ok":1}
![Page 32: Hosting MongoDB & our experience with database as a service](https://reader034.vdocuments.us/reader034/viewer/2022052514/5873bab71a28abbc788b547d/html5/thumbnails/32.jpg)
API #2 (SAVE IT)
curl -X POST "https://api.compose.io/deployments/$ACCOUNT/$DEPLOYMENT/mongodb/$DB_NAME/users" \ -H 'Content-Type: application/json' \ -H 'Accept-Version: 2014-06' \ -H "Authorization: Bearer $COMPOSE_TOKEN" \ -d "{\"username\":\"$DB_USER\",\"password\":\"$DB_PASS\",\"readOnly\":false}"
Create db user
{"ok":1}