🍹 Technologies: TypeScript, Node.JS, Express, React, Redux, Next.js, MongoDB, Mongoose, Event Driven, Pub-Sub, Docker, Kubernetes, CI/CD, Skaffold, Apache Kafka, NATS Streaming Server etc.
Aditya Hajare (Linkedin).
WIP (Work In Progress)!
Open-sourced software licensed under the MIT license.
+ Why Database Per-Service
- We want each service to run independently of other services.
- Database schema/structure might change unexpectedly.
- Some services might function efficiently with different types of DB's (SQL vs. NoSQL).
+ Communication Strategies Between Services
- Sync: Services communicate with each other using direct requests.
- Conceptually easy to understand.
- Service won't need a database.
- Introduces a dependency between services.
- If any inter-service request failes, the entire service fails.
- The entire request is only as fast as the slowest request.
- Can easily introduce webs of requests.
- Async (Event Based Communication): Services communicate with each other using events.
- No inter-service dependency.
- Service will be extremely fast since it has it's own data store.
- Introduces data duplication. Paying for extra storage + extra DB.
- Harder to understand.
+ Event Bus
- Many different implementations. For e.g.
RabbitMQ
,Kafka
,NATS
etc.. - Receives events, publishes them to listeners.
- Many different subtle features that make async communication way easier or way harder.
+ Kubernetes Basic Terminologies
- Cluster: A collection of
nodes
+ amaster
to manage them. - Node: A
virtual machine
that runs ourcontainers
. - Pod: More or less a running container. Technically, a
pod
can run multiple containers. - Deployment: Monitors a
set of pods
. Make sure they are running and restarts them if they crash. - Service: Provides an
easy-to-remember URL
to access a runningcontainer
.
+ Kubernetes Config Files
- Tells Kubernetes about the different Deployments, Pods and Services (Referred to as
Objects
) that we want to create. - Written in
YAML
syntax. - Always store these files with our project source code - they are documentation!
- We can create
Objects
without config files - DO NOT DO THIS!. Config files provide a precise definition of what our cluster is running.
+ Securely Create Secrets In Kubernetes
- Following command will create a secret called
JWT_KEY
:
kubectl create secret generic jwt-secret --from-literal=JWT_KEY=adityahajare