<p>I'm new to go and used to using just normal databases to store data. The program I'm making right now needs to store some data the program gathers, not much so should I go the traditional way of a database of some sort or are there smarter ways to do it?</p>
<hr/>**评论:**<br/><br/>nathj07: <pre><p>This should be language agnostic, Go can work with pretty much any data store. The questions you should ask yourself are around the data itself. Is it relational or will a wide table model work? What's the access like, do you need high performance? If it is distributed over many nodes or shards what consistency model do you need? Is it mostly reads or writes? </p>
<p>You say the needs are small now and you hint at mostly writes. I would think PostgreSQL would work and would allow for growth. Alternatively bolt or sqlite as mentioned for smaller scale.</p>
<p>All these questions/factors will inform your decision of what database to use.</p></pre>taion809: <pre><p>try this one <a href="https://github.com/boltdb/bolt" rel="nofollow">https://github.com/boltdb/bolt</a> ?</p>
<p>edit: also you could try sqlite as you already have experience with databases...</p></pre>Hexodam: <pre><p>I really like this one. The use for the database is for a user to generate config for remote agents to pull through a https api. Boltdb seems to fit perfectly </p></pre>CaptaincCodeman: <pre><p>Think about where you want to host the app and what data services the host offers. It's so much easier just using a database service than have to setup and manage a database instance yourself.</p>
<p>If you host on Google AppEngine for instance you could use their cloud datastore or Cloud SQL. On Amazon they have DynamoDB and RDBMS services. A hosted Mongo instance is also an option.</p></pre>xyproto: <pre><p><a href="https://github.com/xyproto/simpleredis" rel="nofollow">simpleredis</a>, <a href="https://github.com/xyproto/simplemaria" rel="nofollow">simplemaria</a> and <a href="https://github.com/xyproto/simplebolt" rel="nofollow">simplebolt</a> are three easy ways to store data. They all conform to one of the interfaces in the <a href="https://github.com/xyproto/pinterface" rel="nofollow">pinterface</a> package, so that they can be used interchangeably.</p></pre>tv64738: <pre><p>Nothing about Go here (apart from what libraries are available & convenient).</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传