Wednesday, February 20, 2019

Basic MongoDB(NoSQL) Part 01: Press Room

MongoDB Part 01: Press Room


>   Inspiration   <
>     Overview     <
>   Advantages   <



Inspiration

    4 years ago(2013), I worked for my Swedish ex-CTO, Mats Engstorm, he talked about MariaDB and MongoDB. Currently, I have a good chance to learn about it and I have made a decision to learn MongoDB. Any advice is welcome if any since it's the first time for me. 



Overview 

      MongoDB is C++ based open-source document database. It's cross-platform database and its syntax is pretty much like JSON from my experience. Prerequisite is about fundamental of RDBMS. Once you completed the course you would step up to mediocre level.
       The MongoDB server is like general database. Let's say the server may consist of many databases. 

For example
             a database is gonna insert a document(record or row equivalent) to a collection named 'users' or (table equivalent)

This database has one collection and 3 documents

Example of document:
{
   _id: ObjectId(59488f161edbf45b66e5b8f3)
   title: 'MongoDB Overview', 
   description: 'MongoDB is no sql database',
   by: 'tutorials point',
   url: 'http://www.tutorialspoint.com',
   tags: ['mongodb', 'database', 'NoSQL'],
   likes: 100, 
   comments: [ 
      {
         user:'user1',
         message: 'My first comment',
dateCreated: new Date(2011,1,20,2,15),
like: 0 }, { user:'user2', message: 'My second comments', dateCreated: new Date(2011,1,25,7,45), like: 5 } ] }
     _id: this key is like id in MySQL since it may be automagically generated by the database or manually assign this value. 
       ObjectId(59488f161edbf45b66e5b8f3) : tmpi :4-3-2-3
             59488f16 = timestamp
             1edbf4       = machine id
               5b66           = process id
               e5b8f3        = incremental VALUE


Advantages

      MongoDB is better than RDBMS with these issues:
  1. Schema less
    • MongoDB is a document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another.
  2. Structure of a single object is clear.
  3. No complex joins.
  4. Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL.
  5. Tuning.
  6. Ease of scale-out − MongoDB is easy to scale.
  7. Conversion/mapping of application objects to database objects not needed.
  8. Uses internal memory for storing the (windowed) working set, enabling faster access of data.

       Why Use MongoDB?
  1. Document Oriented Storage − Data is stored in the form of JSON style documents.
  2. Index on any attribute
  3. Replication and high availability
  4. Auto-sharding
  5. Rich queries
  6. Fast in-place updates
  7. Professional support by MongoDB

       Where to Use MongoDB?
  1. Big Data
  2. Content Management and Delivery
  3. Mobile and Social Infrastructure
  4. User Data Management
  5. Data Hub




Reference
You may leave comment to improve it.
Thank you from THAILAND.

No comments:

Android OS: Fundamental Awareness

Thai government single policy     *** IMPORTANT *** Please carefully take a look this post https://chattrawits-security.blogspo...