per page, with , order by , clip by
Results of 1 - 8 of about 8 for replica (0.011 sec.)
テストに関する高度なトピック — Django 6.1 ドキュメント 12146
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » テストに関する高度なトピック ¶ RequestFactory(リクエスト ファクトリ) ¶ class RequestFactory [ソース] ¶ RequestFactory はテストクライアントと同じ A ... { "ENGINE" : "django.db.backends.mysql" , "NAME" : "myproject" , "HOST" : "dbprimary" , # ... plus some other settings }, "replica" : { "ENGINE" : "django.db.backends.mysql" , "NAME" : "myproject" , "HOST" : "dbreplica" , "TEST" : { "MIRROR" : "default" ... ther settings }, } この設定では、2つのデータベースサーバーがあります。 dbprimary はデータベースのエイリアス default で、 dbreplica はエイリアス replica で表します。期待の通り、 dbreplica はデータベース管理者によって dbprimary の読み込み用レプリカとして設 ... 定されているので、通常の操作では default への書き込みは replica に反映されます。 Django で2つの独立したテスト用データベースを作成した場合、レプリケーションを期待したテストが壊れてしまいま ...
https://man.mtool.work/django/6.1/topics/testing/advanced.html
テストに関する高度なトピック — Django 6.1 ドキュメント 12146
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » テストに関する高度なトピック ¶ RequestFactory(リクエスト ファクトリ) ¶ class RequestFactory [ソース] ¶ RequestFactory はテストクライアントと同じ A ... { "ENGINE" : "django.db.backends.mysql" , "NAME" : "myproject" , "HOST" : "dbprimary" , # ... plus some other settings }, "replica" : { "ENGINE" : "django.db.backends.mysql" , "NAME" : "myproject" , "HOST" : "dbreplica" , "TEST" : { "MIRROR" : "default" ... ther settings }, } この設定では、2つのデータベースサーバーがあります。 dbprimary はデータベースのエイリアス default で、 dbreplica はエイリアス replica で表します。期待の通り、 dbreplica はデータベース管理者によって dbprimary の読み込み用レプリカとして設 ... 定されているので、通常の操作では default への書き込みは replica に反映されます。 Django で2つの独立したテスト用データベースを作成した場合、レプリケーションを期待したテストが壊れてしまいま ...
https://man.mtool.work/django/6.1/topics/testing/advanced.html
複数のデータベース — Django 6.1 ドキュメント 8205
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 複数のデータベース ¶ ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデー ... y" : { "NAME" : "primary_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "spam" , }, "replica1" : { "NAME" : "replica1_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "eggs" , }, ... "replica2" : { "NAME" : "replica2_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "bacon" , }, ... てのアプリをプライマリ/レプリカ構成に送り、ランダムにレプリカを選んで読み込むルーターも必要です: import random class PrimaryReplicaRouter : def db_for_read ( self , model , ** hints ): """ Reads go to a randomly-chosen replica. """ return random . choice ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
複数のデータベース — Django 6.1 ドキュメント 8205
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 複数のデータベース ¶ ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデー ... y" : { "NAME" : "primary_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "spam" , }, "replica1" : { "NAME" : "replica1_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "eggs" , }, ... "replica2" : { "NAME" : "replica2_name" , "ENGINE" : "django.db.backends.mysql" , "USER" : "mysql_user" , "PASSWORD" : "bacon" , }, ... てのアプリをプライマリ/レプリカ構成に送り、ランダムにレプリカを選んで読み込むルーターも必要です: import random class PrimaryReplicaRouter : def db_for_read ( self , model , ** hints ): """ Reads go to a randomly-chosen replica. """ return random . choice ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
QuerySet API リファレンス — Django 6.1 ドキュメント 7880
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » QuerySet API リファレンス ¶ このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としてい ... のクエリで指定されたデータベースを使用します。以下はすべて正しいコードです: >>> # Both inner and outer queries will use the 'replica' database >>> Restaurant . objects . prefetch_related ( "pizzas__toppings" ) . using ( "replica" ) >>> Restaurant . object ... s . prefetch_related ( ... Prefetch ( "pizzas__toppings" ), ... ) . using ( "replica" ) >>> >>> # Inner will use the 'replica' database; outer will use 'default' database >>> Restaurant . objects . prefetch_ ... related ( ... Prefetch ( "pizzas__toppings" , queryset = Toppings . objects . using ( "replica" )), ... ) >>> >>> # Inner will use 'replica' database; outer will use 'cold-storage' database >>> Restaurant . objects . ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
Django のキャッシュフレームワーク — Django 6.1 ドキュメント 7880
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Django のキャッシュフレームワーク ¶ 動的なウェブサイトの基本的なトレードオフは、ええと、それが動的であるということです。ユーザーがページをリクエスト ... re.cache.backends.redis.RedisCache" , "LOCATION" : [ "redis://127.0.0.1:6379" , # leader "redis://127.0.0.1:6378" , # read-replica 1 "redis://127.0.0.1:6377" , # read-replica 2 ], } } データベースのキャッシュ ¶ Django はキャッシュデータをデータベース中に ... が、ルーティングの目的でモデルの詳細情報を使用できます。 たとえば、以下のルーターはすべてのキャッシュの読み込み操作を cache_replica に転送し、すべての書き込み操作を cache_primary に転送します。キャッシュテーブルは cache_primary にだけ同期されます。 class ... control all database cache operations""" def db_for_read ( self , model , ** hints ): "All cache read operations go to the replica" if model . _meta . app_label == "django_cache" : return "cache_replica" return None def db_for_write ( self , model , ** ...
https://man.mtool.work/django/6.1/topics/cache.html
QuerySet API リファレンス — Django 6.1 ドキュメント 7880
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » QuerySet API リファレンス ¶ このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としてい ... のクエリで指定されたデータベースを使用します。以下はすべて正しいコードです: >>> # Both inner and outer queries will use the 'replica' database >>> Restaurant . objects . prefetch_related ( "pizzas__toppings" ) . using ( "replica" ) >>> Restaurant . object ... s . prefetch_related ( ... Prefetch ( "pizzas__toppings" ), ... ) . using ( "replica" ) >>> >>> # Inner will use the 'replica' database; outer will use 'default' database >>> Restaurant . objects . prefetch_ ... related ( ... Prefetch ( "pizzas__toppings" , queryset = Toppings . objects . using ( "replica" )), ... ) >>> >>> # Inner will use 'replica' database; outer will use 'cold-storage' database >>> Restaurant . objects . ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
Django のキャッシュフレームワーク — Django 6.1 ドキュメント 7880
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Django のキャッシュフレームワーク ¶ 動的なウェブサイトの基本的なトレードオフは、ええと、それが動的であるということです。ユーザーがページをリクエスト ... re.cache.backends.redis.RedisCache" , "LOCATION" : [ "redis://127.0.0.1:6379" , # leader "redis://127.0.0.1:6378" , # read-replica 1 "redis://127.0.0.1:6377" , # read-replica 2 ], } } データベースのキャッシュ ¶ Django はキャッシュデータをデータベース中に ... が、ルーティングの目的でモデルの詳細情報を使用できます。 たとえば、以下のルーターはすべてのキャッシュの読み込み操作を cache_replica に転送し、すべての書き込み操作を cache_primary に転送します。キャッシュテーブルは cache_primary にだけ同期されます。 class ... control all database cache operations""" def db_for_read ( self , model , ** hints ): "All cache read operations go to the replica" if model . _meta . app_label == "django_cache" : return "cache_replica" return None def db_for_write ( self , model , ** ...
https://man.mtool.work/django/6.1/topics/cache.html
PREV 1 NEXT