跳到正文
DEV Community· Burak Açıker·· 7 小時前AI 評分43

Drop Note:開發社交媒體應用程式帶來的學習經歷

I developed a social media application; it was a great learning experience.

AI 導讀

Drop Note 開發者分享從建立社交網站中學習後端、DevOps 等技術的經歷,並總結 ORM 升級、負載測試、單機部署、CI/CD、連結預覽及多語言動態消息等實作教訓。負載測試顯示伺服器約在每秒 110 個請求時觸及上限,修正最繁忙的端點後,處理能力約提升一倍。

正文

Drop Note (https://drop-note.com) started years ago as a tiny "write something without your name on it" page. I kept adding things late at night, and today it's a small social site: topics under any title, notes you can post with your name or anonymously (optionally self-deleting), DMs, group chats, friends, a feed, badges and a personal anonymous inbox link.

I'm 1-2 years out of school and this project is basically where I learned backend, DevOps and everything in between. Here are the parts that taught me the most.

The stack

  • Spring Boot 4 + Java 21, Postgres
  • React (MUI) frontend
  • SeaweedFS for media (S3 API)
  • k3s on a single 2-core / 7 GB Hostinger VPS, shared with a few other projects
  • Jenkins for CI/CD, Prometheus + Grafana for monitoring

Lesson 1: Hibernate 7 ate my RAM

Upgrading to Spring Boot 4 brought Hibernate 7, and some EAGER collections suddenly produced huge joined result sets that ran the app out of memory. Switching them to @Fetch(FetchMode.SELECT) fixed it. Lesson: after a major ORM upgrade, check your fetch plans before trusting the tests.

Lesson 2: Load testing tells you the truth

I wrote a Locust script and found the server hit its limit at around 110 requests per second, bound by CPU. After profiling and fixing the hottest endpoints it handles roughly twice that. On a 2-core box, "add more pods" doesn't add capacity. It just splits the same two cores.

Lesson 3: Kubernetes on one server is still worth it (sort of)

I moved the backend to k3s on the same VM: 2-3 API pods with autoscaling and one WebSocket pod. To make that work I needed ShedLock so scheduled jobs don't run twice, and a small relay so WebSocket messages reach users connected to another pod. The real win isn't capacity. It's zero-downtime deploys and the fact that adding a second server later is one k3s agent command.

Lesson 4: Your CI can take down production

One evening Jenkins, Grafana and the site all froze. Back-to-back backend deploys left old and new pods running side by side while a frontend build was also running, and RAM ran out. When your build server and production share a box, builds are a production risk.

Lesson 5: Link previews need a server

A React SPA shows an empty page to Twitter, WhatsApp or Discord bots. I added server-rendered Open Graph cards and a bot prerender path in nginx, so shared links show a real preview. Recently I extended the same path to AI crawlers.

Lesson 6: The feed should speak your language

Visitors from abroad were landing on a feed full of Turkish notes. Now each note's language is detected from its text, and the feed shows notes in the visitor's language first.

What's next

The tech is in decent shape. The hard part, it turns out, is getting people to show up. If you try it, I'd love honest feedback: what's confusing, what's unnecessary, what would make you come back.

https://drop-note.com

來源:DEV Community · dev.to