- docker pull postgres
- docker run --name postgres-test -e POSTGRES_PASSWORD=root -d postgres
- docker exec -it postgres-test psql -U postgres
- to exit :
\q
Aspect | VirtualBox | Docker |
---|---|---|
Virtualization Type | Hardware (Full Virtualization) | OS-Level (Containerization) |
OS Requirement | Each VM requires its own OS | Containers share the host OS kernel |
Resource Overhead | Higher, due to multiple OS instances | Lower, due to shared OS kernel |
Startup Time | Slower, due to full OS boot process | Faster, containers start almost instantly |
Isolation | High, each VM is fully isolated | High, but not as complete as VMs |
- Backend Optimization:
- Reduce the number of database queries by optimizing SQL queries, using indexes, and fetching only necessary data.
- Redis Integration:
- storing sessions
- Frontend Optimization:
- Caching Resources:
- using CDN
- using a meta framework that can returns HTML to some components instead of JavaScript.
- Data Caching with WebSockets
- Caching Resources:
- optimize Images
Test-Driven Development (TDD) is a software development approach where tests are written before the actual code. The process follows these steps:
- Write a Test: Create a test for a new function or feature.
- Run the Test: The test will fail initially because the feature isn't implemented yet.
- Write Code: Write the minimal code needed to pass the test.
- Run the Test Again: Ensure the code passes the test.
- Refactor: Clean up the code while ensuring the test still passes.
- Repeat: Continue this cycle for each new feature or function.
Reason 1: Over-fetching
- Over-fetching occurs when a client retrieves more data than is actually needed for a particular task or view, resulting in wasted bandwidth and slower performance
- Traditional RESTful APIs often suffer from over-fetching due to the fixed data structure returned by each endpoint, which may include unnecessary fields.
- GraphQL addresses this issue by allowing clients to specify their data requirements upfront in a single query, reducing the likelihood of over-fetching by retrieving only the required data fields.
Reason 2: Under-fetching
NewerOlder