ddubbert / dub.io

Agar.io clone based on Continuous Event Streams and Microservices. Implemented with Node.js, GraphQL and Apache Kafka.
MIT License
1 stars 0 forks source link

What Services and Kafka Topics are needed ? #2

Closed ddubbert closed 4 years ago

ddubbert commented 4 years ago

Which of those services need to provide an API and which wont ? In other words: Which are only workers and which need to directly be addressed by a client?

In addition, how many different Events and Topics are needed for connecting the Services? What are their names, how should the corresponding events data structure be, are those events grouped or is each event send as a standalone and what Services are posting to and reading from these Topics?

ddubbert commented 4 years ago
Architecture_dub_io

Topics:

{
    value: {
        type: String, // NodeGroup-Type
        nodes: [
            {
                id: String,
                type: String, // NodeGroup-Type
                title: Sting, // Name or Title of node
                position: {
                    x: Number,
                    y: Number,
                },
                radius: Number,
                sprite: String?, // If an image instead of color should be used to display this node (e.g. food, obstacles etc.)
                color: String?, // Background color of node if no sprite was provided
            }
        ]
    }
}
{
    value: {
        cellSize: Number,
        rows: [
            {
                cells: [
                    {
                        nodes: [
                            {
                                id: String,
                                type: String, // NodeGroup-Type
                                title: String, // Name or Title of node
                                position: {
                                    x: Number,
                                    y: Number,
                                },
                                radius: Number,
                                sprite: String?, // If an image instead of color should be used to display this node (e.g. food, obstacles etc.)
                                color: String?, // Background color of node if no sprite was provided
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
{
    value: {
        nodes: [ {
            id: String,
            type: String, // NodeGroup-Type
            title: String, // Name or Title of node
            position: {
                x: Number,
                y: Number,
            },
            radius: Number,
            sprite: String?, // If an image instead of color should be used to display this node (e.g. food, obstacles etc.)
            color: String?, // Background color of node if no sprite was provided
        },
        {
            id: String,
            type: String, // NodeGroup-Type
            title: String, // Name or Title of node
            position: {
                x: Number,
                y: Number,
            },
            radius: Number,
            sprite: String?, // If an image instead of color should be used to display this node (e.g. food, obstacles etc.)
            color: String?, // Background color of node if no sprite was provided
        }],
    }
}
{
    value: {
        user: {
            id: String,
            type: String, // NodeGroup-Type
            title: String, // Name or Title of node
            position: {
                x: Number,
                y: Number,
            },
            radius: Number,
            sprite: String?, // If an image instead of color should be used to display this node (e.g. food, obstacles etc.)
            color: String?, // Background color of node if no sprite was provided
        },
        event: String, // Something like 'grow' or 'die'
        value: Number?, // If event needs a second value parameter
    }
}

Services: