Over a million developers have joined DZone.

MongoDB Administration Checklist for MySQL DBAs

If you are MySQL DBA, starting MongoDB administration is not always an easy transition. This post provides a checklist for MongoDB administrators who are familiar with MySQL.

· Database Zone

Learn NoSQL for free with hands-on sample code, example queries, tutorials, and more.  Brought to you in partnership with Couchbase.

In this blog, I discuss a MongoDB administration checklist designed to help MySQL DBAs.

If you are MySQL DBA, starting MongoDB administration is not always an easy transition. Although most of the concepts and even implementation are similar, the commands are different. The following table outlines the typical MySQL concepts and DBA tasks (on the left) to corresponding MongoDB ones (on the right). If you happen to be a MongoDB DBA and want to learn MySQL administration, you can use the same table looking from right to left.

I’ve also created a webinar, MongoDB administration for MySQL DBA, that explains the above concepts. You can download the slides to use as a reference.

Don’t forget about our upcoming event Community Open House for MongoDB in New York, June 30, 2016. There will be technical presentations and sessions from key members of the MongoDB open source community. This event is free of charge and open to all.

Architecture: Basic Concepts

Replication:
MySQL_MongoDB_replication

Sharding:

MySQL_MongoDB_sharding

Day-to-day Operations
 

MySQL: SELECT

select*from zips limit1G

country_code:US

postal_code:34050

place_name:FPO

admin_name1:

admin_code1:AA

admin_name2:Erie

admin_code2:029

admin_name3:

admin_code3:

latitude:41.03750000

longitude:-111.67890000

accuracy:

1row inset(0.00sec)

MongoDB: FIND


MongoDB shell version:3.0.8

connecting to:zips

>db.zips.find().limit(1).pretty()

"_id":"01001",

"city":"AGAWAM",

"loc":[

-72.622739,

42.070206

"pop":15338,

"state":"MA"


MongoDB:

/etc/mongod.conf

# Where and how to store data.

storage:

dbPath:/datawt

journal:

enabled:true

engine:wiredTiger

...

/usr/bin/mongod-f/etc/mongod.conf


mlogvis_example

MySQL 5.7: GIS

SELECT osm_id,name,

round(st_distance_sphere(shape,

st_geomfromtext(

'POINT (-78.9064543 35.9975194)',1)

),2)asdist,

st_astext(shape)

FROM points_new

WHERE 

st_within(shape,

create_envelope(@lat,@lon,10))

and(other_tags 

like'%"amenity"=>"cafe"%'

orother_tags 

like'%"amenity"=>"restaurant"%')

andname isnotnull

ORDER BY dist asc LIMIT10;


  • Backup: mysqldump -A > dump.sql, restore: mysql < dump.sql
  • Stop replication slave, copy files
  • Percona XtraBackup

MongoDB: Backup

  • Backup: mongodump, restore mongorestore
  • Stop replica, copy files
  • Percona HotBackup for TokuMX only

The Getting Started with NoSQL Guide will get you hands-on with NoSQL in minutes with no coding needed. Brought to you in partnership with Couchbase.

Topics:
dba ,administration ,mysql ,mysql administration ,mongodb ,checklist

Published at DZone with permission of Alexander Rubin, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}