Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Anda sedang melihat dokumentasi Apigee dan Apigee Hybrid.
Lihat dokumentasi
Apigee Edge.
Bagian ini membahas antipola umum yang muncul saat proxy API di-deploy di Apigee.
Apa itu antipola?
Antipola adalah praktik desain software yang tidak efektif atau kontraproduktif—dengan kata lain, kebalikan dari "praktik terbaik".
Dengan kata lain, antipola adalah sesuatu yang memungkinkan Anda lakukan oleh software, tetapi
dapat berdampak buruk pada fungsi atau performa.
Misalnya, pertimbangkan "Class/Object Tuhan" yang terdengar mahakuasa. Dalam pemrograman berorientasi objek, class dewa adalah class yang mengontrol terlalu banyak class untuk aplikasi tertentu, seperti yang diilustrasikan oleh pohon referensi berikut:
Gambar 1: Class berat
Seperti yang diilustrasikan gambar, class dewa menggunakan dan mereferensikan terlalu banyak class.
Framework tempat aplikasi dikembangkan tidak mencegah pembuatan class tersebut, tetapi memiliki banyak kerugian, yang utama adalah:
Sulit dikelola
Titik tunggal kegagalan saat aplikasi berjalan
Oleh karena itu, class semacam itu adalah antipola yang sebaiknya tidak Anda buat.
Kabar baiknya, Anda dapat mengidentifikasi antipola ini dan memperbaikinya dengan
praktik terbaik yang sesuai, yang akan membuat API yang Anda deploy di Apigee melayani tujuan yang
diinginkan dengan sebaik-baiknya.
Ringkasan antipola
Tabel berikut mencantumkan beberapa antipola API umum:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-10 UTC."],[[["\u003cp\u003eThis documentation outlines common antipatterns encountered when deploying API proxies on Apigee and Apigee hybrid.\u003c/p\u003e\n"],["\u003cp\u003eAn antipattern is a software design practice that is ineffective or counterproductive, potentially causing adverse functional or performance impacts, as opposed to a best practice.\u003c/p\u003e\n"],["\u003cp\u003eAntipatterns, such as a "God Class" in object-oriented programming, are undesirable practices that can lead to maintenance issues and single points of failure.\u003c/p\u003e\n"],["\u003cp\u003eSeveral policy, generic, and backend antipatterns are detailed, including issues related to caching, quota management, and managing Apigee resources.\u003c/p\u003e\n"],["\u003cp\u003eThe document also provides a link to download a comprehensive eBook that goes over these antipatterns.\u003c/p\u003e\n"]]],[],null,["*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/antipatterns/intro) documentation.*\n\nThis section is about common antipatterns that arise when API proxies are deployed\non Apigee.\n\nWhat is an antipattern?\n\nAn [*antipattern*](https://en.wikipedia.org/wiki/Anti-pattern) is a software\ndesign practice that is ineffective or\ncounterproductive---in other words, the opposite of a \"best practice.\"\nTo put it another way, an antipattern is something that the software allows you to do, but\nthat may have an adverse functional or performance impact.\n\nFor example, consider the omnipotent-sounding \"God Class/Object\". In objected oriented\nprogramming, a *god class* is a class that controls too many classes\nfor a given application, as illustrated by the following reference tree:\n**Figure 1**: God class\n\nAs the image illustrates, the god class uses and references too many classes.\n\nThe framework on which the application was developed does not prevent the creation of such a\nclass, but it has many disadvantages, the primary ones being:\n\n- Hard to maintain\n- Single point of failure when the application runs\n\nConsequently, such a class is an antipattern that you should avoid creating.\n\nThe good news is that you can identify these antipatterns and rectify them with\nappropriate best practices, which will make the APIs you deploy on Apigee best serve their intended\npurpose.\n\nSummary of antipatterns\n\nThe following table lists some common API antipatterns:\n\n| Category | Antipatterns |\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Policy antipatterns | - [Issuing refresh tokens without invoking refresh flow](/apigee/docs/api-platform/antipatterns/issuing-refresh-tokens) - [Use waitForComplete() in JavaScript code](/apigee/docs/api-platform/antipatterns/wait-for-complete) - [Set a long expiration time for OAuth tokens](/apigee/docs/api-platform/antipatterns/oauth-long-expiration) - [Use greedy quantifiers in the RegularExpressionProtection policy](/apigee/docs/api-platform/antipatterns/greedy-quantifiers) - [Cache error responses](/apigee/docs/api-platform/antipatterns/caching-error) - [Store data greater than 256 KB size in cache](/apigee/docs/api-platform/antipatterns/caching-large) - [Invoke MessageLogging multiple times in an API proxy](/apigee/docs/api-platform/antipatterns/messagelogging-multiple-times) - [High-cardinality identifiers in Quota policy](/apigee/docs/api-platform/antipatterns/high-cardinality-identifiers-quota-policy) - [Configure non-distributed quota](/apigee/docs/api-platform/antipatterns/non-distributed-quota) - [Reuse a Quota policy](/apigee/docs/api-platform/antipatterns/reusing-quota) - [Use the RaiseFault policy under inappropriate conditions](/apigee/docs/api-platform/antipatterns/raise-fault-conditions) - [Access multi-value HTTP headers incorrectly in an API Proxy](/apigee/docs/api-platform/antipatterns/multi-value-http-headers) - [Use Service Callout to invoke backend service in no target proxy](/apigee/docs/api-platform/antipatterns/service-callout-no-target) |\n| Generic antipatterns | - [Invoke Management API calls from an API Proxy](/apigee/docs/api-platform/antipatterns/invoking-management) - [Invoke a proxy within a proxy using custom code or as a target](/apigee/docs/api-platform/antipatterns/proxy-within-proxy) - [Manage Apigee resources without using source control management](/apigee/docs/api-platform/antipatterns/no-source-control) - [Load Balance with a single target server with MaxFailures set to a non-zero value](/apigee/docs/api-platform/antipatterns/load-balancing-maxfailures) - [Access the request/response payload when streaming is enabled](/apigee/docs/api-platform/antipatterns/payload-with-streaming) - [Define multiple ProxyEndpoints in an API Proxy](/apigee/docs/api-platform/antipatterns/multiple-proxyendpoints) |\n| Backend antipatterns | - [Allow a slow backend](/apigee/docs/api-platform/antipatterns/slow-backend) - [Disable HTTP persistent (reusable keep-alive) connections](/apigee/docs/api-platform/antipatterns/disable-persistent-connections) |\n\nDownload antipatterns eBook\n\nIn addition to the links above, you can also download the antipatterns in eBook format:\n\n- [The Book of Apigee Antipatterns v2.0 (PDF)](https://docs.apigee.com/files/Apigee_Edge_Antipatterns_2_0.pdf)"]]