+ All Categories
Home > Software > Hosting MongoDB & our experience with database as a service

Hosting MongoDB & our experience with database as a service

Date post: 09-Jan-2017
Category:
Upload: grzegorz-gwozdz
View: 36 times
Download: 2 times
Share this document with a friend
33
HOSTING MONGO DB & OUR EXPERIENCE WITH DBAAS Greg Gwozdz, CTO [email protected] +48 600 306 785
Transcript
Page 1: Hosting MongoDB & our experience with database as a service

HOSTING MONGO DB & OUR EXPERIENCE WITH DBAAS

Greg Gwozdz, [email protected]

+48 600 306 785

Page 2: Hosting MongoDB & our experience with database as a service

MONGO DB @ NEOTERIC

Page 3: Hosting MongoDB & our experience with database as a service

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
Page 5: Hosting MongoDB & our experience with database as a service

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
Page 7: Hosting MongoDB & our experience with database as a service

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
Page 9: Hosting MongoDB & our experience with database as a service

HOSTING MONGO DB - OPTIONS

Page 10: Hosting MongoDB & our experience with database as a service

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

ALL BY MYYYY SELF…<background singing>

Page 12: Hosting MongoDB & our experience with database as a service

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

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

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

EVERYONE THINKS THEY'RE GOOGLE

Page 16: Hosting MongoDB & our experience with database as a service

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

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

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

DELEGATE…

Page 20: Hosting MongoDB & our experience with database as a service

DBAAS: COMPONENTS

DATABASE SERVICE

Page 21: Hosting MongoDB & our experience with database as a service

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

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

COMPARISON

Page 24: Hosting MongoDB & our experience with database as a service

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

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

BIG PICTURE

Page 27: Hosting MongoDB & our experience with database as a service

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

API #1 (CREATE TOKEN)

Page 29: Hosting MongoDB & our experience with database as a service

API #2 (SAVE IT)

Have fun! It’s already revoked ;)

Page 30: Hosting MongoDB & our experience with database as a service

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

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

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}

Page 33: Hosting MongoDB & our experience with database as a service

QUESTIONS?Greg Gwozdz, CTO

[email protected]+48 600 306 785


Recommended