#Database issue

1 messages ยท Page 1 of 1 (latest)

paper acorn
#

.

dapper grove
#

Ok

#

Nice!

vague sierra
#

lmfao

paper acorn
#

Can someone help me? I made a code that works with mongo db, every time someone clicks an ore it gives them $10. The problem is that if someone has a very fast peak the server lags and I want to optimize it but I really don't know how

dapper grove
#

Caching

vague sierra
#

yeah

#

and do saving async

paper acorn
dapper grove
#

Cacheing

vague sierra
#

store it on the server first

paper acorn
#

aha

vague sierra
#

in a map

paper acorn
#

okay

dapper grove
#

Also use the async streams driver

paper acorn
#

๐Ÿค”

paper acorn
vague sierra
#

and then upload and download at regular intervals or something

dapper grove
#

Like a timer!

paper acorn
#

<HashMap>.forEach(
//give them the money
)

#

and one interval to do it?

dapper grove
#

First you check if they are in the cache for printing money if not send a request to the db

paper acorn
#

yes but if thay are in the map, then they are in the cache

dapper grove
#

Yep I'd look into caching methods I don't know the best way off the top of my head

#

Map being one