Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Memcached service #253

Open
sajjaphani opened this issue Jan 4, 2022 · 1 comment
Open

Configurable Memcached service #253

sajjaphani opened this issue Jan 4, 2022 · 1 comment

Comments

@sajjaphani
Copy link
Contributor

Currently, the on-prem setup will start a new Memcached service for each of the builder-api services.
This creates a tight coupling between these two services and also poses difficulties in multi-node instances.

The data that is stored in Memcached primarily includes the following data:

  1. User Session data
  2. Package metadata

The data we are caching is not very significant? for an on-prem setup assuming

  1. the traffic is relatively low
  2. most of the traffic flows within a local network (intranet?)

From the above observations, we can propose the following approaches:

  1. Make Memcached optional
  2. Provide an option to supply the Memcached config

Make Memcached optional
It may not look ideal, but for small loads, it will be a better option than having to set up a Memcached instance(s).

If we make the Memcached optional there is will not be a significant impact on the Package metadata. However, the problem will come when dealing with the user session data. We can handle the session management in one of the following ways:
Persist session data in the database. configure the servers to use persistent sessions. If sessions are persisted directly in the database, then all the API services will see the same data in the session. The major drawback is that it requires DB access on each request.
Avoid using sessions by using a signed cookie to identify the users, JSON web token for example. This can ensure scalability and failover. It also poses its own set of problems.

Provide an option to supply the Memcached config

  • User can supply their instance of Memcached
  • We can spin a single Memcached instance through scripts.
    • If it is a single node setup, it may result in a single point of failure, but can be tolerated as it is a cache.

There is no one-size-fits-all solution. There will be tradeoffs between each of the solutions proposed above. We can gather feedback on the proposals (or new proposals) before choosing one or more of the above. It seems spinning a single instance and making all the API instances use that might be a reasonable choice, in my opinion.

@rahulgoel1
Copy link
Contributor

Thanks for sharing the thoughts. I also feel that we need to revisit the usage of memcached as a caching solutions. Do we even need distributed caching or can we manage the session in DB and still be able to meet performance for our app ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants