2022.12.05(월) ~ 2022.12.08(목)
4주차동안에는 Node.js와 express.js 프레임워크에 amazon RDS를 사용해 SQL DB를 붙이고, jwt 토큰을 사용하여 사용자 인증 기능까지 붙여보았다.
- [4주차] [20221205] Joi validation & Sequelize를 이용한 mySQL 설정
- [4주차] [20221206] thunder client에서 req.cookies 넘기기
- [4주차] [20221207] express에서 Router : Middleware와 Router
- [4주차] [20221208] node.js의 require() 작동 방식
- [TIL] [4주차] [20221208] 4주차 회고 - 코드리뷰와 리팩토링 / package.json, EC2 set locale, express sanitizer
GitHub - jn33-dev/hanghae-week4
Contribute to jn33-dev/hanghae-week4 development by creating an account on GitHub.
github.com
개인 프로젝트를 진행하는 5일간 가장 갑진 성과는 코드리팩토링인것 같다. 기술 매니저님의 코드리뷰를 통해 폴더 구조 구성과 기능 단위로 파일을 관리하는 법, 그리고 좀 더 가독성이 좋고 협업하기 좋은 코드를 짜는 법 등을 배울 수 있었다.
2022.12.09(금) ~ 2022.12.10(토)
금요일부터는 다시 5주차가 시작되었다.
5주차에서는 Node.js 심화과정으로, socket.io, OOP, 3 layer architecture, TDD 등을 주제로 다룬다.
심화 과정에서는 개인이 아닌 팀으로, 다른 백엔드 개발자와 협업을 하는 방법을 배울 수 있도록, 팀 과제가 주어졌다.
git, coding convention, layered architecture 및 통합 테스트까지, 실제 다른 백엔드 개발자와 함게 협업을 할 때 필요한 기술을 익히고 다듬는주차이다.
개인적으로는, 아키텍쳐와 소켓.io가 정말 재미있고, 이제 내일부터 팀원들과 과제를 시작하는데, 같이 협업하는 과정도 너무 기대가 된다 :) (하고 싶은 것들이 너무너무 많다! 주어진 과제를 잘 완수하고, TypeScript로 마이그레이션도 해보고 싶은데, 시간이 될지 모르겠다ㅠㅠ)
- [TIL] [5주차] [20221209] object literal에서 spread operator
- [5주차] soket.io 경험하기
- [TIL] [20221210] JavaScript, 프로토타입 기반(prototype-base) 객체지향(Object Oriented Programming)
RDBMS (Relational DataBase Managemet System) vs Non-Relational Databases
data tyeps
- Operational data : used for day-to-day transactions and needs to be fresh, captured in real-time using Online Transaction Processing (OLTP) systems
- Analytical data : used by businesses to find insights about customer behavior, product performance, and forecasting, stored in OLAP (Online Analytical Processing) systems, warehouses, or data lakes.
Relational database
Relational databse, often called as SQL database, storing data into tables, sharing information between tables to form a relationship. Inside table, there are columns and rows for :
- columns : define the information being stored
- rows : store actual data
SQL (structured Query Language) is used to interact with these databases
- ORM (Object Relational Mapping), such as sequelize (for JS) is often being used instead of raw SQL queries to perform CRUD operation
Advantages of relational databases
- ACID (Atomicity, Consistency, Isolation, and Durability) compliance : a standard that guarantees the reliablility of database transaction. If any of them fail, the DB will remain in the state it was before the transction was attempted
- Data accuracy : using primary - foreign key ensures no duplication of information -> enforce data accuracy
- Normalization : through normaization, data anomalies are reduced or eliminated -> reduces storage costs
- Simplicity : wide variety of tools and resources have been developed to help get started and interact with relational databases
Disadvantages of realtional databases
- Scalability : RDBMS is intended to run on a single machine, which leads to vertical scaling when needed -> very expensive to scale up
- Flexibility : schema is rigid -> making changes to the structure of the data is very complex and almost impossible. tho use the RDBMS, the shema is fiexed at the start
- Performance : The performance of the database is tightly linked to the complexity of the tables (the number of them, as well as the amount of data in each table). As this increases, the time taken to perform queries increases too
Non-relational database
Non-relational database, also known as NoSQL (Not only SQL) if for any kind of database that doesn't use the concept of relational database.
Non-relational databases have been designed with the cloud in mind, making them great at horizontal scaling.
Types of non-relational databse
- Document databases : stores data in JSON-like structure
- no need to reference multiple documents or collections to view data of a single customer
- The documents map nicely to objects in code in object-oriented programming languages, making it much easier to work with
- no schema, providing more flexibility, when the structure has to be changed
- Documents are considered individual units, which means they can be distributed across multiple servers
- Document databases are also highly scalable
- Key-value databases : storing information in key and value
- used for simple data -> unique key ensures fast access to its value (time complexity of key-value search is O(1))
- simplicity restricts the type of use cases, can't support complex data requirements
- Graph databases : They use a structure of elements called nodes that store data, and edges between them contain attributes about the relationship.
- relationships are defined in the edges, which makes searches related to these relationships naturally fast
- flexible because new nodes and edges can be added easily
- not very good for querying the whole database
- no standard language for querying -> moving between different database types comes with a learing requirement
- Wide-column dtatbases : similar to relational databases, store data in tables, columns, and rows
- the names and formatting of the columns don’t have to match in each row -> can even be stored across multiple servers
- considered two-dimensional key-value stores because they use multi-dimensional mapping to reference data by row and column.
- benefit of being flexible -> queries are fast, good at handling "big dta" and unstructured data
- compared to relational databases, wide-column databases are much slower when handling transactions
- because columns group together similar attributes, information is store in separate files -> transactions have to carried out across muliple files
Relational Vs. Non-Relational Databases | MongoDB
Learn about different types of databases and things to consider when choosing what database technology to use in your project.
www.mongodb.com