Bitcoin Forum
April 26, 2018, 08:05:52 AM *
News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Best practices for maintaining many bitcoin accounts on a website  (Read 722 times)
Full Member
Offline Offline

Activity: 184
Merit: 100

View Profile WWW
June 24, 2011, 08:22:39 PM

I am working on a website running on bitcoin. Users will be able to deposit and withdraw bitcoins, also there will be transactions between users and the site possibly several times a day for each user. I'd like to do some premature optimization and build something that can scale for large number of users. What are the best practices in your opinion? I am considering three options:

1) Always consolidate option: Accounts will be maintained by bitcoind for every user. Every time a transaction happens bitcoins will be moved between accounts.
No other background process (More reliable, faster website?)
Simpler database (faster?)
Less code
Incoming transaction confirmations will be handled by bitcoid
Account balance will be checked only by bitcoind calls
Transaction history checks are trivial
More load on the bitcoin network
Lots of transaction fees
Performance issues with bitcoind for lots of accounts and transactions?

2) Periodic consolidation option: Every user still has own account in bitcoind. But transaction are stored in the database and committed periodically (once a day?) to bitcoind.
Minimal load on the bitcoin network
Less transaction fees
Incoming transaction confirmations will be handled by bitcoind
Extra daemon and database to maintain
Account balance checks require both database and bitcoind calls
Withdrawals require extra account consolidations
Transaction history checks might be tricky
Performance issues of bitcoind for large number of accounts?

3) No consolidation option: There will be single account for the whole site, but users will be given unique addresses for deposits. All internal transactions will be maintained in the database. External transactions will be monitored frequently (every minute?) and committed to the database.
No unnecessary load on the bitcoin network
No unnecessary transaction fees
Account balance checks will only require a database call
Transaction history checks are trivial (but may be unreliable?)
Better bitcoind performance?
Too much load by the daemon (overall performance issues?)
Extra daemon and database to maintain
More code
Issues with incoming transaction validations

Currently I am leaning towards the second option, but please add options, pros, cons or other opinion.


NOTE TO ADMINS: If you find this discussion useful, would you move it to "Project Development"?

Bets of Bitcoin
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!