Skip to content

Fundamentals

FullstackCodingGuy edited this page Feb 27, 2024 · 21 revisions

Concepts for building an application

  • Styling: Modern practices for managing CSS.
  • Routing: Plan and implement URL-driven navigation.
  • Loading Data: Strategies for loading and rendering data.
  • Data Mutations: Execute CRUD operations, safely.
  • SEO: Ensure page content gets discovered, organically.
  • Error Handling: Effective strategies, without the ambiguity.

Form

  • Input Validation: Real-time, schema-based user input validation.
  • Accessibility: Making forms usable for everyone.
  • File Uploads: Support more than just text in your forms.
  • Complex Data Structures: Confidently handle the intricacies of nested data.
  • Form Security: Prevent spam, XSS, and other malicious attacks.

Data

  • Database Schema: Craft a robust database architecture with future flexibility.
  • Relationships: Know what and when for one-to-one, one-to-many, many-to-many.
  • Migrations: Seamlessly transition your data.
  • Seeding: Populate initial data for dev and test environments.
  • Query Optimization: Fetch data as efficiently as possible.

Authentication

  • User Preferences: Store settings in the user’s browser.
  • Session Management: Secure data storage done right the first time.
  • Cookie-Based Identification: Identification that follows best practices.
  • Password Storage: Safety beyond just hashing.
  • Password Validation: Security that's without inconvenience.
  • Session Expiration: Auto-logout doesn't have to mean data loss.
  • Permissions: Role-based access control.
  • Verification: Verify user emails, support forgot password, 2FA–the works.
  • Third Party Auth: OAuth, multi-connection, SSO-ready.

Testing

  • Test Automation: Ditch manual test suites for scalable automatic ones.
  • HTTP Mocks: Simulate server interactions for E2E tests.
  • Authenticated Tests: Testing with user roles in mind.
  • Unit Tests: Properly scoped and thoroughly executed.
  • React Component Testing: Get into the UI specifics.
  • Integration Testing: Strike a productive balance on test scope.

12 Factor Methodology

It talks about development, operation, and scaling.

It is a triangulation on ideal practices for app development, paying particular attention to the dynamics of the organic growth of an app over time, the dynamics of collaboration between developers working on the app’s codebase, and avoiding the cost of software erosion.

I. Codebase One codebase tracked in revision control, many deploys

II. Dependencies Explicitly declare and isolate dependencies

III. Config Store config in the environment

IV. Backing services Treat backing services as attached resources

V. Build, release, run Strictly separate build and run stages

VI. Processes Execute the app as one or more stateless processes

VII. Port binding Export services via port binding

VIII. Concurrency Scale out via the process model

IX. Disposability Maximize robustness with fast startup and graceful shutdown

X. Dev/prod parity Keep development, staging, and production as similar as possible

XI. Logs Treat logs as event streams

XII. Admin processes Run admin/management tasks as one-off processes

API - Application Programming Interface

Status Codes

The response codes for HTTP are divided into five categories:

  • Informational (100-199)
  • Success (200-299)
  • Redirection (300-399)
  • Client Error (400-499)
  • Server Error (500-599)

These codes are defined in RFC 9110. To save you from reading the entire document (which is about 200 pages), here is a summary of the most common ones.


Secure Coding

Authentication

Password, Session, Cookie, Token, JWT, SSO, OAuth

Authorization


Asynchronous Programming

Message Queue


Performance

image

Top 5 common ways to improve API performance.

Result Pagination:

This method is used to optimize large result sets by streaming them back to the client, enhancing service responsiveness and user experience.

Asynchronous Logging:

This approach involves sending logs to a lock-free buffer and returning immediately, rather than dealing with the disk on every call. Logs are periodically flushed to the disk, significantly reducing I/O overhead.

Data Caching:

Frequently accessed data can be stored in a cache to speed up retrieval. Clients check the cache before querying the database, with data storage solutions like Redis offering faster access due to in-memory storage.

Payload Compression:

To reduce data transmission time, requests and responses can be compressed (e.g., using gzip), making the upload and download processes quicker.

