fix typos and grammar in 05.6.md and 05.7.md

This commit is contained in:
Anchor
2014-09-22 12:29:04 -07:00
committed by James Miranda
parent 4af9c3275a
commit ac4d57272b
2 changed files with 12 additions and 12 deletions

View File

@@ -1,12 +1,12 @@
# 5.6 NoSQL database
A NoSQL database provides a mechanism for storage and retrieval of data that use looser consistency models than relational database in order to achieve horizontal scaling and higher availability. Some authors refer to them as "Not only SQL" to emphasize that some NoSQL systems do allow SQL-like query language to be used.
A NoSQL database provides a mechanism for the storage and retrieval of data that uses looser consistency models than typical relational databases in order to achieve horizontal scaling and higher availability. Some authors refer to them as "Not only SQL" to emphasize that some NoSQL systems do allow SQL-like query languages to be used.
As the C language of 21st century, Go has good support for NoSQL databases, and the popular NoSQL database including redis, mongoDB, Cassandra and Membase.
As the C language of the 21st century, Go has good support for NoSQL databases, including the popular redis, mongoDB, Cassandra and Membase NoSQL databases.
## redis
redis is a key-value storage system like Memcached, it supports string, list, set and zset(ordered set) as it's value types.
redis is a key-value storage system like Memcached, that supports the string, list, set and zset(ordered set) value types.
There are some Go database drivers for redis:
@@ -15,11 +15,11 @@ There are some Go database drivers for redis:
- [https://github.com/simonz05/godis](https://github.com/simonz05/godis)
- [https://github.com/hoisie/redis.go](https://github.com/hoisie/redis.go)
I forked the last one and fixed some bugs, and use it in my short URL service(2 million PV every day).
I forked the last of these packages, fixed some bugs, and used it in my short URL service (2 million PV every day).
- [https://github.com/astaxie/goredis](https://github.com/astaxie/goredis)
Let's see how to use the driver that I forked to operate database:
Let's see how to use the driver that I forked to operate on a database:
package main
@@ -52,7 +52,7 @@ Let's see how to use the driver that I forked to operate database:
client.Del("l")
}
We can see that it's quite easy to operate redis in Go, and it has high performance. Its client commands are almost the same as redis built-in commands.
We can see that it's quite easy to operate redis in Go, and it has high performance. Its client commands are almost the same as redis' built-in commands.
## mongoDB
@@ -60,9 +60,9 @@ mongoDB (from "humongous") is an open source document-oriented database system d
![](images/5.6.mongodb.png?raw=true)
Figure 5.1 MongoDB compares to Mysql
Figure 5.1 MongoDB compared to Mysql
The best driver for mongoDB is called `mgo`, and it is possible to be in the standard library in the future.
The best driver for mongoDB is called `mgo`, and it is possible that it will be included in the standard library in the future.
Here is the example:
@@ -104,7 +104,7 @@ Here is the example:
fmt.Println("Phone:", result.Phone)
}
We can see that there is no big different to operate database between mgo and beedb, they are both based on struct, this is what Go style is.
We can see that there are no big differences when it comes to operating on mgo or beedb databases; they are both based on structs. This is the Go way of doing things.
## Links

View File

@@ -1,11 +1,11 @@
# 5.7 Summary
In this chapter, you first learned the design of `database/sql` interface, and many third-party database drivers for different kinds of database. Then I introduced beedb to you, an ORM for relational databases, also showed some samples for operating database. In the end, I talked about some NoSQL databases, I have to see Go gives very good support for those NoSQL databases.
In this chapter, you first learned about the design of the `database/sql` interface and many third-party database drivers for various database types. Then I introduced beedb, an ORM for relational databases, to you. I also showed you some sample database operations. In the end, I talked about a few NoSQL databases. We saw that Go provides very good support for those NoSQL databases.
After read this chapter, I hope you know how to operate databases in Go. This is the most important part in web development, so I want to you completely understand design ideas of `database/sql` interface.
After reading this chapter, I hope that you have a better understanding of how to operate databases in Go. This is the most important part of web development, so I want you to completely understand the design concepts of the `database/sql` interface.
## Links
- [Directory](preface.md)
- Previous section: [NoSQL database](05.6.md)
- Next section: [Data storage and session](06.0.md)
- Next section: [Data storage and session](06.0.md)