Muutke küpsiste eelistusi

MongoDB in Action [Pehme köide]

  • Formaat: Paperback / softback, 375 pages, kõrgus x laius x paksus: 235x190x26 mm, kaal: 810 g
  • Ilmumisaeg: 07-Apr-2016
  • Kirjastus: Manning Publications
  • ISBN-10: 1617291609
  • ISBN-13: 9781617291609
Teised raamatud teemal:
  • Formaat: Paperback / softback, 375 pages, kõrgus x laius x paksus: 235x190x26 mm, kaal: 810 g
  • Ilmumisaeg: 07-Apr-2016
  • Kirjastus: Manning Publications
  • ISBN-10: 1617291609
  • ISBN-13: 9781617291609
Teised raamatud teemal:

Application developers love MongoDB, a document-oriented NoSQL database, for its speed, flexibility, scalability, and ease of use. MongoDB is well-suited as a back-end for modern web applications. Its schema-free design encourages rapid application development, and built-in replication and auto-sharding architecture allow for massive parallel distribution. Production deployments at SourceForge, Foursquare, and Shutterfly demonstrate daily that MongoDB is up to real-world challenges.

MongoDB in Action, Second Edition is a comprehensive guide to MongoDB version 2.6. It begins with a general overview of current database systems, explaining what makes MongoDB unique and describing its ideal use cases. Then, a series of tutorials lead into detailed examples for leveraging MongoDB in e-commerce, social networking, and other common applications. A reference section on schema design patterns helps ease the transition from the relational data model of SQL to MongoDB's document-based data model.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Preface xvii
Acknowledgments xix
About this book xxi
About the cover illustration xxiv
PART 1 GETTING STARTED
1(70)
1 A database for the modern web
3(26)
1.1 Built for the internet
5(1)
1.2 MongoDB's key features
6(9)
Document data model
6(4)
Ad hoc queries
10(1)
Indexes
10(1)
Replication
11(1)
Speed and durability
12(2)
Scaling
14(1)
1.3 MongoDB's core server and tools
15(3)
Core server
16(1)
JavaScript shell
16(1)
Database drivers
17(1)
Command-line tools
18(1)
1.4 Why MongoDB?
18(6)
MongoDB versus other databases
19(3)
Use cases and production deployments
22(2)
1.5 Tips and limitations
24(1)
1.6 History of MongoDB
25(2)
1.7 Additional resources
27(1)
1.8 Summary
28(1)
2 MongoDB through the JavaScript shell
29(23)
2.1 Diving into the MongoDB shell
30(9)
Starting the shell
30(1)
Databases, collections, and documents
31(1)
Inserts and queries
32(2)
Updating documents
34(4)
Deleting data
38(1)
Other shell features
38(1)
2.2 Creating and querying with indexes
39(7)
Creating a large collection
39(2)
Indexing and explain( )
41(5)
2.3 Basic administration
46(3)
Getting database information
46(2)
How commands work
48(1)
2.4 Getting help
49(2)
2.5 Summary
51(1)
3 Writing programs using MongoDB
52(19)
3.1 MongoDB through the Ruby lens
53(6)
Installing and connecting
53(2)
Inserting documents in Ruby
55(1)
Queries and cursors
56(1)
Updates and deletes
57(1)
Database commands
58(1)
3.2 How the drivers work
59(2)
Object ID generation
59(2)
3.3 Building a simple application
61(8)
Setting up
61(1)
Gathering data
62(3)
Viewing the archive
65(4)
3.4 Summary
69(2)
PART 2 APPLICATION DEVELOPMENT IN MONGODB
71(124)
4 Document-oriented data
73(25)
4.1 Principles of schema design
74(1)
4.2 Designing an e-commerce data model
75(9)
Schema basics
76(4)
Users and orders
80(3)
Reviews
83(1)
4.3 Nuts and bolts: On databases, collections, and documents
84(12)
Databases
84(3)
Collections
87(5)
Documents and insertion
92(4)
4.4 Summary
96(2)
5 Constructing queries
98(22)
5.1 E-commerce queries
99(4)
Products, categories, and reviews
99(2)
Users and orders
101(2)
5.2 MongoDB's query language
103(16)
Query criteria and selectors
103(14)
Query options
117(2)
5.3 Summary
119(1)
6 Aggregation
120(37)
6.1 Aggregation framework overview
121(2)
6.2 E-commerce aggregation example
123(12)
Products, categories, and reviews
125(7)
User and order
132(3)
6.3 Aggregation pipeline operators
135(5)
$project
136(1)
$group
136(2)
$match, $sort, $skip, $limit
138(1)
$unwind
139(1)
$out
139(1)
6.4 Reshaping documents
140(6)
String functions
141(1)
Arithmetic functions
142(1)
Date functions
142(1)
Logical functions
143(1)
Set Operators
144(1)
Miscellaneous functions
145(1)
6.5 Understanding aggregation pipeline performance
146(6)
Aggregation pipeline options
147(1)
The aggregation framework's explain( ) function
147(4)
allowDiskUse option
151(1)
Aggregation cursor option
151(1)
6.6 Other aggregation capabilities
152(4)
.count( ) and distinct( )
153(1)
map-reduce
153(3)
6.7 Summary
156(1)
7 Updates, atomic operations, and deletes
157(38)
7.1 A brief tour of document updates
158(4)
Modify by replacement
159(1)
Modify by operator
159(1)
Both methods compared
160(1)
Deciding: replacement vs. operators
160(2)
7.2 E-commerce updates
162(9)
Products and categories
162(5)
Reviews
167(1)
Orders
168(3)
7.3 Atomic document processing
171(8)
Order state transitions
172(2)
Inventory management
174(5)
7.4 Nuts and bolts: MongoDB updates and deletes
179(13)
Update types and options
179(2)
Update operators
181(7)
The findAndModify command
188(1)
Deletes
189(1)
Concurrency, atomicity, and isolation
190(1)
Update performance notes
191(1)
7.5 Reviewing update operators
192(1)
7.6 Summary
193(2)
PART 3 MONGODB MASTERY
195(216)
8 Indexing and query optimization
197(47)
8.1 Indexing theory
198(9)
A thought experiment
198(3)
Core indexing concepts
201(4)
B-trees
205(2)
8.2 Indexing in practice
207(9)
Index types
207(4)
Index administration
211(5)
8.3 Query optimization
216(27)
Identifying slow queries
217(4)
Examining slow queries
221(20)
Query patterns
241(2)
8.4 Summary
243(1)
9 Text search
244(29)
9.1 Text searches---not just pattern matching
245(8)
Text searches vs. pattern matching
246(1)
Text searches vs. web page searches
247(3)
MongoDB text search vs. dedicated text search engines
250(3)
9.2 Manning book catalog data download
253(2)
9.3 Defining text search indexes
255(2)
Text index size
255(1)
Assigning an index name and indexing all text fields in a collection
256(1)
9.4 Basic text search
257(6)
More complex searches
259(2)
Text search scores
261(1)
Sorting results by text search score
262(1)
9.5 Aggregation framework text search
263(4)
Where's MongoDB in Action, Second Edition?
265(2)
9.6 Text search languages
267(5)
Specifying language in the index
267(2)
Specifying the language in the document
269(1)
Specifying the language in a search
269(2)
Available languages
271(1)
9.7 Summary
272(1)
10 WiredTiger and pluggable storage
273(23)
10.1 Pluggable Storage Engine API
273(2)
Why use different storages engines?
274(1)
10.2 WiredTiger
275(3)
Switching to WiredTiger
276(1)
Migrating your database to WiredTiger
277(1)
10.3 Comparison with MMAPvl
278(11)
Configuration files
279(2)
Insertion script and benchmark script
281(2)
Insertion benchmark results
283(2)
Read performance scripts
285(1)
Read performance results
286(2)
Benchmark conclusion
288(1)
10.4 Other examples of pluggable storage engines
289(1)
10.5 Advanced topics
290(5)
How does a pluggable storage engine work?
290(2)
Data structure
292(2)
Locking
294(1)
10.6 Summary
295(1)
11 Replication
296(37)
11.1 Replication overview
297(3)
Why replication matters
297(1)
Replication use cases and limitations
298(2)
11.2 Replica sets
300(24)
Setup
300(7)
How replication works
307(7)
Administration
314(10)
11.3 Drivers and replication
324(8)
Connections and failover
324(3)
Write concern
327(1)
Read scaling
328(2)
Tagging
330(2)
11.4 Summary
332(1)
12 Scaling your system with sharding
333(43)
12.1 Sharding overview
334(2)
What is sharding?
334(1)
When should you shard?
335(1)
12.2 Understanding components of a sharded cluster
336(3)
Shards: storage of application data
337(1)
Mongos router: router of operations
338(1)
Config servers: storage of metadata
338(1)
12.3 Distributing data in a sharded cluster
339(4)
Ways data can be distributed in a sharded cluster
340(1)
Distributing databases to shards
341(1)
Sharding within collections
341(2)
12.4 Building a sample shard cluster
343(12)
Starting the mongod and mongos servers
343(3)
Configuring the cluster
346(1)
Sharding collections
347(2)
Writing to a sharded cluster
349(6)
12.5 Querying and indexing a shard cluster
355(4)
Query routing
355(1)
Indexing in a sharded cluster
356(1)
The explain() tool in a sharded cluster
357(2)
Aggregation in a sharded cluster
359(1)
12.6 Choosing a shard key
359(6)
Imbalanced writes (hotspots)
360(2)
Unsplittable chunks (coarse granularity)
362(1)
Poor targeting (shard key not present in queries)
362(1)
Ideal shard keys
363(1)
Inherent design trade-offs (email application)
364(1)
12.7 Sharding in production
365(10)
Provisioning
366(3)
Deployment
369(1)
Maintenance
370(5)
12.8 Summary
375(1)
13 Deployment and administration
376(35)
13.1 Hardware and provisioning
377(9)
Cluster topology
377(1)
Deployment environment
378(7)
Provisioning
385(1)
13.2 Monitoring and diagnostics
386(5)
Logging
387(1)
MongoDB diagnostic commands
387(1)
MongoDB diagnostic tools
388(2)
MongoDB Monitoring Service
390(1)
External monitoring applications
390(1)
13.3 Backups
391(3)
Mongodump and mongorestore
391(1)
Data file--based backups
392(1)
MMS backups
393(1)
13.4 Security
394(8)
Secure environments
394(1)
Network encryption
395(2)
Authentication
397(4)
Replica set authentication
401(1)
Sharding authentication
402(1)
Enterprise security features
402(1)
13.5 Administrative tasks
402(3)
Data imports and exports
402(1)
Compaction and repair
403(2)
Upgrading
405(1)
13.6 Performance troubleshooting
405(3)
Working set
406(1)
Performance cliff
407(1)
Query interactions
407(1)
Seek professional assistance
408(1)
13.7 Deployment checklist
408(2)
13.8 Summary
410(1)
Appendix A Installation 411(10)
Appendix B Design patterns 421(12)
Appendix C Binary data and GridFS 433(8)
Index 441
AUTHOR BIO





After several years maintaining the MongoDB Ruby driver at 10gen, Kyle Banker is now plying his skills at a startup. Peter Bakkum is a developer with expertise using MongoDB for building and scaling data infrastructure in large commercial deployments. Tim Hawkins served as the Head of European Search Engineering for Yahoo and later as a lead solutions architect focused on internationalization and scalability.