Connection Pooling:

This technique involves using a pool of open connections to manage database interaction, which reduces the overhead associated with opening and closing connections each time data needs to be loaded. The pool manages the lifecycle of connections for efficient resource use.

Scaling a system is an iterative process. Iterating on what we have learned in this chapter could get us far. More fine-tuning and new strategies are needed to scale beyond millions of users. For example, you might need to optimize your system and decouple the system to even smaller services. All the techniques learned in this chapter should provide a good foundation to tackle new challenges. To conclude this chapter, we provide a summary of how we scale our system to support millions of users:

  • Keep web tier stateless

  • Build redundancy at every tier

  • Cache data as much as you can

  • Support multiple data centers

  • Host static assets in CDN

  • Scale your data tier by sharding

  • Split tiers into individual services

  • Monitor your system and use automation tools

Caching

The cache tier is a temporary data store layer, much faster than the database. The benefits of having a separate cache tier include better system performance, ability to reduce database workloads, and the ability to scale the cache tier independently.

  • Cache Types (In-memory caching, Distributed caching, Client-side caching)
  • Cache Strategies (Cache-Aside, Write-Through, Write-Behind, Read-Through)
  • Measuring Cache Effectiveness (Calculate the cache hit rate, Analyse cache eviction rate, Monitor data consistency, Determine the right cache expiration time)

More on Caching


Exception Handling

Exception handling is a fundamental and crucial aspect of programming. It's a simple concept that involves managing exceptions that may occur during the execution of a program. These exceptions can cause the program to stop functioning. By handling exceptions, the program can continue to operate or shut down gracefully, preventing abrupt termination.

Suppose you have an exception caused by something like invalid user input, hardware malfunction, network failure, or programming error. How would you handle it?

Exceptions are handled by creating an object known as an "exception object." An exception object contains information about the type of error that occurred and the location of the error in the code. Exceptions can also be explicitly "thrown" by developers, using the 'throw' keyword to indicate a specific error condition in their code.

C# has a built-in mechanism for handling exceptions that occur during program execution. This mechanism allows developers to catch and manage exceptions using a try-catch block. The try block contains the code that may cause an exception, while the catch block specifies how to handle an exception.

When an exception occurs, you can manage it by logging an error message, displaying a user-friendly message, or taking corrective action. If the exception isn't caught, the program may terminate. In this module, you'll implement error handling while building the Langton’s Ant code.


Deployment

image

  • Canary Deployments In software engineering, canary deployment is the practice of making staged releases. We roll out a software update to a small part of the users first, so they may test it and provide feedback. Once the change is accepted, the update is rolled out to the rest of the users.

Benefits of Canary Deployments Why go to the trouble of implementing a canary strategy? The benefits are many:

A/B testing: we can use the canary to do A/B testing. In other words, we present two alternatives to the users and see which gets better reception.

Capacity test: it’s impossible to test the capacity of a large production environment. With canary deployments, capacity tests are built-in. Any performance issues we have in our system will begin to crop up as we slowly migrate the users to the canary.

Feedback: we get invaluable input from real users.

No cold-starts: new systems can take a while to start up. Canary deployments slowly build up momentum to prevent cold-start slowness.

No downtime: like blue-green deployments, a canary deployment doesn’t generate downtime.

Easy rollback: if something goes wrong, we can easily roll back to the previous version.

Docker

Kubernetes / k8s

Branching & Release

image

General Comparison of various tools/libraries/software - Pros, Cons

This is a list of top posts that members of the community have created. These are the posts folks have generally continued coming back to over and over again, so we created this page to make some of these more discoverable. Hopefully you better understand some of the differences here once you've found the guide you need!

Redux vs Context API: When to use them

Declarative vs imperative

Using then() vs Async/Await in JavaScript

Kubernetes Ingress vs Service Mesh

Create react app vs Vite

Callbacks vs Promises

Constructors in Python (init vs __new)

When to Use Server-Side rendering vs Static Generation in Next.js

CSS Modules vs CSS-in-JS. Who wins?

append VS appendChild

Cloud Run vs App Engine: a head-to-head comparison using facts and science

Logical OR (||) vs Nullish Coalescing Operator (??) in JavaScript

Server-Side Rendering (SSR) Vs Client-Side Rendering (CSR)

Asp Net Core - Rest API Authorization with JWT (Roles Vs Claims Vs Policy) - Step by Step

Python GUI, PyQt vs TKinter

web3.js vs ethers.js: a Comparison of Web3 Libraries

Cookies vs Local Storage vs Session Storage

React Router V5 vs V6

LocalStorage vs Cookies: All You Need To Know About Storing JWT Tokens Securely in The Front-End

TailwindCSS vs Styled-Components in ReactJs

WebSockets vs Long Polling

JSX.Element vs ReactElement vs ReactNode

useState() vs setState() - Strings, Objects, and Arrays

Methods vs Computed in Vue

React: class components vs function components

Supabase Vs Firebase Pricing and When To Use Which

for loop vs .map() for making multiple API calls

🤝 Promise.allSettled() VS Promise.all() in JavaScript 🍭

React vs Vue vs Angular vs Svelte

Azure Artifacts vs Build Artifacts vs Pipeline Artifacts: Difference EXPLAINED!

When to use Svelte vs SvelteKit vs Sapper?

C#, Task.WhenAll vs Parallel.ForEach

Map vs MergeMap vs SwitchMap

CSS 3 VS Tailwind CSS

Serverless Framework vs SAM vs AWS CDK

Angular: Setters vs ngOnChanges - which one is better?

