S
S
Shrei2016-06-18 16:09:01
API
Shrei, 2016-06-18 16:09:01

How to organize the project architecture?

I have a game project in which game data and site data are currently in a common database. Realtime socket game with your client. All communication with data between the site and the game takes place by means of database queries to a specific table. It seems to me that this is wrong and that these are 2 independent resources that should not go to each other for data. I was considering switching to a microservice architecture via the JSON API. I wanted to fit all services into one API with public and private API. I already undertook to do it, but I was repulsed by the need to establish a connection every time and the need to get the data of some tables in full. Invent your own socket layer? Tell me how such problems are solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
arezvov, 2016-06-23
@arezvov

All communication with data between the site and the game takes place by means of database queries to a specific table. It seems to me that this is wrong and that these are 2 independent resources that should not go to each other for data.

Sharing data through the DB is a bad idea, right.
Usually they allocate an API service (in the RESTful trend) that distributes data, this can be a third service in your case or you can assign it to one of the existing services.
The connection must also be established when working with the DBMS, as for pumping out data in full - it's hard to say without specifics, I can suggest the development of methods in the API that will not give out the data in full.
Микросервисы - это нечто иное, скорее всего они вам пока еще не нужны, хороший комментарий:
https://habrahabr.ru/post/249183/#comment_8256405
"В такой формулировке вопроса — скорее никак. Микросервисы — это про частные решения небольших частных проблем наиболее подходящими для этим проблем способами. Чем более общий вопрос — тем хуже он решается микросервисами. Если ставить вопрос «у меня куча данных, как их распихать по микросервисам», то ответ будет «никак, пихай в одну обычную реляционную субд»."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question