ABDMS-UNIT 2 AND UNIT 5 NOTES
ABDMS-UNIT 2 AND UNIT 5 NOTES
ABDMS-UNIT 2 AND UNIT 5 NOTES
1) Atomicity-The term atomicity defines that the data remains atomic. It means if
any operation is performed on the data, either it should be performed or executed
completely or should not be executed at all. It further means that the operation should
not break in between or execute partially. In the case of executing operations on the
transaction, the operation should be completely executed and not partially
In the above diagram, it can be seen that after crediting $10, the amount is still $100 in
account B. So, it is not an atomic transaction
The below image shows that both debit and credit operations are done successfully. Thus the
transaction is atomic.
2) Consistency-The word consistency means that the value should remain preserved
always. In DBMS, the integrity of the data should be maintained, which means if a change in
the database is made, it should remain preserved always. In the case of transactions, the
integrity of the data is very essential so that the database remains consistent before and after
the transaction. The data should always be correct.
In the above figure, there are three accounts, A, B, and C, where A is making a
transaction T one by one to both B & C. There are two operations that take place, i.e.,
Debit and Credit. Account A firstly debits $50 to account B, and the amount in account
A is read $300 by B before the transaction. After the successful transaction T, the
available amount in B becomes $150. Now, A debits $20 to account C, and that time,
the value read by C is $250 (that is correct as a debit of $50 has been successfully
done to B). The debit and credit operation from account A to C has been done
successfully. We can see that the transaction is done successfully, and the value is
also read correctly. Thus, the data is consistent. In case the value read by B and C is
$300, which means that data is inconsistent because when the debit operation
executes, it will not be consistent.
3) Isolation-The term 'isolation' means separation. In DBMS, Isolation is the property
of a database where no data should affect the other one and may occur concurrently.
In short, the operation on one database should begin when the operation on the first
database gets complete. It means if two operations are being performed on two
different databases, they may not affect the value of one another. In the case of
transactions, when two or more transactions occur simultaneously, the consistency
should remain maintained. Any changes that occur in any particular transaction will
not be seen by other transactions until the change is not committed in the memory.
Example: If two operations are concurrently running on two different accounts, then
the value of both accounts should not get affected. The value should remain
persistent. As you can see in the below diagram, account A is making T1 and T2
transactions to account B and C, but both are executing independently without
affecting each other. It is known as Isolation.
UNIT 5
NoSQL
NoSQL is a type of database management system (DBMS) that is designed to handle
and store large volumes of unstructured and semi-structured data. Unlike traditional
relational databases that use tables with pre-defined schemas to store data, NoSQL
databases use flexible data models that can adapt to changes in data structures and
are capable of scaling horizontally to handle growing amounts of data.
The term NoSQL originally referred to “non-SQL” or “non-relational” databases, but the
term has since evolved to mean “not only SQL,” as NoSQL databases have expanded
to include a wide range of different database architectures and data models.
Four Types of NoSQL Databases
1. Document databases: These databases store data as semi-structured
documents, such as JSON or XML, and can be queried using document-oriented
query languages.
2. Key-value stores: These databases store data as key-value pairs, and are
optimized for simple and fast read/write operations.
3. Column-family stores: These databases store data as column families, which are
sets of columns that are treated as a single entity. They are optimized for fast
and efficient querying of large amounts of data.
4. Graph databases: These databases store data as nodes and edges, and are
designed to handle complex relationships between data.
Disadvantages of MongoDB
It uses high memory for data storage.
You are not allowed to store more than 16MB data in the documents.
The nesting of data in BSON is also limited you are not allowed to nest data
more than 100 levels.
JSON
JSON stands for JavaScript Object Notation
• JSON is a lightweight data-interchange format
• JSON is plain text written in JavaScript object notation
• JSON is used to send data between computers • JSON is language independent
Features of JSON
Easy to understand: JSON is easy to read and write.
Format: It is a text-based interchange format. It can store any kind of data in an array
of video, audio, and image anything that you required.
Support: It is light-weighted and supported by almost every language and OS. It has
a wide range of support for the browsers approx each browser supported by JSON.
Dependency: It is an Independent language that is text-based. It is much faster
compared to other text-based structured data.
JSON Syntax Rules: Data is in name/value pairs and they are separated by commas.
It uses curly brackets to hold the objects and square brackets to hold the arrays.
Advantages of JSON:
JSON stores all the data in an array so data transfer makes easier. That’s why
JSON is the best for sharing data of any size even audio, video, etc.
Its syntax is very easy to use. Its syntax is very small and light-weighted that’s
the reason that it executes and response in a faster way.
JSON has a wide range for the browser support compatibility with the operating
systems, it doesn’t require much effort to make it all browser compatible.
On the server-side parsing the most important part that developers want, if the
parsing will be fast on the server side then the user can get the fast response,
so in this case JSON server-side parsing is the strong point compare tot others.
Disadvantages of JSON:
The main disadvantage for JSON is that there is no error handling in JSON, if
there was a slight mistake in the JSON script then you will not get the structured
data.
JSON becomes quite dangerous when you used it with some unauthorized
browsers. Like JSON service return a JSON file wrapped in a function call that has
to be executed by the browsers if the browsers are unauthorized then your data
can be hacked.
JSON has limited supported tools that we can use during JSON development.
FIREBASE
Firebase is the platform developed by Google for building and managing web and
mobile applications. It can provide developers with various tools and services that are
designed to simplify the process of app development. It allows them to focus more on
creating features and less on managing the infrastructure.
Firebase is the Backend-as-a-Service (BaaS) platform which is developed by Google
and provides a variety of tools and services for building web and mobile applications.
It simplifies the backend development tasks like database management,
authentication, file storage, and real-time data syncing. Allows the developers to focus
on building high-quality applications. The Firebase integrates well with other Google
Cloud products and offers cross-platform support.
Advantages of Firebase
Simplified App Development: Firebase abstracts much of the complexity that
associted with backend services such as authentication, database and the cloud
functions which allow developers to focus on creating front-end and the
business logic of apps.
Real-time Data Synchronization: With the real-time database and the
Firestore, Firebase make it easier to build the apps that require live updates.
Cross-Platform Support: Firebase offer the strong support for cross-platform
apps that includes Android, iOS and Web. The unified API across all platforms
ensures that the developers do not have to write seperate codebases for each
the platform when using Firebase Services.
Security: The Firebase provides built-in security rules and the policies to
protect all data accesses and prevent the unauthorized usage.
Scalabilty: The Firebase automatically scales with our app's growth. Whether
we have the small user base or millions of users. Firebase can handle the load
without manual intervention.