Code Monkey home page Code Monkey logo

Comments (4)

vixentael avatar vixentael commented on July 29, 2024

Hi @devendermishra!

Yes, Acra server works well with horizontal scaling.

Acra has the whole sections in the docs regarding optimisation, which includes vertical and horizontal scaling:
https://docs.cossacklabs.com/acra/configuring-maintaining/optimizations/

Acra also has the Balancer demo with AcraServer, PostgreSQL and HAProxy which demostrates different combination: balancer before the databases, or balancer before AcraServers
https://github.com/cossacklabs/acra-balancer-demo

Hope it helps!

from acra.

devendermishra avatar devendermishra commented on July 29, 2024

Thanks @vixentael for prompt response. My question is related to MySQL 8 based clients. Currently, MySQL 8 client is not supported. However, acra needs to store the capability of connected client. How that will work in case of horizontal scaling?

from acra.

devendermishra avatar devendermishra commented on July 29, 2024

In the given demo, there is 1 acra server per DB. I want to know if we can have multiple acra server per DB (especially MySQL).

from acra.

Lagovas avatar Lagovas commented on July 29, 2024

My question is related to MySQL 8 based clients. Currently, MySQL 8 client is not supported.

However, acra needs to store the capability of connected client.

For now, Acra doesn't store it. Your balancers should park the same client's connection to the same AcraServer and AcraServer will use the same database. Database wire protocols are stateful and operate with client sessions. Every session has its own set of registered prepared statements, opened transactions, connection parameters, db variables, and so on. So, the same client's connection should be proxied to the same database that handle that connection. You can scale your infrastructure by X database instances and every instance should have own AcraServer instance.

In the given demo, there is 1 acra server per DB. I want to know if we can have multiple acra server per DB (especially MySQL).

Yes, you can. But it depends on how your apps will connect to the AcraServer/Database. Let's use next example. You have a service parallelized into 2 instances and it uses a pool of connections of size 2. How you will distribute connection between different AcraServers?

  • You can configure every instance to use different instances of AcraServer. First intance uses AcraServerA, the second uses AcraServerB. Or every odd app instance uses AcraServerA and other uses AcraServerB.
  • You can configure your apps to connect to the AcraServer by it's domain name and DNS record will have X IP addresses of AcraServer instances. If your db drivers in app support round-robin strategy - then it will be scaled. If they will use only the first IP - it will not be scaled. Depends on db driver on app side or you need to write your own logic. In such case, the same instance can have 2 connections routed to 2 different AcraServer instances.
  • You can use any TCP proxy (for example haproxy) that will route connections from the app to different AcraServers using round-robin or any other strategy - it will work. One connection will use own AcraServer instance until close. AcraServer will store the connection state until it closes. In this case, 2 different instances can have 2 connections routed by proxy to 2 different AcraServer instances.

from acra.

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.