Cookie Preferences

We use cookies to enhance your experience. Choose your preference for cookie usage.

Essential cookies are required for basic functionality. Additional cookies help us improve our service and provide analytics.

View third-party services
  • Google Analytics: Website traffic analysis and conversion tracking
  • RudderStack: Analysis of user interactions with the website
  • Microsoft Clarity: User behavior analysis & session recordings
  • Facebook Pixel: Marketing analysis of user activity
Dev ToolsGitHubTest topic C 26_ RTest topic C 28_ RTest topic C 29 R_Test topic C 30_ RTest topic C 31_ RTest topic B 31_C 37

A 37

We've created this lesson for you. Now you can improve and extend it!
To add more steps, press the blue "Plus" button.
To save your changes, press the "Save changes" button at the bottom of the page.

Good Luck!
Stepik Team.

Tables:

1:

Anonymous User Accountant Administrator
POST api/auth/signup + + + +
POST api/auth/changepass + + +
GET api/empl/payment - + + -
POST api/acct/payments - - + -
PUT api/acct/payments - - + -
GET api/admin/user - - - +
DELETE api/admin/user - - - +
PUT api/admin/user/role - - - +

2:

Go vs Java
Go Java
   package main

func main() {
	a,b,c := 1,2,3 // a,b,c have type int
}

public class Main {
  public static void main(String[] args) {
    Integer a = 1;
    Integer b = 2;
    Integer c = 3;
  }
}

3:

Data Model:

Mongo DB RDB

Different models for data storage with dynamic schemas, such as "key-value", documents, graphs, wide columns, etc. Storage models are optimized for higher capacity and scalability.

This approach provides more flexibility for data upload.

Data is being normalized and transformed into tables, consisting of rows and columns. All elements, including indexes and table-relations, have a predefined schema.

Such a structure secures integrity of linked data and table relations.

Data Representation:

Mongo DB RDB
Supports JSON with key-value matches for each record:
{
  "First_name": "Helen",
  "Last_name": "Taylor",
  "Id_card": 123,
  "Status": "Married"
}

Data is stored as a record in a row

First_name

Last_name

Id_card

Helen

Taylor

123

Data Accessibility/API:

Mongo DB RDB

Object-oriented API allows developers to record or withdraw data structures. By using key sections of applications, users can implement search by "key-value" pairs, sets of columns or by partly structured documents, containing serial objects and application attributes.

MongoDb uses MQL(Mongo Query language) for data extraction.

Data selection:

db.find.personal_data()

Data insertion:

db.personal_data.insert(
{person_id:'3', 
 Last_name:'Taylor', 
 status:'Married'
})

Data update:

db.personal_data.update(
{person_id::{$eq:3}},
{$set{ id_card:'135'}},
{multi:true})

Requests for data record and selection are made using SQL. Those requests are analyzed and processed by RBD.

Data selection:

SELECT * FROM personal_data;

Data insertion:

INSERT
INTO personal_data 
(First_name,
  Last_name,
  id_card,Status) 
VALUES 
('Helen',
 'Taylor',
 '123',
 'Married');

Data update:

UPDATE personal_data 
SET id_card = '135' 
WHERE person_id =3;

Scalability and replication:

Mongo DB RDB

Fits better for Horizontal scaling (scaling out). MongoDB is considered to be more scalable than conventional RDBMS. Most NoSQL systems, including MongoDB, are capable of storing your database on multiple machines at the same time while maintaining high-speed performance. This DB has in-built replication support and sharding(a method for distributing data across multiple machines).

MongoDB is a universal DB that ensures stable productivity, wherever you want to get it. At the same time, its requirements are relatively low, which allows it to run on powerful servers, virtual machines, and cloud services.

Implies Vertical scaling (scaling up). Relational databases typically scale by increasing the computational power of the hardware or adding separate copies for read workloads. Performance depends on the disk subsystem. Optimization of queries, indexes and table structure is usually required for maximum performance.

ACID properties:

Mongo DB RDB

It centers around the CAP theorem (Consistency, Availability, and Partition). NoSQL databases often offer a trade-off by relaxing the strict ACID property requirements in favor of a more flexible data model that can scale out. This makes NoSQL a great choice for high throughput, low latency use cases that need to scale out beyond a single instance.