Interview question: heap vs stack (C#)

JS interview in 2 minutes / Static vs Dynamic typing

DynamoDB Scan Vs Query Operation Experiment Result

componentWillMount() vs componentDidMount()

Anonymous Functions vs Named Functions vs Arrow Functions

Flexbox - Align Items vs Align Content.

Vue vs React: What to choose in 2021?

Laravel Jetstream vs Breeze vs Laravel/ui

Linux Vs Windows - Why Linux Is Better For Programming & Web Dev (A newbie experience)

Fibonacci: Recursion vs Iteration

TypedDict vs dataclasses in Python — Epic typing BATTLE!

SSR vs CSR

Callback vs Promises vs Async Await

Poetry vs pip: Or How to Forget Forever "requirements.txt" Cheat Sheet for Beginners

Cypress vs WebdriverIO | Which one to pick?

Type Aliases vs Interfaces in TypeScript

PyQt vs Tkinter (Spanish)

Django vs Mern Which one to choose?

YYYY vs yyyy - The day the Java Date Formatter hurt my brain

JavaScript - debounce vs throttle ⏱

Go: Fiber vs Echo (a developer point)

RxJS debounce vs throttle vs audit vs sample — Difference You Should Know

Laravel vs Node.js - Which One Is The Best Back-End To Choose In 2021?

Composer update Vs Composer Install

Concurrency in modern programming languages: Rust vs Go vs Java vs Node.js vs Deno vs .NET 6

Pure vs Impure Functions

Git: Theirs vs Ours

Angular vs Blazor? A decision aid for web developers in 2022

APIView vs Viewsets

PyQt vs Pyside

Eager Loading VS Lazy Loading in SQLAlchemy

React vs Vue: Popular Front end frameworks in 2022

OpenAPI spec (swagger) v2 vs v3

apt update vs apt upgrade: What's the difference?

Framework vs library vs package vs module: The debate

What Should You Put in a Constructor vs ngOnInit in Angular

Javascript vs memes

Ionic vs React Nactive vs Flutter

Selenium vs The World Faster Clicker

Redux VS React Context: Which one should you choose?

Styled components vs Emotion js: A performance perspective

Git Submodules vs Monorepos

MongoDB: Normalization vs Denormalization

PUT vs PATCH & PUT vs POST

Laravel vs ASP.NET Framework | Which is Better For Your Project?

The last-child vs last-of-type selector in CSS

Moq vs NSubstitute - Who is the winner?

CSS solutions Battle: Compile time CSS-in-JS vs CSS-in-JS vs CSS Modules vs SASS

querySelector vs getElementById

Docker CMD vs ENTRYPOINT

React Virtualization - react-window vs react-virtuoso

The Development vs Production Environments

npm vs npx - which to use when?

Immediate vs eventual consistency

Fleet vs VSCode

Laravel breeze vs Jetstream

Pug vs EJS?

Join vs includes vs eager load vs preload

Require vs Assert in Solidity

Centralized vs Distributed Systems in a nutshell

PyQt vs Tkinter (German)

Flutter vs React Native Comparison - Which Use for Your Project in 2022

insertAdjacentHTML vs innerHTML

Moment.js vs Luxon

Generics vs Function Overloading vs Union Type Arguments in TypeScript

Sass vs Scss

What’s the difference: A/B Testing VS Blue/Green Deployment?

Publisher Subscriber vs Observer pattern with C#

VSCode vs Vim

Persistent vs Non-Persistent Connections | Creating a Multiplayer Game Server - Part 2

Spread VS Rest Operator

package.json vs package-lock.json: do you need both?

Double Quotes vs Single Quotes in PHP

RxJS operators: retry vs repeat?

CAP Theorem: Availability vs consistency

Scaling Airflow – Astronomer Vs Cloud Composer Vs Managed Workflows For Apache Airflow

MySQL vs MySQLi vs PDO Performance Benchmark, Difference and Security Comparison

For PHP devs - PHP Storm vs VSCode

Difference Between Message vs Event vs Command

Document vs Relational Databases

IntelliJ vs Eclipse vs VSCode

CSS position fixed vs sticky

Telegraf VS Node-Telegram-Bot-API

Flatpak vs Snaps vs AppImage vs Packages - Linux packaging formats compared

Pytest vs Cypress: A fair fight in UI testing?

Inline vs Inline-block vs Block

Logging vs Tracing: Why Logs Aren’t Enough to Debug Your Microservices

Solidity Gas Optimizations pt.1 - Memory vs Storage

Bicep vs ARM templates

Nest.js vs Express.js

Retry vs Circuit Breaker

Custom react hooks vs services

Global vs Local State in React

The What, Why, and When of Mono-Lambda vs Single Function APIs

Frontend vs Backend: Which One Is Right For You?

React vs Preact vs Inferno

What is the difference between Library vs Framework?

Compiling vs Transpiling

npm vs yarn vs pnpm commands cheatsheet

CPU Bound vs I/O Bound

DataBindingUtil.inflate vs View Binding Inflate

Includes() vs indexOf() in JavaScript

useEffect vs useLayoutEffect: the difference and when to use them

Ruby Modules: include vs extend vs prepend

OOP vs FP with Javascript

CSP vs Actor model for concurrency

Rust Concept Clarification: Deref vs AsRef vs Borrow vs Cow

Creating a countdown timer RxJS vs Vanilla JS

Asynchronous vs Synchronous Programming

SOAP vs REST vs gRPC vs GraphQL

PyQT vs wxPython: Which GUI module for your project?

CSS Drop Shadow vs Box Shadow

Infrastructure-as-Code vs Configuration Management

TypeScript: type vs interface

Head recursion Vs Tail recursion

Dev.to VS Hashnode VS Medium: Pick ONE

Classes vs Functional components in React

The Battle of the Array Titans: Lodash vs Vanilla - An Experiment

AWS EventBridge vs S3 Notification

Inheritance Vs Delegation

JavaScript vs JavaScript. Fight!

Interface vs Type in Typescript

setTimeout vs setImmediate vs process.nextTick

Kotlin vs Python

Kotlin Multiplatform vs Flutter: Which One to Choose for Your Apps

Supervised Learning vs Unsupervised Learning

React Hooks API vs Vue Composition API, as explored through useState

DEV VS Hashnode VS Medium: Where Should You Start Your Tech Blog

Implementing React Routes (Part -2) Link Vs NavLink

Vanilla CSS VS CSS Frameworks

Postman vs Insomnia: which API testing tool do you use?

Serif vs Sans-serif vs Monospaced

Getting started with fp-ts: Either vs Validation

Typescript Implicit vs Explicit types

CWEs vs OWASP top 10?

Understanding Offset vs Cursor based pagination

Material Design 1 vs Material Design 2

Signed vs Unsigned Bit Integers: What Does It Mean and What's The Difference?

default vs null - which is a better choice, and why?

Summary of Flutter vs Tauri

SpringBoot2 Blocking Web vs Reactive Web

JSON-RPC vs REST for distributed platform APIs

Explain RBAC vs ACL Like I'm Five

.map() vs .forEach()

Difference between Dialogflow CX vs Dialogflow ES

API keys vs JWT authorization – Which is best?

find() vs filter()

Snake Case vs Camel Case

AWS vs OCI Object Storage options and comparison

MAUI XAML vs MAUI Blazor

Pointer vs Reference in C++: The Final Guide

Comparing reactivity models - React vs Vue vs Svelte vs MobX vs Solid vs Redux

Frontend vs Backend, which do you prefer and why?

Remix vs Next.js: A Detailed Comparison

NodeJS vs Apache performance battle for the conquest of my ❤️ ⚔️

Functional vs Object Oriented vs Procedural programming

Lazy vs Eager Initialization

Laravel ORM vs Query Builder vs SQL: SPEED TEST!

Concurrency in Go vs Erlang

TypeScript ANY vs UNKNOWN—A Deep Dive

MVC vs MVP vs MVVM Design Patterns

GNOME vs KDE Plasma

Database Views vs Table Functions

Server Side Rendering vs Static Site Generation vs Incremental Static Regeneration

Understanding Rendering in Web Apps: SPA vs MPA

'any' vs 'unknown' in TypeScript 👀

TypeORM - Multiple DB Calls vs Single DB Call

JS array vs object vs map

Benchmarking Python JSON serializers - json vs ujson vs orjson

textContent VS innerText

Web2 vs Web3

Opinion: Architect VS Engineer VS Developer

Jenkins pipeline: agent vs node?

Hibernate Naming Strategies: JPA Specification vs Spring Boot Opinionation

Pyqt vs PySide (Spanish)

Unique Identifiers: UUID vs NanoID

A comparison of state management in React with Mobx vs State lifting

Meteor vs Next? A brutally honest answer

Git-Flow vs Github-flow

Set vs Array

Python Packaging: sdist vs bdist

JavaScript array methods: Mutator VS Non-mutator and the returning value

Uint vs Int. Qual a diferença em Go?

Understanding Rendering in Web Apps: CSR vs SSR

Flask vs Bottle Web Framework

Moment.js vs Intl object

PyQt vs Kivy

Web3: Truffle VS Hardhat VS Embark VS Brownie

The one about CSS vs CSS in JS

React Hooks vs Svelte - Why I chose Svelte?

TaskEither vs Promise

looking for answers !, strapi vs nest js for my next project

SOP vs CORS?

Pagination in an API: page number vs start index

SVG sprites vs CSS background image for multiple instances of icons

Javascript Streams vs Generators

JS Date vs Moment.js: A Really Simple Comparison

AMQP vs HTTP

return Task vs return await Task

Arrow Function vs Function

Front-end vs Back-end, and Static vs Dynamic Websites

setImmediate() vs setTimeout() vs process.nextTick()

Solace PubSub+ vs Kafka: The Basics

Agency VS Product Company: Which One's Right for You?

Stateless vs Stateful - Which direction should you take?

Clean Architecture vs Vertical Slice Architecture

Functional programming vs object oriented programming

Using Array.prototype.includes() vs Set.prototype.has() to filter arrays

Hot vs Cold Observables

Reassignment vs Mutability

Database (Schema) migration to Kubernetes - initContainers vs k8s jobs -

Gatsby vs Next.JS - What, Why and When?

Which is faster: obj.hasOwnProperty(prop) vs Object.keys(obj).includes(prop)

React Fragment VS Div

References

Clone this wiki locally