Comments (6)
Ids generated by flake will always fit into 128-bits. They will never grow outside of this bounds. Using flake to generate URLs seems like a fine plan so long as you don't mind the shortened URLs being predictable by nature (base-62 encoded they will be 18-characters in length). If you want them to be unpredictable so that having one of these URLs acts as authorization to a private resource, you might want to explore other alternatives like base-62 encoding a secure cryptographic hash.
Does this help? Happy to answer any more questions.
D
from flake.
My only worry about this is, the purpose of these urls is to be short, they go into tweets... so i'm concerned since the IDs will only go into 128-bits the urls are going to be pretty long.
At the moment, with my mysql auto-inc counter the suffix is about 5 characters, and will stay there until 3,500,000 rows. Then it'll move to 6 characters until 36,200,000 rows. It's important to me to keep these urls short. I'm not sure if flake is the right thing for me :(
Could you perhaps recommend something else, or maybe I could modify flake to fit into what I want? I've been looking around for weeks and have found nothing...
Also, how can Flake handle failover situations, I presume I would have to classify the node running flake (and the web server) as failing if that flake instance died? Do you tend to run an instance of flake per application node?
from flake.
Any news on this? :-) Thanks.
from flake.
It sounds like flake ids might not be the best fit for what you are doing. Here's a thread on url shortening algorithms that might be a better fit.
Yes typically we run flake on every host that is in need of an id generation service so that they all talk over localhost--and there is no reason not to do this since no coordination between flake nodes is required. There is no notion of failover in flake itself.
from flake.
Do you have that link? :-) Thanks again for your help!
from flake.
No problem. Sorry about leaving off the link earlier. Here it is http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
from flake.
Related Issues (8)
- erlang:now issues when generating ids
- introduce flake client lib HOT 4
- Make flake deployable as OPT app and managed as rebar dependency HOT 7
- Add upstart/systemd scripts
- Direct datastore integration
- Can this be used as module within another application?
- Can you add an open source license to this project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flake.