Shali’s Tech Blog Home.

THIRD POST: JS, VERSION CONTROL, NoSQL

  • Javascript / JS

Today i’m going to talk about Javascript, which is one of most popular ( 67.8% of developers employing in 2019) programming language in present days. Facebook, YouTube, Wikipedia, Amazon, LinkedIn and many more popular websites build with javascript along with other programming languages.

  • What is Javascript
  1. High level, lightweight
  2. Dynamic
  3. Client-side scripting language
  4. interpreted programming language with object-oriented capabilities

In addition to basic programming concepts (Variables, Data types, Loops, Conditionals, Built-in methods, Functions) there are some advanced concepts coming with javascript.

  1. DOM(Document Object Model) selection, manipulation
  2. OOP(prototypes, objects & classes)
  3. Async Javascript
    • Callbacks
    • Promises
    • Async / Await
  • OOP(prototypes, objects & classes)

With JS ES6 release which was in 2015, we can add classes, methods, objects and prototypes.

  • Callbacks.

A callback is a function that is to be executed after another function has finished executing.

In here it will only call getPost() method since it happens earlier(1 sec). createPost() will never happens. We can call both methods with Callbacks after 2 secs.

  • Promises.

Multiple callback functions lead to unmanageable code that produced something known as callback hell. To overcome that, JavaScript introduced promises in ES6. A promise can either be fulfilled with a value or rejected(error).

We can easily handle multiple promises with Promise.all()

  • Async / Await.

Async / Await are extensions of promises. We can easily handle earlier promises using this. Async functions enable us to write promise based code as if it were synchronous. The await operator is used to wait for a Promise.

  • VERSION CONTROL SYSTEMS.

Version Control Systems is a software tools that helps us to manage changes to source code over time. It keeps track of modification to the code in a special kind of database. If a mistake is made, developers can turn back and compare earlier versions of the code to fix the mistake. Also we can wok on individual section of a team project without effecting work of other team members at the same time. There are many Version Control Systems,

  1. GitHub
  2. GitLab
  3. Mercurial
  4. Bitbucket
  5. Apache Subversion
  • Git & GitHub
  • Git
    • Manage source code history
    • Local
  • GitHub
    • Hosting & collaboration provider
    • Web based
  • Some Useful Commands.

  • NoSQL(Not Only SQL)

When it leads to enterprise software development, people wanted a more flexible database design rather than traditional relational databases. Result of that NoSQL databases take part of enterprise software development with capability of storing multiple types of data. It become more reliable with cloud, big data and high-volume web and mobile applications etc. There are 4 different types of NoSQL databases,

  1. Document Stores – MongoDB, Couchbase
  2. Graph Databases – Neo4j, VertexDB
  3. Key-Value Stores – Amazon DynamoDB, Apache Cassandra
  4. Columnar Databases – HBase, Vertica

Relational database satisfy ACID properties,

  1. Atomicity – All operations in a transaction succeed or every operation is rolled back
  2. Consistency – A transaction cannot leave the database in an inconsistent state
  3. Isolated – Transactions cannot interfere with each other
  4. Durable – Completed transactions persist, even when servers failures

NoSQL database satisfy BASE properties, which is more suitable for these days.

  1. Basically Available – System guarantee availability, in terms of the CAP theorem
  2. Soft-state –  State of the system may change over time, even without input
  3. Eventual consistency – System will become consistent over time, given that the system doesn’t receive input during that time
  • MongoDB

MongoDB is an open source DBMS which supports different types of data, which is known for high performance, scalability, and availability. It is built by using C++ language and based on a document-oriented database model. The most widely used NoSQL database in the world.

Structure,

  • Mongod – DB instance
  • Mongos – Sharding processes
  • Mongo – Interactive shell(A client)

  • Some Useful Commands.

-Prabath Shalitha (2020 Feb 21)

Design a site like this with WordPress.com
Get started