Coder Social home page Coder Social logo

Comments (6)

wens avatar wens commented on August 11, 2024 1

However, it will be difficult for web-based service because
it's hard to keep track of userec without reading .PASSWD.

This doesn't quite make sense. Regardless of the backend storage, you still need to read out the data,
be it a blob that expands into multiple fields, or a database system that presents the fields to you.

hi @wens

Though we still need to read out the data,
but I thought that reading data from horizontal-scalable db with replica through intranet

It will not be horizontally scaled, but likely sitting on the same machine.
We simply do not have machines to do "horizontally scaled systems".
So you are trading single host performance and complexity for unachievable
horizontal scalability. I doubt it would perform better.

are much safer than reading data from 1 local file.

How is that? If you are reading through intranet it will be equally fast.
If the main machine breaks down, well the whole site will be down anyway.
And if the new system keeps on running with state updates, then you end
up with data synchronization issues.

I think "safer" is not the word you are looking for.

(Or now we are using m2ssd and reading data from file is not any more huge issue?~)

AFAIAC you should be more focused on getting the new system up with basic features,
and worry about performance bottlenecks later.

from pttbbs.

wens avatar wens commented on August 11, 2024

However, it will be difficult for web-based service because
it's hard to keep track of userec without reading .PASSWD.

This doesn't quite make sense. Regardless of the backend storage, you still need to read out the data,
be it a blob that expands into multiple fields, or a database system that presents the fields to you.

(.PASSWD is one gigantic file recording all the users.
It's not feasible to know whether data of one user is updated
just by looking at the mtime of the file.)

It would make more sense if you explained "why" you need to know whether individual users were updated.

from pttbbs.

chhsiao1981 avatar chhsiao1981 commented on August 11, 2024

hi @wens

The proposed web-based service are divided with 2 layers,
including:
backend: the same machine as the original pttbbs server, intending to directly access the data in shared-mem and files.
middleware: a separate machine (hopefully besides the original pttbbs server) dealing with frontend and communicate
with the backend.

middleware is designed to be easily horizontally scalable with easily horizontally scalable db.

For the file-based data in pttbbs, we can have some permanent-db in middleware as the cache to avoid requesting data from backend/pttbbs server too often.
What I think of the cache-validation mechanism is to compare the mtime of the file and the last-update-time in the middleware. => need to know whether individual users were updated.

from pttbbs.

chhsiao1981 avatar chhsiao1981 commented on August 11, 2024

However, it will be difficult for web-based service because
it's hard to keep track of userec without reading .PASSWD.

This doesn't quite make sense. Regardless of the backend storage, you still need to read out the data,
be it a blob that expands into multiple fields, or a database system that presents the fields to you.

hi @wens

Though we still need to read out the data,
but I thought that reading data from horizontal-scalable db with replica through intranet
are much safer than reading data from 1 local file.
(Or now we are using m2ssd and reading data from file is not any more huge issue?~)

from pttbbs.

wens avatar wens commented on August 11, 2024

Doesn't that mean you end up polling 2M number of users say every minute?
That's not much better than just throwing data away every minute.
Just cache it for 1 minute and re-fetch when it expires.
Or maybe just don't cache it at this time.
Wait until it actually becomes a performance bottleneck.

from pttbbs.

chhsiao1981 avatar chhsiao1981 commented on August 11, 2024

However, it will be difficult for web-based service because
it's hard to keep track of userec without reading .PASSWD.

This doesn't quite make sense. Regardless of the backend storage, you still need to read out the data,
be it a blob that expands into multiple fields, or a database system that presents the fields to you.

hi @wens
Though we still need to read out the data,
but I thought that reading data from horizontal-scalable db with replica through intranet

It will not be horizontally scaled, but likely sitting on the same machine.
We simply do not have machines to do "horizontally scaled systems".
So you are trading single host performance and complexity for unachievable
horizontal scalability. I doubt it would perform better.

are much safer than reading data from 1 local file.

How is that? If you are reading through intranet it will be equally fast.
If the main machine breaks down, well the whole site will be down anyway.
And if the new system keeps on running with state updates, then you end
up with data synchronization issues.

I think "safer" is not the word you are looking for.

(Or now we are using m2ssd and reading data from file is not any more huge issue?~)

AFAIAC you should be more focused on getting the new system up with basic features,
and worry about performance bottlenecks later.

Sounds good~ I'll close the issue for now~

from pttbbs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.