Files
build-web-application-with-…/zh-tw/05.0.md
2019-02-26 01:40:54 +08:00

17 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 5 訪問資料庫
對許多Web應用程式而言資料庫都是其核心所在。資料庫幾乎可以用來儲存你想查詢和修改的任何資訊比如使用者資訊、產品目錄或者新聞列表等。
Go沒有內建的驅動支援任何的資料庫但是Go定義了database/sql介面使用者可以基於驅動介面開發相應資料庫的驅動5.1小節裡面介紹Go設計的一些驅動介紹Go是如何設計資料庫驅動介面的。5.2至5.4小節介紹目前使用的比較多的一些關係型資料驅動以及如何使用5.5小節介紹我自己開發一個ORM函式庫基於database/sql標準介面開發的可以相容幾乎所有支援database/sql的資料庫驅動可以方便的使用Go style來進行資料庫操作。
目前NOSQL已經成為Web開發的一個潮流很多應用採用了NOSQL作為資料庫而不是以前的快取5.6小節將介紹MongoDB和Redis兩種NOSQL資料庫。
>[Go database/sql tutorial](http://go-database-sql.org/) 裡提供了慣用的範例及詳細的說明。
## 目錄
![](images/navi5.png?raw=true)
## links
* [目錄](<preface.md>)
* 上一章: [第四章總結](<04.6.md>)
* 下一節: [database/sql介面](<05.1.md>)