It centers around ACID properties (Atomicity, Consistency, Isolation, and Durability). Atomicity means that a transaction should be either fully completed or not completed at all. Consistency means that as soon as the transaction ends, the data must conform to the database schema. Isolation requires concurrent transactions to run separately from each other.Reliability refers to the ability to recover to the last saved state after an unexpected system failure or power outage


4:

Mongo DB

RDB

Data Model

Different models for data storage with dynamic schemas, such as "key-value", documents, graphs, wide columns, etc. Storage models are optimized for higher capacity and scalability.

This approach provides more flexibility for data upload.

Data is being normalized and transformed into tables, consisting of rows and columns. All elements, including indexes and table-relations, have a predefined schema.

Such a structure secures integrity of linked data and table relations.

Data Representation

Supports JSON with key-value matches for each record:

{
  "First_name": "Helen",
  "Last_name": "Taylor",
  "Id_card": 123,
  "Status": "Married"
}

Data is stored as a record in a row

First_name

Last_name

Id_card

Status

Helen

Taylor

123

Married

Data Accessibility/API

Object-oriented API allows developers to record or withdraw data structures. By using key sections of applications, users can implement search by "key-value" pairs, sets of columns or by partly structured documents, containing serial objects and application attributes.

MongoDb uses MQL(Mongo Query language) for data extraction.

Data selection:

db.find.personal_data()

Data insertion:

db.personal_data.insert({person_id:'3', Last_name:'Taylor', status:'Married'})

Data update:

db.personal_data.update({person_id::{$eq:3}},{$set{ id_card:'135'}},{multi:true})

Requests for data record and selection are made using SQL. Those requests are analyzed and processed by RBD.

Data selection:

SELECT * FROM personal_data;

Data insertion:

INSERT INTO personal_data (First_name, Last_name, id_card, Status) 
VALUES ('Helen', 'Taylor', '123', 'Married');

Data update:

UPDATE personal_data SET id_card = '135' WHERE person_id =3;

Scalability and replication

Fits better for Horizontal scaling (scaling out). MongoDB is considered to be more scalable than conventional RDBMS. Most NoSQL systems, including MongoDB, are capable of storing your database on multiple machines at the same time while maintaining high-speed performance. This DB has in-built replication support and sharding(a method for distributing data across multiple machines).

MongoDB is a universal DB that ensures stable productivity, wherever you want to get it. At the same time, its requirements are relatively low, which allows it to run on powerful servers, virtual machines, and cloud services.

Implies Vertical scaling (scaling up).

Relational databases typically scale by increasing the computational power of the hardware or adding separate copies for read workloads.

Performance depends on the disk subsystem. Optimization of queries, indexes and table structure is usually required for maximum performance.

ACID properties

It centers around the CAP theorem (Consistency, Availability, and Partition).

NoSQL databases often offer a trade-off by relaxing the strict ACID property requirements in favor of a more flexible data model that can scale out. This makes NoSQL a great choice for high throughput, low latency use cases that need to scale out beyond a single instance.

It centers around ACID properties (Atomicity, Consistency, Isolation, and Durability).

Atomicity means that a transaction should be either fully completed or not completed at all.

Consistency means that as soon as the transaction ends, the data must conform to the database schema.

Isolation requires concurrent transactions to run separately from each other.

Reliability refers to the ability to recover to the last saved state after an unexpected system failure or power outage.

asdf

Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd Abc abc abcd
11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111 11111 1111
abcddddddddddddddddddddabcdddddddddddddddddddd abcddddddddddddddddddddabcdddddddddddddddddddd abcddddddddddddddddddddabcdddddddddddddddddddd

t2:

The and operator.

a b a and b
truthy truthy b
truthy falsy b
falsy truthy a
falsy falsy a

The or operator.

a b a or b
truthy truthy a
truthy falsy a
falsy truthy b
falsy falsy b

The not operator.

a not a
truthy False
falsy True

Now we can implement the print_list() function in one line:

How did you like the theory?
Report a typo