Задать вопрос
@vacoo

Как лучше хранить выполненные запросы из postgresql?

У меня есть много таблиц в postgresql. И у меня на выходе получаются вот такие json ответы с API (вложенные объекты в друг друге).
И эти данные запрашиваются с высокой частотой. База данных несмотря на индексы не справляется с нагрузкой. Поэтому пришла идея хранить в NOSQL решении типа MongoDB и причем эти данные должны фильтроваться сортироваться и так далее. Какое решение лучше всего подойдет? Я пока рассматриваю Apache Solr и MongoDB.

ps: Я пока новичок в highload системах.

[
            {
                "id": 222,
                "status": 3,
                "client_id": 9,
                "client": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "driver_id": 1,
                "driver": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "city_id": 1000,
                "city": {
                    "id": 0,
                    "name": "",
                    "name_full": ""
                },
                "created_at": 1581226919,
                "in_way_at": 1581226959,
                "arrived_at": 1581226989,
                "completed_at": 1581227021,
                "sum": 150,
                "countdown": 300,
                "address_from": "Пищера",
                "address_to": "Таверна",
                "extra": "",
                "mobile_pay": false,
                "arrived": true,
                "leaving": true,
                "ride": 2,
                "reason": ""
            },
            {
                "id": 220,
                "status": 3,
                "client_id": 9,
                "client": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "driver_id": 1,
                "driver": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "city_id": 1,
                "city": {
                    "id": 0,
                    "name": "",
                    "name_full": ""
                },
                "created_at": 1580476031,
                "in_way_at": 1580476419,
                "arrived_at": 1580476421,
                "completed_at": 1580476452,
                "sum": 100,
                "countdown": 180,
                "address_from": "Поликлиника2",
                "address_to": "Героя Попова, 61 к4",
                "extra": "",
                "mobile_pay": false,
                "arrived": true,
                "leaving": false,
                "ride": 1,
                "reason": ""
            },
            {
                "id": 218,
                "status": 3,
                "client_id": 2,
                "client": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "driver_id": 1,
                "driver": {
                    "id": 0,
                    "role": "",
                    "mode": "",
                    "login": "",
                    "firstname": "",
                    "surname": "",
                    "sex": "",
                    "photo": "",
                    "photo_url": "",
                    "car_brand": "",
                    "car_model": "",
                    "car_number": "",
                    "car_year": 0,
                    "car_color": "",
                    "car_photo": "",
                    "car_photo_url": "",
                    "created_at": 0,
                    "born_date": "",
                    "city_id": 0,
                    "city": {
                        "id": 0,
                        "name": "",
                        "name_full": ""
                    },
                    "ban": false,
                    "subscription": false,
                    "raiting": 0,
                    "balance": 0,
                    "delay": 0,
                    "delay_fixed": false,
                    "is_checked": false
                },
                "city_id": 1,
                "city": {
                    "id": 0,
                    "name": "",
                    "name_full": ""
                },
                "created_at": 1580472226,
                "in_way_at": 1580472296,
                "arrived_at": 1580475761,
                "completed_at": 1580475981,
                "sum": 100,
                "countdown": 180,
                "address_from": "Поликлиника",
                "address_to": "Героя Попова, 61 к4",
                "extra": "",
                "mobile_pay": false,
                "arrived": true,
                "leaving": false,
                "ride": 1,
                "reason": ""
            },
  • Вопрос задан
  • 72 просмотра
Подписаться 1 Простой Комментировать
Пригласить эксперта
Ответы на вопрос 1
xmoonlight
@xmoonlight
https://sitecoder.blogspot.com
Redis и оптимизируйте структуру БД.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы