Handling large amount of requests with map editing

cyberghost2023

Katappa Kautilya

Posted on July 8, 2024

Handling large amount of requests with map editing

I am writing a Golang backend which is hit directly by android app.
I am storing app config data in Elasticsearch and and when a request comes i check in local cache if it is present and if not fetch from Elasticsearch. But i also want to update few fields of response so i am updating the response like
response.Hits.Hits[0].Source["current_time"] = utils.GetCurrentTimeInMillis()

It is throwing error:concurrent read and write. It can be handled with mutex lock but the number of requests will be approx, 200K per minute and because of this i am getting high api latency.
How can i handle it, can someone help?

💖 💪 🙅 🚩
cyberghost2023
Katappa Kautilya

Posted on July 8, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024