Postgres and Kubernetes

When I decided to deploy all my services on Kubernetes, one of the critical components was the PostgreSQL database. Deploying databases on Kubernetes can be challenging due to their stateful nature. In this post, I’ll share how I deployed PostgreSQL on Kubernetes, the challenges I faced, and why I chose the CrunchyData PostgreSQL Operator. Understanding Stateful vs. Stateless Applications Before diving into deployment, it’s essential to understand the difference between stateful and stateless applications....

арван нэгдүгээр сар 3, 2024 · 4 мин · 740 үг · Me

Astring- Front-end

I don’t have much experience in front-end development. When I started working on my web project, I decided to use React with TypeScript. It felt like a natural choice since it’s popular, has a huge ecosystem, and I wanted the type safety that TypeScript offers. Things were fine at first, but as I progressed, I realized there was more to front-end development than just writing code. Phase 1: Styling from Scratch Feeling confident, I thought, Why not write all the styles from scratch?...

арван нэгдүгээр сар 2, 2024 · 6 мин · 1181 үг · Me

Astring- Infrastructure

When I first started building my application, everything ran smoothly on my laptop. Development was straightforward, and I had full control over my environment. However, as the project grew, I needed to deploy it so others could access and test it. This is where my journey into infrastructure began—a journey that took me through cloud services like Fly.io and Vercel, into managed Kubernetes on Linode, and eventually to an on-premise Kubernetes cluster....

аравдугаар сар 18, 2024 · 5 мин · 1011 үг · Me

Astring- Storage

In my chat application, I need reliable object storage for handling media and file uploads. Beyond that, I also need storage for backups, logs, and other critical data. Choosing the right storage solution turned out to be one of the hardest decisions. Each option I explored had its strengths and weaknesses, and finding the right balance for both development and production was challenging. What is Object Storage? Object storage is a way of storing and managing data as discrete units called objects....

аравдугаар сар 16, 2024 · 5 мин · 1029 үг · Me

Astring- Scaling the Application

Scaling a backend application can be challenging, especially when it’s built around WebSocket servers handling a large number of user sessions. On its own, a single WebSocket server can’t handle all the users, right? So, how do we scale the application effectively to meet increasing demands? When scaling horizontally, several issues arise. For instance, imagine that User A is connected to Server X, and User B is connected to Server Y....

аравдугаар сар 14, 2024 · 4 мин · 769 үг · Me

Astring- Finding right Database

When I decided to build my chat application, I naturally started with PostgreSQL. It’s been my go-to database for a while - stable, feature-rich, and with a solid reputation for handling a variety of workloads. Here’s why I initially chose it: A Well-Established Ecosystem: PostgreSQL has been around for decades. The community support is fantastic, there’s extensive documentation, and a lot of extensions are available. Data Integrity: PostgreSQL’s ACID compliance means I can trust the consistency of my data....

аравдугаар сар 10, 2024 · 4 мин · 672 үг · Me

Astring

It’s been a long time since I wrote a post. Here I am to share my experience with my chat application. So, let’s start with why I started learning programming. Why? Since I was young, I’ve always liked math and solving problems. When I was in 11th grade, my math teacher told me there were problems that require a computer to solve. I was so curious: what problems exactly? What do you mean by using a computer?...

аравдугаар сар 4, 2024 · 4 мин · 715 үг · Me

Capture The Flag

Intro Ажил дээр CTF-н тэмцээн саяхан болсон ба тэрхүү тэмцээний зохион байгуулах багт орон хэдэн бодлого дэвшүүлж үзлээ. CTF-н тухай ойлголт бага байсан ч сонирхолтой байлаа. Миний хувьд 4 төрлийн бодлого дэвшүүлэх гэж оролдсон ба тэр тухайгаа бичлээ. Гэснээс тухайн бодлогын нэртэй кинонуудыг үзээд үзээрэй Cryptography Cryptography-д надад сонирхолтой санагддаг ба энэхүү сэдвээр бодлого дэвшүүлэх хамгийн сонирхолтой нь байлаа. Ерөнхийдөө 2 бодлогын санаа байсан ба SSH Public Key Authentication Бүгд л ssh public key authentication ашигладаг эсвэл ашиглаж үзсэн байх....

есдүгээр сар 24, 2024 · 15 мин · 3186 үг · Me

Min heap-г өөрсдөө бичих - C++

Өмнө нь priority queue-н талаар болон queue, vector-г хэрхэн өөрсдөө бичих тухай ярьсан билээ. Одоо priority queue буюу min heap бүтцийн тухай дэлгэрэнгүй бичье. Эргэн санавал энэхүү өгөгдлийн бүтэц нь үндсэн 4 үйлдэлтэй ба: size() - heap-н хэмжээг буцаах front() - хамгийн бага элементийг буцаах pop() - хамгийн бага элементийг устгах push(element) - heap-д элемент нэмэх Үүнийг хэрхэн бичих вэ? Бид зүгээр л энгийн array ашиглаад хийж болох уу?...

аравдугаар сар 13, 2023 · 4 мин · 755 үг · Me

Dynamic array-г өөрсдөө бичих - C++

Би queue-г хэрхэн бичих талаар энд бичсэн ба vector-н тухай мөн бичсэн. Энэ удаа өмнөх queue-г хэрхэн бичсэнтэй адилаар dynamic array-г хэрхэн хийж болох талаар бичихээр шийдлээ. Dynamic array-р нь энгийн array-с ялгаатай нь хэмжээгээ өөрчлөх боломжтойгоор онцлог ба үүний нэг нь vector билээ. Мэдээж vector-н ямарч элементийг мэдэхэд O(1) үйлдэл хийдэг ба vector-т үндсэн 3 үйлдэл байдаг гэвэл size() - хэмжээг мэдэх push(element) - шинэ элемент хамгийн хойно нэмэх [index] - index-р элементийн утгыг мэдэх Үүнийг яаж хийх хэр хэцүү байх талаар цааш уншихаас өмнө хэсэг бодоод үзээрэй....

аравдугаар сар 4, 2023 · 5 мин · 970 үг · Me