- عنوان کتاب: PostgreSQL Mistakes and How to Avoid Them (MEAP)
- نویسنده: Jimmy Angelakos
- حوزه: پایگاه داده, PostgreSQL
- سال انتشار: 2025
- تعداد صفحه: 284
- زبان اصلی: انگلیسی
- نوع فایل: pdf
- حجم فایل: 3.47 مگابایت
به اشتباهات PostgreSQL و نحوه اجتناب از آنها خوش آمدید! احتمالاً شما این کتاب را برای کسب اطلاعات بیشتر در مورد PostgreSQL تهیه کردهاید و در واقع هدف کتاب نیز همین است. با این حال، این کتاب نه یک کتاب آموزشی به معنای سنتی است و نه یک راهنمای مدیریتی – در حال حاضر کتابهای خوبی در این زمینه وجود دارد. این کتاب تأکید میکند که اشتباهات اتفاق میافتند و آنها فرصت یادگیری خوبی هستند. در این فصل، خواهیم دید که چرا PostgreSQL در حال حاضر مهم است، چگونه این کتاب اشتباهات مرتبط با PostgreSQL را بررسی میکند و چرا این یک تلاش ارزشمند است. همانطور که قبلاً اشاره کردیم، PostgreSQL (با نام مستعار Postgres) یک فناوری متحولکننده است که شروع به کنار زدن فروشندگان غولپیکر پایگاه داده از تخت سلطنت کرده است. این یک پایگاه داده قوی و قابل اعتماد با ویژگیهای غنی، بسیار توسعهپذیر است و با هر نسخه جدید، ویژگیهای سازمانی بیشتری به دست میآورد. این نرمافزار نه تنها در جامعه پایگاه داده، بلکه در محافل تجاری نیز با استقبال گستردهای روبرو شده است، به طوری که صدها فروشنده اکنون مشارکت در کد، پشتیبانی حرفهای، نسخههای با قابلیتهای پیشرفته و حتی پیشنهادات میزبانی شده، ابری یا پایگاه داده به عنوان سرویس (DBaaS) Postgres را ارائه میدهند. از همه مهمتر، پروژه PostgreSQL نمونه بارزی از نرمافزار آزاد جامعهمحور و مبتنی بر جامعه است و این در مجوز PostgreSQL بیان شده است. این امر به ویژه با توجه به اینکه اکثر فروشندگان پایگاه داده دیگر به نرمافزار اختصاصی پایبند هستند و تلاشهای پایگاه دادهای مستقر و نوظهور به مجوزهای غیرمطابق با متنباز روی میآورند، در تلاش برای سودآوری با محدود کردن راههای کسب درآمد دیگران با محصولشان، بسیار مهم است. از سوی دیگر، میتوانید با فروش پشتیبانی، میزبانی، آموزش یا خدمات و حتی قرار دادن محصول متنباز یا اختصاصی خود بر روی PostgreSQL، آزادانه از آن سود ببرید، بدون اینکه با هیچ غافلگیری قانونی ناخوشایندی روبرو شوید. عدم وابستگی به فروشنده همراه با توانایی پایهگذاری کامل کسب و کار خود بر روی Postgres بدون هیچ محدودیت مجوزی، یک وجه تمایز قدرتمند است که باعث میشود Postgres در حوزه پایگاه داده بدرخشد. این مجوز تغییر نخواهد کرد: همانطور که جاناتان کاتز از تیم اصلی در مارس 2024 اشاره کرد، “پروژه PostgreSQL به عنوان یک تلاش مشترک متنباز آغاز شد و برای جلوگیری از کنترل توسط یک نهاد واحد راهاندازی شده است. این امر تقریباً 30 سال بعد در اصول پروژه ادامه یافت و حتی در سراسر سیاستهای پروژه مدون شد.” قدرت و توسعهپذیری PostgreSQL به آن کمک کرده است تا موارد استفاده را در طیف وسیعی از صنایع و برنامهها پیدا کند. به طور قابل توجهی، سیستمهای بانکی، اعتباری و خردهفروشی عظیمی وجود دارند که از آن در سناریوهای پردازش تراکنش آنلاین (OLTP) استفاده میکنند، اما همچنین از قابلیتهای پیشرفته پرسوجو و گزارشدهی آن برای انجام تجزیه و تحلیلهای تجاری در مقیاس بزرگ، از جمله پردازش تحلیلی آنلاین (OLAP) بهره میبرند. افزونههایی مانند PostGIS برای سیستمهای اطلاعات جغرافیایی (GIS)، فروشگاههای ستونی Citus، TimescaleDB برای دادههای سری زمانی و pgvector برای جستجوی برداری، قابلیتهای تخصصی زیادی را برای گسترش بیشتر پایگاه کاربران خود اضافه کردهاند. هتلهای زنجیرهای، استودیوهای فیلم، شرکتهای حمل و نقل، شرکتهای بیمه، سازمانهای دولتی، مؤسسات بهداشتی و آژانسهای فضایی از انواع مختلف Postgres استفاده میکنند و این فهرست همچنان ادامه دارد. برای این کاربردها، استحکام، مقیاسپذیری و قابلیت اطمینان از اهمیت بالایی برخوردار است. البته، این اکوسیستم توسط چندین فروشنده، مشاور و پیمانکار بزرگ و کوچک تکمیل میشود که همه این برنامهها را با تخصص خود فعال میکنند. در راستای محبوبیت بیشتر PostgreSQL و مشاهده موارد استفاده بیشتر در هر روز، شاهد هستیم که بسیاری از کاربران یا سعی میکنند شیوههایی را که از استفاده از سایر سیستمهای مدیریت پایگاه داده (DBMS) آموختهاند، به کار گیرند یا ویژگیهای Postgres را اشتباه درک کنند. این میتواند به صورت تکرار چیزی باشد که میدانید در سیستم پایگاه داده دیگری کار میکند، یا استفاده از یک ویژگی بدون درک کامل مستندات آن. به عنوان مثال، PostgreSQL از انواع دادههای پیچیده مانند آرایهها پشتیبانی میکند، در حالی که شما باید چندین ردیف با دادههای تکراری در پایگاههای داده دیگر وارد کنید. گاهی اوقات فقط به دلیل استفاده از ابزار اشتباه برای کار، به عنوان مثال، تابع یا نوع داده اشتباه است. حتی ممکن است انتخابی که انجام دادهاید در حال حاضر کار کند، اما در آینده به دلایل مختلف، مانند بزرگتر شدن جدول، از کار بیفتد. این عوامل و اغلب منجر به اشتباهاتی میشوند که اگر در یک سیستم عملیاتی رخ دهند، میتوانند پرهزینه باشند. بهتر است آگاه باشید و آنها را زود تشخیص دهید، زیرا اصلاح این اشتباهات نیز میتواند زمانبر باشد و ممکن است شامل درجه بالایی از دشواری یا ریسک باشد، مانند تغییر چیزی در یک سیستم زنده که در حال استفاده است.
Welcome to PostgreSQL Mistakes and How to Avoid Them! Presumably, you got your hands on this book to learn more about PostgreSQL, and that is indeed the book’s purpose. However, it’s not a tutorial book in the traditional sense, nor is it an administration guide – there are good books already on those subjects. This book makes it a point that mistakes do happen, and that they are a good learning opportunity. In this chapter, we will see why PostgreSQL is important right now, how this book examines PostgreSQLrelated mistakes and why this is a worthwhile endeavor. As we mentioned before, PostgreSQL (a.k.a. Postgres) is a disruptive technology that has started unseating giant database vendors from their thrones. It is a robust and reliable feature-rich database, very extensible, and gaining more enterprise features with each new release. It has found wide acceptance in the database community but also in commercial circles, with hundreds of vendors now offering code contributions, professional support, enhanced capabilities versions and even hosted, cloud, or Database-as-a- Service (DBaaS) Postgres offerings. Very importantly, the PostgreSQL Project is a prime example of communityled and community-driven free software, and this is expressed in the PostgreSQL License. This is particularly significant with most every other database vendor adhering to proprietary software and with both established and emerging database efforts switching to non-open-source compliant licenses in an attempt to chase profitability by restricting the ways others can make money with their product. On the other hand, you can freely profit from PostgreSQL by selling support, hosting, training or services, and even basing your own open source or proprietary product on it with no nasty legal surprises hiding around the corner. The lack of vendor lock-in combined with the ability to be able to base your business entirely on Postgres with no licensing restrictions is a powerful differentiator that makes Postgres shine bright in the database field. This license won’t change: as Jonathan Katz of the Core Team pointed out in March 2024, “The PostgreSQL Project began as a collaborative open source effort and is set up to prevent a single entity to take control. This carries through in the project’s ethos almost 30 years later, and is even codified throughout the project policies”. PostgreSQL’s power and extensibility have helped it find use cases in a very wide array of industries and applications. Notably, there are huge banking, credit and retail systems putting it to use in Online Transaction Processing (OLTP) scenarios, but also taking advantage of its advanced querying and reporting capabilities to perform large-scale business analytics, including Online Analytical Processing (OLAP). Extensions such as PostGIS for Geographic Information Systems (GIS), Citus columnar stores, TimescaleDB for time series data, and pgvector for vector search added lots of specialized functionality to further expand its user base. There are hotel chains, film studios, shipping firms, insurance companies, state organizations, health institutions and space agencies using one form of Postgres or another, and the list goes on. For these uses, robustness, scalability and reliability are of paramount importance. Of course, this ecosystem is completed by several large and small vendors, consultants and contractors who enable all these applications with their expertise. In line with PostgreSQL becoming more popular and seeing more use cases every day, we see a multitude of users either trying to apply practices they’ve learned from using other Database Management Systems (DBMSs) or misunderstanding Postgres features. This can be in the form of repeating something that you know works on another database system, or using a feature without a full understanding of its documentation. For example, PostgreSQL supports complex data types like arrays, whereas you would have to insert multiple rows with repeated data in other databases. Sometimes it’s just a case of using the wrong tool for the job, for example, the wrong function or data type. It can even be the case that a choice that you have made made works right now, but will stop working in the future for various reasons, such as a table becoming much larger. These factors and more often lead to mistakes which can be costly, if they happen on a production system. It’s better to be aware and to catch them early, as these mistakes can also be time-consuming to rectify and may involve a high degree of difficulty or risk, such as changing something on a live system that is in use.
این کتاب را میتوانید از لینک زیر بصورت رایگان دانلود کنید:
نظرات کاربران